mirror of
https://gitlab.com/fabinfra/fabhardware/FabReader2.git
synced 2025-03-12 06:31:54 +01:00
Initial commit
This commit is contained in:
commit
1398d16353
172
.cproject
Normal file
172
.cproject
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||||
|
<cconfiguration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1062644101">
|
||||||
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1062644101" 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="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1062644101" name="Debug" parent="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug">
|
||||||
|
<folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1062644101." name="/" resourcePath="">
|
||||||
|
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug.82460479" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.1799753119" name="MCU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" value="STM32F303RETx" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.338533619" name="CPU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" value="0" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.2125806384" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" value="0" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.415972104" name="Floating-point unit" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.value.fpv4-sp-d16" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.686571344" name="Floating-point ABI" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.1761656271" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" value="NUCLEO-F303RE" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.863575625" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.5 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || NUCLEO-F303RE || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32F3xx_HAL_Driver/Inc | ../Drivers/STM32F3xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32F3xx/Include | ../Drivers/CMSIS/Include || || || USE_HAL_DRIVER | STM32F303xE || || Drivers | Core/Startup | Core || || || ${workspace_loc:/${ProjName}/STM32F303RETX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || " valueType="string"/>
|
||||||
|
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.1631167048" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
|
||||||
|
<builder buildPath="${workspace_loc:/FabReader2}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1729750077" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.580189042" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.746953012" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g3" valueType="enumerated"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.564300469" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||||
|
</option>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.1325632377" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.2075994659" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.1929043904" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g3" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1294710231" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.993074025" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||||
|
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
||||||
|
<listOptionValue builtIn="false" value="STM32F303xE"/>
|
||||||
|
</option>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.61379881" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" valueType="includePath">
|
||||||
|
<listOptionValue builtIn="false" value="../Core/Inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Drivers/STM32F3xx_HAL_Driver/Inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Drivers/STM32F3xx_HAL_Driver/Inc/Legacy"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F3xx/Include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
|
||||||
|
</option>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.2071324354" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.670240529" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.28054163" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g3" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.1600178771" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.2019675226" name="MCU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script.1907262140" name="Linker Script (-T)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script" value="${workspace_loc:/${ProjName}/STM32F303RETX_FLASH.ld}" valueType="string"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input.1302371892" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input">
|
||||||
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
|
</inputType>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.255166671" name="MCU G++ Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.177931166" name="MCU GCC Archiver" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.1864643987" name="MCU Size" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.1612747990" name="MCU Output Converter list file" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.2079355757" name="MCU Output Converter Hex" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.1610990769" name="MCU Output Converter Binary" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.195105714" name="MCU Output Converter Verilog" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.79050342" name="MCU Output Converter Motorola S-rec" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.1009770041" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/>
|
||||||
|
</toolChain>
|
||||||
|
</folderInfo>
|
||||||
|
<sourceEntries>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
|
||||||
|
</sourceEntries>
|
||||||
|
</configuration>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||||
|
</cconfiguration>
|
||||||
|
<cconfiguration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.5869287">
|
||||||
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.5869287" 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="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.5869287" name="Release" parent="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release">
|
||||||
|
<folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.5869287." name="/" resourcePath="">
|
||||||
|
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release.1683246290" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.706190575" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" value="STM32F303RETx" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.485453352" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" value="0" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.2115265865" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" value="0" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.229453822" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.value.fpv4-sp-d16" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.1793899694" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.143972321" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" value="NUCLEO-F303RE" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.1139892364" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.5 || Release || false || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || NUCLEO-F303RE || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32F3xx_HAL_Driver/Inc | ../Drivers/STM32F3xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32F3xx/Include | ../Drivers/CMSIS/Include || || || USE_HAL_DRIVER | STM32F303xE || || Drivers | Core/Startup | Core || || || ${workspace_loc:/${ProjName}/STM32F303RETX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || " valueType="string"/>
|
||||||
|
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.411913657" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
|
||||||
|
<builder buildPath="${workspace_loc:/FabReader2}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1953080609" managedBuildOn="true" name="Gnu Make Builder.Release" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1702348834" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.537950281" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0" valueType="enumerated"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.598965978" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.318358188" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.1495800299" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.337025909" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os" valueType="enumerated"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.1698545029" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
||||||
|
<listOptionValue builtIn="false" value="STM32F303xE"/>
|
||||||
|
</option>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.1966737894" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" valueType="includePath">
|
||||||
|
<listOptionValue builtIn="false" value="../Core/Inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Drivers/STM32F3xx_HAL_Driver/Inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Drivers/STM32F3xx_HAL_Driver/Inc/Legacy"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32F3xx/Include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
|
||||||
|
</option>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1872976128" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.2028715824" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.1389486892" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.443781793" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.value.os" valueType="enumerated"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.1059479310" name="MCU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script.42693244" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script" value="${workspace_loc:/${ProjName}/STM32F303RETX_FLASH.ld}" valueType="string"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input.1698488971" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input">
|
||||||
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
|
</inputType>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.1843339704" name="MCU G++ Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.540618529" name="MCU GCC Archiver" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.1091624358" name="MCU Size" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.651391353" name="MCU Output Converter list file" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.1467940022" name="MCU Output Converter Hex" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.1334440984" name="MCU Output Converter Binary" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.1002765492" name="MCU Output Converter Verilog" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.2090129986" name="MCU Output Converter Motorola S-rec" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.719318440" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/>
|
||||||
|
</toolChain>
|
||||||
|
</folderInfo>
|
||||||
|
<sourceEntries>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
|
||||||
|
</sourceEntries>
|
||||||
|
</configuration>
|
||||||
|
</storageModule>
|
||||||
|
</cconfiguration>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.pathentry"/>
|
||||||
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
<project id="FabReader2.null.389310302" name="FabReader2"/>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||||
|
<storageModule moduleId="scannerConfiguration">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1062644101;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.1062644101.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.2075994659;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.2071324354">
|
||||||
|
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
</scannerConfigBuildInfo>
|
||||||
|
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.5869287;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.5869287.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.318358188;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1872976128">
|
||||||
|
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
</scannerConfigBuildInfo>
|
||||||
|
</storageModule>
|
||||||
|
</cproject>
|
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
2
.idea/FabReader2.iml
generated
Normal file
2
.idea/FabReader2.iml
generated
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
7
.idea/discord.xml
generated
Normal file
7
.idea/discord.xml
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DiscordProjectSettings">
|
||||||
|
<option name="show" value="ASK" />
|
||||||
|
<option name="description" value="" />
|
||||||
|
</component>
|
||||||
|
</project>
|
4
.idea/misc.xml
generated
Normal file
4
.idea/misc.xml
generated
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||||
|
</project>
|
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/FabReader2.iml" filepath="$PROJECT_DIR$/.idea/FabReader2.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
25
.mxproject
Normal file
25
.mxproject
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
[PreviousGenFiles]
|
||||||
|
AdvancedFolderStructure=true
|
||||||
|
HeaderFileListSize=3
|
||||||
|
HeaderFiles#0=/Users/kjkriegel/Documents/Development/FabAccess/FabReader2/Core/Inc/stm32f3xx_it.h
|
||||||
|
HeaderFiles#1=/Users/kjkriegel/Documents/Development/FabAccess/FabReader2/Core/Inc/stm32f3xx_hal_conf.h
|
||||||
|
HeaderFiles#2=/Users/kjkriegel/Documents/Development/FabAccess/FabReader2/Core/Inc/main.h
|
||||||
|
HeaderFolderListSize=1
|
||||||
|
HeaderPath#0=/Users/kjkriegel/Documents/Development/FabAccess/FabReader2/Core/Inc
|
||||||
|
HeaderFiles=;
|
||||||
|
SourceFileListSize=3
|
||||||
|
SourceFiles#0=/Users/kjkriegel/Documents/Development/FabAccess/FabReader2/Core/Src/stm32f3xx_it.c
|
||||||
|
SourceFiles#1=/Users/kjkriegel/Documents/Development/FabAccess/FabReader2/Core/Src/stm32f3xx_hal_msp.c
|
||||||
|
SourceFiles#2=/Users/kjkriegel/Documents/Development/FabAccess/FabReader2/Core/Src/main.c
|
||||||
|
SourceFolderListSize=1
|
||||||
|
SourcePath#0=/Users/kjkriegel/Documents/Development/FabAccess/FabReader2/Core/Src
|
||||||
|
SourceFiles=;
|
||||||
|
|
||||||
|
[PreviousLibFiles]
|
||||||
|
LibFiles=Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_spi.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_spi_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_cortex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_exti.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim_ex.h;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_spi.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_spi_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_exti.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_spi.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_spi_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_def.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_rcc_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_gpio_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_dma.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_cortex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_pwr_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_flash_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_i2c_ex.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_exti.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim.h;Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tim_ex.h;Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f303xe.h;Drivers/CMSIS/Device/ST/STM32F3xx/Include/stm32f3xx.h;Drivers/CMSIS/Device/ST/STM32F3xx/Include/system_stm32f3xx.h;Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/system_stm32f3xx.c;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/tz_context.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/cmsis_compiler.h;Drivers/CMSIS/Include/cmsis_armclang.h;Drivers/CMSIS/Include/mpu_armv7.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/cmsis_iccarm.h;Drivers/CMSIS/Include/core_armv8mml.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_cm1.h;Drivers/CMSIS/Include/mpu_armv8.h;Drivers/CMSIS/Include/core_sc300.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/cmsis_version.h;Drivers/CMSIS/Include/core_cm23.h;Drivers/CMSIS/Include/core_cm33.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_armv8mbl.h;
|
||||||
|
|
||||||
|
[PreviousUsedCubeIDEFiles]
|
||||||
|
SourceFiles=Core/Src/main.c;Core/Src/stm32f3xx_it.c;Core/Src/stm32f3xx_hal_msp.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_spi.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_spi_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_exti.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c;Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/system_stm32f3xx.c;Core/Src/system_stm32f3xx.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_spi.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_spi_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_rcc_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_gpio.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_dma.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_cortex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_pwr_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_flash_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_i2c_ex.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_exti.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim.c;Drivers/STM32F3xx_HAL_Driver/Src/stm32f3xx_hal_tim_ex.c;Drivers/CMSIS/Device/ST/STM32F3xx/Source/Templates/system_stm32f3xx.c;Core/Src/system_stm32f3xx.c;;;
|
||||||
|
HeaderPath=Drivers/STM32F3xx_HAL_Driver/Inc;Drivers/STM32F3xx_HAL_Driver/Inc/Legacy;Drivers/CMSIS/Device/ST/STM32F3xx/Include;Drivers/CMSIS/Include;Core/Inc;
|
||||||
|
CDefines=USE_HAL_DRIVER;STM32F303xE;USE_HAL_DRIVER;USE_HAL_DRIVER;
|
||||||
|
|
0
.osx.project
Normal file
0
.osx.project
Normal file
32
.project
Normal file
32
.project
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>FabReader2</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>com.st.stm32cube.ide.mcu.MCUProjectNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUCubeProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCURootProjectNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
Binary file not shown.
2
Hardware/FabReader2/FabReader2.kicad_pcb
Normal file
2
Hardware/FabReader2/FabReader2.kicad_pcb
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
(kicad_pcb (version 20211014) (generator pcbnew)
|
||||||
|
)
|
75
Hardware/FabReader2/FabReader2.kicad_prl
Normal file
75
Hardware/FabReader2/FabReader2.kicad_prl
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
{
|
||||||
|
"board": {
|
||||||
|
"active_layer": 0,
|
||||||
|
"active_layer_preset": "",
|
||||||
|
"auto_track_width": true,
|
||||||
|
"hidden_nets": [],
|
||||||
|
"high_contrast_mode": 0,
|
||||||
|
"net_color_mode": 1,
|
||||||
|
"opacity": {
|
||||||
|
"pads": 1.0,
|
||||||
|
"tracks": 1.0,
|
||||||
|
"vias": 1.0,
|
||||||
|
"zones": 0.6
|
||||||
|
},
|
||||||
|
"ratsnest_display_mode": 0,
|
||||||
|
"selection_filter": {
|
||||||
|
"dimensions": true,
|
||||||
|
"footprints": true,
|
||||||
|
"graphics": true,
|
||||||
|
"keepouts": true,
|
||||||
|
"lockedItems": true,
|
||||||
|
"otherItems": true,
|
||||||
|
"pads": true,
|
||||||
|
"text": true,
|
||||||
|
"tracks": true,
|
||||||
|
"vias": true,
|
||||||
|
"zones": true
|
||||||
|
},
|
||||||
|
"visible_items": [
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
4,
|
||||||
|
5,
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
10,
|
||||||
|
11,
|
||||||
|
12,
|
||||||
|
13,
|
||||||
|
14,
|
||||||
|
15,
|
||||||
|
16,
|
||||||
|
17,
|
||||||
|
18,
|
||||||
|
19,
|
||||||
|
20,
|
||||||
|
21,
|
||||||
|
22,
|
||||||
|
23,
|
||||||
|
24,
|
||||||
|
25,
|
||||||
|
26,
|
||||||
|
27,
|
||||||
|
28,
|
||||||
|
29,
|
||||||
|
30,
|
||||||
|
32,
|
||||||
|
33,
|
||||||
|
34,
|
||||||
|
35,
|
||||||
|
36
|
||||||
|
],
|
||||||
|
"visible_layers": "fffffff_ffffffff",
|
||||||
|
"zone_display_mode": 0
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"filename": "FabReader2.kicad_prl",
|
||||||
|
"version": 3
|
||||||
|
},
|
||||||
|
"project": {
|
||||||
|
"files": []
|
||||||
|
}
|
||||||
|
}
|
326
Hardware/FabReader2/FabReader2.kicad_pro
Normal file
326
Hardware/FabReader2/FabReader2.kicad_pro
Normal file
@ -0,0 +1,326 @@
|
|||||||
|
{
|
||||||
|
"board": {
|
||||||
|
"design_settings": {
|
||||||
|
"defaults": {
|
||||||
|
"board_outline_line_width": 0.1,
|
||||||
|
"copper_line_width": 0.2,
|
||||||
|
"copper_text_size_h": 1.5,
|
||||||
|
"copper_text_size_v": 1.5,
|
||||||
|
"copper_text_thickness": 0.3,
|
||||||
|
"other_line_width": 0.15,
|
||||||
|
"silk_line_width": 0.15,
|
||||||
|
"silk_text_size_h": 1.0,
|
||||||
|
"silk_text_size_v": 1.0,
|
||||||
|
"silk_text_thickness": 0.15
|
||||||
|
},
|
||||||
|
"diff_pair_dimensions": [],
|
||||||
|
"drc_exclusions": [],
|
||||||
|
"rules": {
|
||||||
|
"min_copper_edge_clearance": 0.0,
|
||||||
|
"solder_mask_clearance": 0.0,
|
||||||
|
"solder_mask_min_width": 0.0
|
||||||
|
},
|
||||||
|
"track_widths": [],
|
||||||
|
"via_dimensions": []
|
||||||
|
},
|
||||||
|
"layer_presets": []
|
||||||
|
},
|
||||||
|
"boards": [],
|
||||||
|
"cvpcb": {
|
||||||
|
"equivalence_files": []
|
||||||
|
},
|
||||||
|
"erc": {
|
||||||
|
"erc_exclusions": [],
|
||||||
|
"meta": {
|
||||||
|
"version": 0
|
||||||
|
},
|
||||||
|
"pin_map": [
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
[
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
2
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"rule_severities": {
|
||||||
|
"bus_definition_conflict": "error",
|
||||||
|
"bus_entry_needed": "error",
|
||||||
|
"bus_label_syntax": "error",
|
||||||
|
"bus_to_bus_conflict": "error",
|
||||||
|
"bus_to_net_conflict": "error",
|
||||||
|
"different_unit_footprint": "error",
|
||||||
|
"different_unit_net": "error",
|
||||||
|
"duplicate_reference": "error",
|
||||||
|
"duplicate_sheet_names": "error",
|
||||||
|
"extra_units": "error",
|
||||||
|
"global_label_dangling": "warning",
|
||||||
|
"hier_label_mismatch": "error",
|
||||||
|
"label_dangling": "error",
|
||||||
|
"lib_symbol_issues": "warning",
|
||||||
|
"multiple_net_names": "warning",
|
||||||
|
"net_not_bus_member": "warning",
|
||||||
|
"no_connect_connected": "warning",
|
||||||
|
"no_connect_dangling": "warning",
|
||||||
|
"pin_not_connected": "error",
|
||||||
|
"pin_not_driven": "error",
|
||||||
|
"pin_to_pin": "warning",
|
||||||
|
"power_pin_not_driven": "error",
|
||||||
|
"similar_labels": "warning",
|
||||||
|
"unannotated": "error",
|
||||||
|
"unit_value_mismatch": "error",
|
||||||
|
"unresolved_variable": "error",
|
||||||
|
"wire_dangling": "error"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libraries": {
|
||||||
|
"pinned_footprint_libs": [],
|
||||||
|
"pinned_symbol_libs": []
|
||||||
|
},
|
||||||
|
"meta": {
|
||||||
|
"filename": "FabReader2.kicad_pro",
|
||||||
|
"version": 1
|
||||||
|
},
|
||||||
|
"net_settings": {
|
||||||
|
"classes": [
|
||||||
|
{
|
||||||
|
"bus_width": 12.0,
|
||||||
|
"clearance": 0.2,
|
||||||
|
"diff_pair_gap": 0.25,
|
||||||
|
"diff_pair_via_gap": 0.25,
|
||||||
|
"diff_pair_width": 0.2,
|
||||||
|
"line_style": 0,
|
||||||
|
"microvia_diameter": 0.3,
|
||||||
|
"microvia_drill": 0.1,
|
||||||
|
"name": "Default",
|
||||||
|
"pcb_color": "rgba(0, 0, 0, 0.000)",
|
||||||
|
"schematic_color": "rgba(0, 0, 0, 0.000)",
|
||||||
|
"track_width": 0.25,
|
||||||
|
"via_diameter": 0.8,
|
||||||
|
"via_drill": 0.4,
|
||||||
|
"wire_width": 6.0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"meta": {
|
||||||
|
"version": 2
|
||||||
|
},
|
||||||
|
"net_colors": null
|
||||||
|
},
|
||||||
|
"pcbnew": {
|
||||||
|
"last_paths": {
|
||||||
|
"gencad": "",
|
||||||
|
"idf": "",
|
||||||
|
"netlist": "",
|
||||||
|
"specctra_dsn": "",
|
||||||
|
"step": "",
|
||||||
|
"vrml": ""
|
||||||
|
},
|
||||||
|
"page_layout_descr_file": ""
|
||||||
|
},
|
||||||
|
"schematic": {
|
||||||
|
"annotate_start_num": 0,
|
||||||
|
"drawing": {
|
||||||
|
"default_line_thickness": 6.0,
|
||||||
|
"default_text_size": 50.0,
|
||||||
|
"field_names": [],
|
||||||
|
"intersheets_ref_own_page": false,
|
||||||
|
"intersheets_ref_prefix": "",
|
||||||
|
"intersheets_ref_short": false,
|
||||||
|
"intersheets_ref_show": false,
|
||||||
|
"intersheets_ref_suffix": "",
|
||||||
|
"junction_size_choice": 3,
|
||||||
|
"label_size_ratio": 0.375,
|
||||||
|
"pin_symbol_size": 25.0,
|
||||||
|
"text_offset_ratio": 0.15
|
||||||
|
},
|
||||||
|
"legacy_lib_dir": "",
|
||||||
|
"legacy_lib_list": [],
|
||||||
|
"meta": {
|
||||||
|
"version": 1
|
||||||
|
},
|
||||||
|
"net_format_name": "",
|
||||||
|
"ngspice": {
|
||||||
|
"fix_include_paths": true,
|
||||||
|
"fix_passive_vals": false,
|
||||||
|
"meta": {
|
||||||
|
"version": 0
|
||||||
|
},
|
||||||
|
"model_mode": 0,
|
||||||
|
"workbook_filename": ""
|
||||||
|
},
|
||||||
|
"page_layout_descr_file": "",
|
||||||
|
"plot_directory": "",
|
||||||
|
"spice_adjust_passive_values": false,
|
||||||
|
"spice_external_command": "spice \"%I\"",
|
||||||
|
"subpart_first_id": 65,
|
||||||
|
"subpart_id_separator": 0
|
||||||
|
},
|
||||||
|
"sheets": [
|
||||||
|
[
|
||||||
|
"e63e39d7-6ac0-4ffd-8aa3-1841a4541b55",
|
||||||
|
""
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"text_variables": {}
|
||||||
|
}
|
14
Hardware/FabReader2/FabReader2.kicad_sch
Normal file
14
Hardware/FabReader2/FabReader2.kicad_sch
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
(kicad_sch (version 20211123) (generator eeschema)
|
||||||
|
|
||||||
|
(uuid e63e39d7-6ac0-4ffd-8aa3-1841a4541b55)
|
||||||
|
|
||||||
|
(paper "A4")
|
||||||
|
|
||||||
|
(lib_symbols
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
(sheet_instances
|
||||||
|
(path "/" (page "1"))
|
||||||
|
)
|
||||||
|
)
|
148
Hardware/FabReader2/Library/2305018-2/2305018-2.kicad_sym
Normal file
148
Hardware/FabReader2/Library/2305018-2/2305018-2.kicad_sym
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
(kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor)
|
||||||
|
(symbol "2305018-2" (pin_names (offset 1.016)) (in_bom yes) (on_board yes)
|
||||||
|
(property "Reference" "J" (id 0) (at -12.7 18.0594 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Value" "2305018-2" (id 1) (at -12.7 -20.3454 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Footprint" "TE_2305018-2" (id 2) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "Datasheet" "" (id 3) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "Comment" "2305018-2" (id 4) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "ki_locked" "" (id 5) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)))
|
||||||
|
)
|
||||||
|
(symbol "2305018-2_0_0"
|
||||||
|
(rectangle (start -12.7 -17.78) (end 12.7 17.78)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type background))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 -7.62 0) (length 5.08)
|
||||||
|
(name "GNDA" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "A1" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 -5.08 0) (length 5.08)
|
||||||
|
(name "RX2_N" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "A10" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 -2.54 0) (length 5.08)
|
||||||
|
(name "RX2_P" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "A11" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 -7.62 0) (length 5.08)
|
||||||
|
(name "GNDA" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "A12" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 15.24 0) (length 5.08)
|
||||||
|
(name "TX1_P" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "A2" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 12.7 0) (length 5.08)
|
||||||
|
(name "TX1_N" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "A3" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 10.16 0) (length 5.08)
|
||||||
|
(name "VBUS_A" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "A4" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 7.62 0) (length 5.08)
|
||||||
|
(name "CC1" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "A5" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 5.08 0) (length 5.08)
|
||||||
|
(name "DA_P" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "A6" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 2.54 0) (length 5.08)
|
||||||
|
(name "DA_N" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "A7" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 0 0) (length 5.08)
|
||||||
|
(name "SBU1" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "A8" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 10.16 0) (length 5.08)
|
||||||
|
(name "VBUS_A" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "A9" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at 17.78 -7.62 180) (length 5.08)
|
||||||
|
(name "GNDB" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "B1" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at 17.78 12.7 180) (length 5.08)
|
||||||
|
(name "RX1_N" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "B10" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at 17.78 15.24 180) (length 5.08)
|
||||||
|
(name "RX1_P" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "B11" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at 17.78 -7.62 180) (length 5.08)
|
||||||
|
(name "GNDB" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "B12" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at 17.78 -2.54 180) (length 5.08)
|
||||||
|
(name "TX2_P" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "B2" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at 17.78 -5.08 180) (length 5.08)
|
||||||
|
(name "TX2_N" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "B3" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at 17.78 10.16 180) (length 5.08)
|
||||||
|
(name "VBUS_B" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "B4" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at 17.78 7.62 180) (length 5.08)
|
||||||
|
(name "CC2" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "B5" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at 17.78 5.08 180) (length 5.08)
|
||||||
|
(name "DB_P" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "B6" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at 17.78 2.54 180) (length 5.08)
|
||||||
|
(name "DB_N" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "B7" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at 17.78 0 180) (length 5.08)
|
||||||
|
(name "SBU2" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "B8" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at 17.78 10.16 180) (length 5.08)
|
||||||
|
(name "VBUS_B" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "B9" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -12.7 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "G1" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -12.7 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "G2" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "SHIELD" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "S1" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "SHIELD" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "S2" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "SHIELD" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "S3" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "SHIELD" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "S4" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
49
Hardware/FabReader2/Library/2305018-2/2305018-2.lib
Normal file
49
Hardware/FabReader2/Library/2305018-2/2305018-2.lib
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
EESchema-LIBRARY Version 2.3
|
||||||
|
#encoding utf-8
|
||||||
|
#(c) SnapEDA 2016 (snapeda.com)
|
||||||
|
#This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0
|
||||||
|
#
|
||||||
|
# 2305018-2
|
||||||
|
#
|
||||||
|
DEF 2305018-2 J 0 40 Y Y 1 L N
|
||||||
|
F0 "J" -500 711 50 H V L BNN
|
||||||
|
F1 "2305018-2" -500 -801 50 H V L BNN
|
||||||
|
F2 "TE_2305018-2" 0 0 50 H I L BNN
|
||||||
|
F3 "" 0 0 50 H I L BNN
|
||||||
|
F4 "2305018-2" 0 0 50 H I L BNN "Comment"
|
||||||
|
DRAW
|
||||||
|
S -500 -700 500 700 0 0 10 f
|
||||||
|
X TX1_P A2 -700 600 200 R 40 40 0 0 P
|
||||||
|
X TX1_N A3 -700 500 200 R 40 40 0 0 P
|
||||||
|
X VBUS_A A4 -700 400 200 R 40 40 0 0 P
|
||||||
|
X VBUS_A A9 -700 400 200 R 40 40 0 0 P
|
||||||
|
X CC1 A5 -700 300 200 R 40 40 0 0 P
|
||||||
|
X DA_P A6 -700 200 200 R 40 40 0 0 P
|
||||||
|
X DA_N A7 -700 100 200 R 40 40 0 0 P
|
||||||
|
X SBU1 A8 -700 0 200 R 40 40 0 0 P
|
||||||
|
X RX2_P A11 -700 -100 200 R 40 40 0 0 P
|
||||||
|
X RX2_N A10 -700 -200 200 R 40 40 0 0 P
|
||||||
|
X GNDA A1 -700 -300 200 R 40 40 0 0 P
|
||||||
|
X GNDA A12 -700 -300 200 R 40 40 0 0 P
|
||||||
|
X RX1_P B11 700 600 200 L 40 40 0 0 P
|
||||||
|
X RX1_N B10 700 500 200 L 40 40 0 0 P
|
||||||
|
X VBUS_B B4 700 400 200 L 40 40 0 0 P
|
||||||
|
X VBUS_B B9 700 400 200 L 40 40 0 0 P
|
||||||
|
X CC2 B5 700 300 200 L 40 40 0 0 P
|
||||||
|
X DB_P B6 700 200 200 L 40 40 0 0 P
|
||||||
|
X DB_N B7 700 100 200 L 40 40 0 0 P
|
||||||
|
X SBU2 B8 700 0 200 L 40 40 0 0 P
|
||||||
|
X TX2_P B2 700 -100 200 L 40 40 0 0 P
|
||||||
|
X TX2_N B3 700 -200 200 L 40 40 0 0 P
|
||||||
|
X GNDB B1 700 -300 200 L 40 40 0 0 P
|
||||||
|
X GNDB B12 700 -300 200 L 40 40 0 0 P
|
||||||
|
X GND G1 700 -500 200 L 40 40 0 0 W
|
||||||
|
X GND G2 700 -500 200 L 40 40 0 0 W
|
||||||
|
X SHIELD S1 700 -600 200 L 40 40 0 0 W
|
||||||
|
X SHIELD S2 700 -600 200 L 40 40 0 0 W
|
||||||
|
X SHIELD S3 700 -600 200 L 40 40 0 0 W
|
||||||
|
X SHIELD S4 700 -600 200 L 40 40 0 0 W
|
||||||
|
ENDDRAW
|
||||||
|
ENDDEF
|
||||||
|
#
|
||||||
|
# End Library
|
42595
Hardware/FabReader2/Library/2305018-2/2305018-2.step
Normal file
42595
Hardware/FabReader2/Library/2305018-2/2305018-2.step
Normal file
File diff suppressed because it is too large
Load Diff
24
Hardware/FabReader2/Library/2305018-2/License.txt
Normal file
24
Hardware/FabReader2/Library/2305018-2/License.txt
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
BY ACCESSING OR USING THESE SYMBOLS & FOOTPRINTS ("MODELS"), YOU ARE ACKNOWLEDGING THAT YOU HAVE READ, FULLY UNDERSTAND AND AGREE TO THESE TERMS AND CONDITIONS (the "Agreement"), WHICH CONSTITUTE A BINDING AGREEMENT BETWEEN YOU AND SNAPEDA, INC., ENTERED INTO ON THE DATE OF SUCH OCCURRENCE (the "Effective Date"). IF YOU ARE ACCESSING OR USING THESE FILES ON BEHALF OF AN ENTITY, YOU REPRESENT THAT YOU HAVE THE RIGHT, AUTHORITY, AND CAPACITY TO BIND SUCH ENTITY TO THIS AGREEMENT AND HEREBY DO SO. IF YOU DO NOT AGREE WITH ANY OF THE TERMS OR CONDITIONS OF THIS AGREEMENT, YOU MUST NOT USE ANY PART OF THESE MODELS.
|
||||||
|
|
||||||
|
1. Design License
|
||||||
|
|
||||||
|
You and your sub-licensees are hereby licensed to design, manufacture, use and distribute, circuit board designs and circuit boards formed by combining Models provided by SnapEDA with other circuit elements of your choosing. You may then convey such combinations under licensing terms of your choice.
|
||||||
|
|
||||||
|
Individual Models remain the intellectual property of SnapEDA, Inc. You shall not (and shall not permit or encourage any third party to) to do any of the following :
|
||||||
|
|
||||||
|
(a) sell, assign, lease, lend, rent, issue, sublicense, make available, or otherwise distribute to any third party, or publicly perform, display or communicate, the Models (for example, by uploading Models to another website or software application);
|
||||||
|
(b) remove, alter, or conceal, any copyright, trademark, or other proprietary rights notice or legend displayed or contained in the individual Models.
|
||||||
|
|
||||||
|
For further clarity, once integrated into a schematic design or PCB layout, Models may be modified freely for the purpose of designing a circuit board.
|
||||||
|
|
||||||
|
|
||||||
|
2. Limitation of Liability
|
||||||
|
|
||||||
|
IN NO EVENT WILL SNAPEDA OR OUR SUBSIDIARIES, AGENTS, SUCCESSORS, THIRD PARTY PROVIDERS, AND/OR ANY OF THE FOREGOING ENTITIES' RESPECTIVE DIRECTORS, OFFICERS, EMPLOYEES, AGENTS, REPRESENTATIVES, CUSTOMERS, SUPPLIERS, OR LICENSORS BE RESPONSIBLE OR LIABLE UNDER, OR OTHERWISE IN CONNECTION WITH THIS AGREEMENT, FOR:
|
||||||
|
|
||||||
|
(a) ANY CONSEQUENTIAL, INDIRECT, SPECIAL, INCIDENTAL, OR PUNITIVE DAMAGES;
|
||||||
|
(b) ANY LOSS OF PROFITS, LOSS OF BUSINESS, LOSS OF REVENUE, OR LOSS OF ANTICIPATED SAVINGS;
|
||||||
|
(c) ANY LOSS OF, OR DAMAGE TO, DATA, REPUTATION, OR GOODWILL; AND/OR
|
||||||
|
(d) THE COST OF PROCURING ANY SUBSTITUTE GOODS OR SERVICES.
|
||||||
|
|
||||||
|
THE COMBINED AGGREGATE LIABILITY OF SNAPEDA AND ALL SNAPEDA CONTENT AFFILIATES UNDER, OR OTHERWISE IN CONNECTION WITH, THIS AGREEMENT SHALL NOT EXCEED THE TOTAL AMOUNT OF FEES RECEIVED BY SNAPEDA FROM YOU IN THE PREVIOUS TWELVE (12) MONTHS. THE FOREGOING EXCLUSIONS AND LIMITATIONS SHALL APPLY: (a) EVEN IF SNAPEDA OR ANY SNAPEDA CONTENT AFFILIATE HAS BEEN ADVISED, OR SHOULD HAVE BEEN AWARE, OF THE POSSIBILITY OF LOSSES, DAMAGES, OR COSTS; (b) EVEN IF ANY REMEDY IN THIS AGREEMENT FAILS OF ITS ESSENTIAL PURPOSE; AND (c) REGARDLESS OF THE THEORY OR BASIS OF LIABILITY (INCLUDING WITHOUT LIMITATION BREACH OF CONTRACT, TORT, NEGLIGENCE, AND STRICT LIABILITY).
|
57
Hardware/FabReader2/Library/2305018-2/TE_2305018-2.kicad_mod
Normal file
57
Hardware/FabReader2/Library/2305018-2/TE_2305018-2.kicad_mod
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
|
||||||
|
(module TE_2305018-2 (layer F.Cu) (tedit 6269D74F)
|
||||||
|
(descr "")
|
||||||
|
(fp_text reference REF** (at -2.973105 -5.666129 0) (layer F.SilkS)
|
||||||
|
(effects (font (size 0.641100787402 0.641100787402) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(fp_text value TE_2305018-2 (at -0.123382 4.8507135 0) (layer F.Fab)
|
||||||
|
(effects (font (size 0.640939370079 0.640939370079) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(pad S1 thru_hole oval (at -4.45 0.0) (size 1.025 2.05) (drill oval 0.45 1.65) (layers *.Cu *.Mask))
|
||||||
|
(pad S2 thru_hole oval (at 4.45 0.0) (size 1.025 2.05) (drill oval 0.45 1.65) (layers *.Cu *.Mask))
|
||||||
|
(pad S3 thru_hole oval (at -4.45 -3.2) (size 0.925 1.85) (drill oval 0.45 1.45) (layers *.Cu *.Mask))
|
||||||
|
(pad S4 thru_hole oval (at 4.45 -3.2) (size 0.925 1.85) (drill oval 0.45 1.45) (layers *.Cu *.Mask))
|
||||||
|
(pad G1 smd rect (at -3.55 -3.375) (size 0.3 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad G2 smd rect (at 3.55 -3.375) (size 0.3 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad A1 smd rect (at -3.05 -3.375) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad A2 smd rect (at -2.25 -3.375) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad A3 smd rect (at -1.75 -3.375) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad A4 smd rect (at -1.25 -3.375) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad A5 smd rect (at -0.75 -3.375) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad A6 smd rect (at -0.25 -3.375) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad A7 smd rect (at 0.25 -3.375) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad A8 smd rect (at 0.75 -3.375) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad A9 smd rect (at 1.25 -3.375) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad A10 smd rect (at 1.75 -3.375) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad A11 smd rect (at 2.25 -3.375) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad A12 smd rect (at 3.05 -3.375) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad B1 smd rect (at 3.0 -2.125) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad B2 smd rect (at 2.5 -2.125) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad B3 smd rect (at 2.0 -2.125) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad B4 smd rect (at 1.5 -2.125) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad B5 smd rect (at 1.0 -2.125) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad B6 smd rect (at 0.5 -2.125) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad B7 smd rect (at -0.5 -2.125) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad B8 smd rect (at -1.0 -2.125) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad B9 smd rect (at -1.5 -2.125) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad B10 smd rect (at -2.0 -2.125) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad B11 smd rect (at -2.5 -2.125) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad B12 smd rect (at -3.0 -2.125) (size 0.25 0.75) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(fp_line (start -4.925 4.2) (end -4.925 -4.45) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start -4.925 -4.45) (end 4.925 -4.45) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start 4.925 -4.45) (end 4.925 4.2) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start -4.925 4.2) (end 4.925 4.2) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start -4.925 -4.45) (end 4.925 -4.45) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 4.925 1.4) (end -4.925 1.4) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 4.925 1.4) (end 4.925 1.23125) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 4.925 -1.23125) (end 4.925 -2.15469) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 4.925 -4.30938) (end 4.925 -4.45) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -4.925 1.4) (end -4.925 1.23125) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -4.925 -1.23125) (end -4.925 -2.15469) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -4.925 -4.30938) (end -4.925 -4.45) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -5.175 4.45) (end -5.175 -4.7) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -5.175 -4.7) (end 5.175 -4.7) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start 5.175 -4.7) (end 5.175 4.45) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start 5.175 4.45) (end -5.175 4.45) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_circle (center -3.085 -4.907) (end -2.985 -4.907) (layer F.SilkS) (width 0.2))
|
||||||
|
)
|
1
Hardware/FabReader2/Library/2305018-2/how-to-import.htm
Normal file
1
Hardware/FabReader2/Library/2305018-2/how-to-import.htm
Normal file
@ -0,0 +1 @@
|
|||||||
|
<!DOCTYPE HTML><html lang="en-US"> <head> <meta charset="UTF-8"> <meta http-equiv="refresh" content="0; url=https://www.snapeda.com/about/import/#"> <script type="text/javascript">window.location.href="https://www.snapeda.com/about/import/#" </script> <title>Page Redirection</title> </head> <body> If you are not redirected automatically, follow this <a href="https://www.snapeda.com/about/import/#">link to the import guide</a>. </body></html>
|
@ -0,0 +1,135 @@
|
|||||||
|
(kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor)
|
||||||
|
(symbol "CMI-9705-0380-SMT-TR" (pin_numbers hide) (pin_names (offset 1.016) hide) (in_bom yes) (on_board yes)
|
||||||
|
(property "Reference" "LS" (id 0) (at -1.27 6.35 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Value" "CMI-9705-0380-SMT-TR" (id 1) (at -1.27 -8.255 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Footprint" "CUI_CMI-9705-0380-SMT-TR" (id 2) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "Datasheet" "" (id 3) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "PARTREV" "1.0" (id 4) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "MANUFACTURER" "CUI Inc." (id 5) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "MAXIMUM_PACKAGE_HEIGHT" "5.2mm" (id 6) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "STANDARD" "Manufacturer Recommendations" (id 7) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "ki_locked" "" (id 8) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)))
|
||||||
|
)
|
||||||
|
(symbol "CMI-9705-0380-SMT-TR_0_0"
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy -3.175 -1.905)
|
||||||
|
(xy -2.54 -1.905)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy -3.175 1.905)
|
||||||
|
(xy -3.175 -1.905)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy -3.175 1.905)
|
||||||
|
(xy -2.54 1.905)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy -2.54 -2.54)
|
||||||
|
(xy -2.54 -1.905)
|
||||||
|
)
|
||||||
|
(stroke (width 0.1524) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy -2.54 -1.905)
|
||||||
|
(xy 0 -1.905)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy -2.54 1.905)
|
||||||
|
(xy 0 1.905)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy -2.54 2.54)
|
||||||
|
(xy -2.54 1.905)
|
||||||
|
)
|
||||||
|
(stroke (width 0.1524) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 0 -1.905)
|
||||||
|
(xy 0 1.905)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 0 -1.905)
|
||||||
|
(xy 2.54 -5.08)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 0 1.905)
|
||||||
|
(xy 2.54 5.08)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 2.54 -5.08)
|
||||||
|
(xy 2.54 5.08)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(text "+" (at -4.318 3.302 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(text "-" (at -4.318 -3.556 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(pin passive line (at -2.54 -5.08 90) (length 2.54)
|
||||||
|
(name "~" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "N" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -2.54 5.08 270) (length 2.54)
|
||||||
|
(name "~" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "P" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
@ -0,0 +1,36 @@
|
|||||||
|
EESchema-LIBRARY Version 2.3
|
||||||
|
#encoding utf-8
|
||||||
|
#(c) SnapEDA 2016 (snapeda.com)
|
||||||
|
#This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0
|
||||||
|
#
|
||||||
|
# CMI-9705-0380-SMT-TR
|
||||||
|
#
|
||||||
|
DEF CMI-9705-0380-SMT-TR LS 0 40 N N 1 L N
|
||||||
|
F0 "LS" -50 250 50 H V L BNN
|
||||||
|
F1 "CMI-9705-0380-SMT-TR" -50 -325 50 H V L BNN
|
||||||
|
F2 "CUI_CMI-9705-0380-SMT-TR" 0 0 50 H I L BNN
|
||||||
|
F3 "" 0 0 50 H I L BNN
|
||||||
|
F4 "1.0" 0 0 50 H I L BNN "PARTREV"
|
||||||
|
F5 "CUI Inc." 0 0 50 H I L BNN "MANUFACTURER"
|
||||||
|
F6 "5.2mm" 0 0 50 H I L BNN "MAXIMUM_PACKAGE_HEIGHT"
|
||||||
|
F7 "Manufacturer Recommendations" 0 0 50 H I L BNN "STANDARD"
|
||||||
|
DRAW
|
||||||
|
P 2 0 0 10 -125 75 -125 -75 N
|
||||||
|
P 2 0 0 10 -125 -75 -100 -75 N
|
||||||
|
P 2 0 0 10 0 -75 0 75 N
|
||||||
|
P 2 0 0 10 -125 75 -100 75 N
|
||||||
|
P 2 0 0 10 0 -75 100 -200 N
|
||||||
|
P 2 0 0 10 100 -200 100 200 N
|
||||||
|
P 2 0 0 10 0 75 100 200 N
|
||||||
|
P 2 0 0 6 -100 -100 -100 -75 N
|
||||||
|
P 2 0 0 10 -100 -75 0 -75 N
|
||||||
|
P 2 0 0 6 -100 100 -100 75 N
|
||||||
|
P 2 0 0 10 -100 75 0 75 N
|
||||||
|
T 0 -170 130 50 0 0 0 + Normal 0 L B
|
||||||
|
T 0 -170 -140 50 0 0 0 - Normal 0 L B
|
||||||
|
X ~ N -100 -200 100 U 40 40 0 0 P
|
||||||
|
X ~ P -100 200 100 D 40 40 0 0 P
|
||||||
|
ENDDRAW
|
||||||
|
ENDDEF
|
||||||
|
#
|
||||||
|
# End Library
|
@ -0,0 +1,40 @@
|
|||||||
|
|
||||||
|
(module CUI_CMI-9705-0380-SMT-TR (layer F.Cu) (tedit 6269D69C)
|
||||||
|
(descr "")
|
||||||
|
(fp_text reference REF** (at -1.925 -6.935 0) (layer F.SilkS)
|
||||||
|
(effects (font (size 1.0 1.0) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(fp_text value CUI_CMI-9705-0380-SMT-TR (at 10.14 6.865 0) (layer F.Fab)
|
||||||
|
(effects (font (size 1.0 1.0) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(pad N smd rect (at 0.0 4.95) (size 1.7 1.5) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad P smd rect (at 0.0 -4.95) (size 1.7 1.5) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(fp_line (start -4.85 -4.85) (end 4.85 -4.85) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start 4.85 -4.85) (end 4.85 4.85) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start 4.85 4.85) (end -2.65 4.85) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start -4.85 -4.85) (end -4.85 2.65) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start -4.85 2.65) (end -2.65 4.85) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start -1.35 -4.85) (end -4.85 -4.85) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -4.85 -4.85) (end -4.85 2.65) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -4.85 2.65) (end -2.65 4.85) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -2.65 4.85) (end -1.35 4.85) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 1.35 4.85) (end 4.85 4.85) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 4.85 4.85) (end 4.85 -4.85) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 4.85 -4.85) (end 1.34 -4.85) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -5.1 -5.95) (end 5.1 -5.95) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start 5.1 -5.95) (end 5.1 5.95) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start 5.1 5.95) (end -5.1 5.95) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -5.1 5.95) (end -5.1 -5.95) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_text user + (at 1.8 -5.8) (layer F.SilkS)
|
||||||
|
(effects (font (size 1.0 1.0) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(fp_text user + (at 1.8 -5.8) (layer F.Fab)
|
||||||
|
(effects (font (size 1.0 1.0) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(fp_text user - (at 2.0 6.3) (layer F.Fab)
|
||||||
|
(effects (font (size 1.0 1.0) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(fp_text user - (at 2.0 6.3) (layer F.SilkS)
|
||||||
|
(effects (font (size 1.0 1.0) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
)
|
24
Hardware/FabReader2/Library/CMI-9705-0380-SMT-TR/License.txt
Normal file
24
Hardware/FabReader2/Library/CMI-9705-0380-SMT-TR/License.txt
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
BY ACCESSING OR USING THESE SYMBOLS & FOOTPRINTS ("MODELS"), YOU ARE ACKNOWLEDGING THAT YOU HAVE READ, FULLY UNDERSTAND AND AGREE TO THESE TERMS AND CONDITIONS (the "Agreement"), WHICH CONSTITUTE A BINDING AGREEMENT BETWEEN YOU AND SNAPEDA, INC., ENTERED INTO ON THE DATE OF SUCH OCCURRENCE (the "Effective Date"). IF YOU ARE ACCESSING OR USING THESE FILES ON BEHALF OF AN ENTITY, YOU REPRESENT THAT YOU HAVE THE RIGHT, AUTHORITY, AND CAPACITY TO BIND SUCH ENTITY TO THIS AGREEMENT AND HEREBY DO SO. IF YOU DO NOT AGREE WITH ANY OF THE TERMS OR CONDITIONS OF THIS AGREEMENT, YOU MUST NOT USE ANY PART OF THESE MODELS.
|
||||||
|
|
||||||
|
1. Design License
|
||||||
|
|
||||||
|
You and your sub-licensees are hereby licensed to design, manufacture, use and distribute, circuit board designs and circuit boards formed by combining Models provided by SnapEDA with other circuit elements of your choosing. You may then convey such combinations under licensing terms of your choice.
|
||||||
|
|
||||||
|
Individual Models remain the intellectual property of SnapEDA, Inc. You shall not (and shall not permit or encourage any third party to) to do any of the following :
|
||||||
|
|
||||||
|
(a) sell, assign, lease, lend, rent, issue, sublicense, make available, or otherwise distribute to any third party, or publicly perform, display or communicate, the Models (for example, by uploading Models to another website or software application);
|
||||||
|
(b) remove, alter, or conceal, any copyright, trademark, or other proprietary rights notice or legend displayed or contained in the individual Models.
|
||||||
|
|
||||||
|
For further clarity, once integrated into a schematic design or PCB layout, Models may be modified freely for the purpose of designing a circuit board.
|
||||||
|
|
||||||
|
|
||||||
|
2. Limitation of Liability
|
||||||
|
|
||||||
|
IN NO EVENT WILL SNAPEDA OR OUR SUBSIDIARIES, AGENTS, SUCCESSORS, THIRD PARTY PROVIDERS, AND/OR ANY OF THE FOREGOING ENTITIES' RESPECTIVE DIRECTORS, OFFICERS, EMPLOYEES, AGENTS, REPRESENTATIVES, CUSTOMERS, SUPPLIERS, OR LICENSORS BE RESPONSIBLE OR LIABLE UNDER, OR OTHERWISE IN CONNECTION WITH THIS AGREEMENT, FOR:
|
||||||
|
|
||||||
|
(a) ANY CONSEQUENTIAL, INDIRECT, SPECIAL, INCIDENTAL, OR PUNITIVE DAMAGES;
|
||||||
|
(b) ANY LOSS OF PROFITS, LOSS OF BUSINESS, LOSS OF REVENUE, OR LOSS OF ANTICIPATED SAVINGS;
|
||||||
|
(c) ANY LOSS OF, OR DAMAGE TO, DATA, REPUTATION, OR GOODWILL; AND/OR
|
||||||
|
(d) THE COST OF PROCURING ANY SUBSTITUTE GOODS OR SERVICES.
|
||||||
|
|
||||||
|
THE COMBINED AGGREGATE LIABILITY OF SNAPEDA AND ALL SNAPEDA CONTENT AFFILIATES UNDER, OR OTHERWISE IN CONNECTION WITH, THIS AGREEMENT SHALL NOT EXCEED THE TOTAL AMOUNT OF FEES RECEIVED BY SNAPEDA FROM YOU IN THE PREVIOUS TWELVE (12) MONTHS. THE FOREGOING EXCLUSIONS AND LIMITATIONS SHALL APPLY: (a) EVEN IF SNAPEDA OR ANY SNAPEDA CONTENT AFFILIATE HAS BEEN ADVISED, OR SHOULD HAVE BEEN AWARE, OF THE POSSIBILITY OF LOSSES, DAMAGES, OR COSTS; (b) EVEN IF ANY REMEDY IN THIS AGREEMENT FAILS OF ITS ESSENTIAL PURPOSE; AND (c) REGARDLESS OF THE THEORY OR BASIS OF LIABILITY (INCLUDING WITHOUT LIMITATION BREACH OF CONTRACT, TORT, NEGLIGENCE, AND STRICT LIABILITY).
|
@ -0,0 +1 @@
|
|||||||
|
<!DOCTYPE HTML><html lang="en-US"> <head> <meta charset="UTF-8"> <meta http-equiv="refresh" content="0; url=https://www.snapeda.com/about/import/#"> <script type="text/javascript">window.location.href="https://www.snapeda.com/about/import/#" </script> <title>Page Redirection</title> </head> <body> If you are not redirected automatically, follow this <a href="https://www.snapeda.com/about/import/#">link to the import guide</a>. </body></html>
|
61
Hardware/FabReader2/Library/DW01A/DW01A.kicad_sym
Normal file
61
Hardware/FabReader2/Library/DW01A/DW01A.kicad_sym
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
(kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor)
|
||||||
|
(symbol "DW01A" (pin_names (offset 1.016)) (in_bom yes) (on_board yes)
|
||||||
|
(property "Reference" "IC" (id 0) (at -5.08 11.43 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Value" "DW01A" (id 1) (at -5.08 -12.7 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Footprint" "SOT23-6" (id 2) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "Datasheet" "" (id 3) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "VALUE" "DW01A" (id 4) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "LCSC" "C351410" (id 5) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "MPN" "DW01A" (id 6) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "ki_locked" "" (id 7) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)))
|
||||||
|
)
|
||||||
|
(symbol "DW01A_0_0"
|
||||||
|
(rectangle (start -10.16 -10.16) (end 10.16 10.16)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type background))
|
||||||
|
)
|
||||||
|
(text "Lithium Protection" (at -7.112 2.54 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 15.24 -7.62 180) (length 5.08)
|
||||||
|
(name "OD" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "1" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 15.24 7.62 180) (length 5.08)
|
||||||
|
(name "CS" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "2" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 15.24 0 180) (length 5.08)
|
||||||
|
(name "OC" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "3" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at -15.24 0 0) (length 5.08)
|
||||||
|
(name "TD" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "4" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at -15.24 7.62 0) (length 5.08)
|
||||||
|
(name "VCC" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "5" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at -15.24 -7.62 0) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "6" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
28
Hardware/FabReader2/Library/DW01A/DW01A.lib
Normal file
28
Hardware/FabReader2/Library/DW01A/DW01A.lib
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
EESchema-LIBRARY Version 2.3
|
||||||
|
#encoding utf-8
|
||||||
|
#(c) SnapEDA 2016 (snapeda.com)
|
||||||
|
#This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0
|
||||||
|
#
|
||||||
|
# DW01A
|
||||||
|
#
|
||||||
|
DEF DW01A IC 0 40 Y Y 1 L N
|
||||||
|
F0 "IC" -200 450 50 H V L BNN
|
||||||
|
F1 "DW01A" -200 -500 50 H V L BNN
|
||||||
|
F2 "SOT23-6" 0 0 50 H I L BNN
|
||||||
|
F3 "" 0 0 50 H I L BNN
|
||||||
|
F4 "DW01A" 0 0 50 H I L BNN "VALUE"
|
||||||
|
F5 "C351410" 0 0 50 H I L BNN "LCSC"
|
||||||
|
F6 "DW01A" 0 0 50 H I L BNN "MPN"
|
||||||
|
DRAW
|
||||||
|
T 0 -280 100 50 0 0 0 Lithium~Protection Normal 0 L B
|
||||||
|
S -400 -400 400 400 0 0 10 f
|
||||||
|
X VCC 5 -600 300 200 R 40 40 0 0 W
|
||||||
|
X GND 6 -600 -300 200 R 40 40 0 0 W
|
||||||
|
X TD 4 -600 0 200 R 40 40 0 0 B
|
||||||
|
X OD 1 600 -300 200 L 40 40 0 0 B
|
||||||
|
X OC 3 600 0 200 L 40 40 0 0 B
|
||||||
|
X CS 2 600 300 200 L 40 40 0 0 B
|
||||||
|
ENDDRAW
|
||||||
|
ENDDEF
|
||||||
|
#
|
||||||
|
# End Library
|
3216
Hardware/FabReader2/Library/DW01A/DW01A.step
Normal file
3216
Hardware/FabReader2/Library/DW01A/DW01A.step
Normal file
File diff suppressed because it is too large
Load Diff
24
Hardware/FabReader2/Library/DW01A/License.txt
Normal file
24
Hardware/FabReader2/Library/DW01A/License.txt
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
BY ACCESSING OR USING THESE SYMBOLS & FOOTPRINTS ("MODELS"), YOU ARE ACKNOWLEDGING THAT YOU HAVE READ, FULLY UNDERSTAND AND AGREE TO THESE TERMS AND CONDITIONS (the "Agreement"), WHICH CONSTITUTE A BINDING AGREEMENT BETWEEN YOU AND SNAPEDA, INC., ENTERED INTO ON THE DATE OF SUCH OCCURRENCE (the "Effective Date"). IF YOU ARE ACCESSING OR USING THESE FILES ON BEHALF OF AN ENTITY, YOU REPRESENT THAT YOU HAVE THE RIGHT, AUTHORITY, AND CAPACITY TO BIND SUCH ENTITY TO THIS AGREEMENT AND HEREBY DO SO. IF YOU DO NOT AGREE WITH ANY OF THE TERMS OR CONDITIONS OF THIS AGREEMENT, YOU MUST NOT USE ANY PART OF THESE MODELS.
|
||||||
|
|
||||||
|
1. Design License
|
||||||
|
|
||||||
|
You and your sub-licensees are hereby licensed to design, manufacture, use and distribute, circuit board designs and circuit boards formed by combining Models provided by SnapEDA with other circuit elements of your choosing. You may then convey such combinations under licensing terms of your choice.
|
||||||
|
|
||||||
|
Individual Models remain the intellectual property of SnapEDA, Inc. You shall not (and shall not permit or encourage any third party to) to do any of the following :
|
||||||
|
|
||||||
|
(a) sell, assign, lease, lend, rent, issue, sublicense, make available, or otherwise distribute to any third party, or publicly perform, display or communicate, the Models (for example, by uploading Models to another website or software application);
|
||||||
|
(b) remove, alter, or conceal, any copyright, trademark, or other proprietary rights notice or legend displayed or contained in the individual Models.
|
||||||
|
|
||||||
|
For further clarity, once integrated into a schematic design or PCB layout, Models may be modified freely for the purpose of designing a circuit board.
|
||||||
|
|
||||||
|
|
||||||
|
2. Limitation of Liability
|
||||||
|
|
||||||
|
IN NO EVENT WILL SNAPEDA OR OUR SUBSIDIARIES, AGENTS, SUCCESSORS, THIRD PARTY PROVIDERS, AND/OR ANY OF THE FOREGOING ENTITIES' RESPECTIVE DIRECTORS, OFFICERS, EMPLOYEES, AGENTS, REPRESENTATIVES, CUSTOMERS, SUPPLIERS, OR LICENSORS BE RESPONSIBLE OR LIABLE UNDER, OR OTHERWISE IN CONNECTION WITH THIS AGREEMENT, FOR:
|
||||||
|
|
||||||
|
(a) ANY CONSEQUENTIAL, INDIRECT, SPECIAL, INCIDENTAL, OR PUNITIVE DAMAGES;
|
||||||
|
(b) ANY LOSS OF PROFITS, LOSS OF BUSINESS, LOSS OF REVENUE, OR LOSS OF ANTICIPATED SAVINGS;
|
||||||
|
(c) ANY LOSS OF, OR DAMAGE TO, DATA, REPUTATION, OR GOODWILL; AND/OR
|
||||||
|
(d) THE COST OF PROCURING ANY SUBSTITUTE GOODS OR SERVICES.
|
||||||
|
|
||||||
|
THE COMBINED AGGREGATE LIABILITY OF SNAPEDA AND ALL SNAPEDA CONTENT AFFILIATES UNDER, OR OTHERWISE IN CONNECTION WITH, THIS AGREEMENT SHALL NOT EXCEED THE TOTAL AMOUNT OF FEES RECEIVED BY SNAPEDA FROM YOU IN THE PREVIOUS TWELVE (12) MONTHS. THE FOREGOING EXCLUSIONS AND LIMITATIONS SHALL APPLY: (a) EVEN IF SNAPEDA OR ANY SNAPEDA CONTENT AFFILIATE HAS BEEN ADVISED, OR SHOULD HAVE BEEN AWARE, OF THE POSSIBILITY OF LOSSES, DAMAGES, OR COSTS; (b) EVEN IF ANY REMEDY IN THIS AGREEMENT FAILS OF ITS ESSENTIAL PURPOSE; AND (c) REGARDLESS OF THE THEORY OR BASIS OF LIABILITY (INCLUDING WITHOUT LIMITATION BREACH OF CONTRACT, TORT, NEGLIGENCE, AND STRICT LIABILITY).
|
76
Hardware/FabReader2/Library/DW01A/SOT23-6.kicad_mod
Normal file
76
Hardware/FabReader2/Library/DW01A/SOT23-6.kicad_mod
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
|
||||||
|
(module SOT23-6 (layer F.Cu) (tedit 6269D727)
|
||||||
|
(descr "")
|
||||||
|
(fp_text reference REF** (at 1.27 -2.54 0) (layer F.SilkS)
|
||||||
|
(effects (font (size 1.0 1.0) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(fp_text value SOT23-6 (at 2.54 2.794 0) (layer F.Fab)
|
||||||
|
(effects (font (size 1.0 1.0) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(pad 1 smd rect (at -0.95 1.3) (size 0.55 1.2) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 2 smd rect (at 0.0 1.3) (size 0.55 1.2) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 3 smd rect (at 0.95 1.3) (size 0.55 1.2) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 4 smd rect (at 0.95 -1.3) (size 0.55 1.2) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 6 smd rect (at -0.95 -1.3) (size 0.55 1.2) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 5 smd rect (at 0.0 -1.3) (size 0.55 1.2) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(fp_line (start 1.422 -0.81) (end 1.422 0.81) (layer F.SilkS) (width 0.1524))
|
||||||
|
(fp_line (start 1.422 0.81) (end -1.422 0.81) (layer F.Fab) (width 0.1524))
|
||||||
|
(fp_line (start -1.422 0.81) (end -1.422 -0.81) (layer F.SilkS) (width 0.1524))
|
||||||
|
(fp_line (start -1.422 -0.81) (end 1.422 -0.81) (layer F.Fab) (width 0.1524))
|
||||||
|
(fp_line (start -0.522 -0.81) (end 0.522 -0.81) (layer F.SilkS) (width 0.1524))
|
||||||
|
(fp_line (start -0.428 0.81) (end -0.522 0.81) (layer F.SilkS) (width 0.1524))
|
||||||
|
(fp_line (start 0.522 0.81) (end 0.428 0.81) (layer F.SilkS) (width 0.1524))
|
||||||
|
(fp_line (start -1.328 0.81) (end -1.422 0.81) (layer F.SilkS) (width 0.1524))
|
||||||
|
(fp_line (start 1.422 0.81) (end 1.328 0.81) (layer F.SilkS) (width 0.1524))
|
||||||
|
(fp_line (start 1.328 -0.81) (end 1.422 -0.81) (layer F.SilkS) (width 0.1524))
|
||||||
|
(fp_line (start -1.422 -0.81) (end -1.328 -0.81) (layer F.SilkS) (width 0.1524))
|
||||||
|
(fp_circle (center -1.0 0.3) (end -0.9 0.3) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_poly
|
||||||
|
(pts
|
||||||
|
(xy -1.2 0.85)
|
||||||
|
(xy -0.7 0.85)
|
||||||
|
(xy -0.7 1.5)
|
||||||
|
(xy -1.2 1.5)
|
||||||
|
) (layer F.Fab) (width 0.01)
|
||||||
|
)
|
||||||
|
(fp_poly
|
||||||
|
(pts
|
||||||
|
(xy -0.25 0.85)
|
||||||
|
(xy 0.25 0.85)
|
||||||
|
(xy 0.25 1.5)
|
||||||
|
(xy -0.25 1.5)
|
||||||
|
) (layer F.Fab) (width 0.01)
|
||||||
|
)
|
||||||
|
(fp_poly
|
||||||
|
(pts
|
||||||
|
(xy 0.7 0.85)
|
||||||
|
(xy 1.2 0.85)
|
||||||
|
(xy 1.2 1.5)
|
||||||
|
(xy 0.7 1.5)
|
||||||
|
) (layer F.Fab) (width 0.01)
|
||||||
|
)
|
||||||
|
(fp_poly
|
||||||
|
(pts
|
||||||
|
(xy 0.7 -1.5)
|
||||||
|
(xy 1.2 -1.5)
|
||||||
|
(xy 1.2 -0.85)
|
||||||
|
(xy 0.7 -0.85)
|
||||||
|
) (layer F.Fab) (width 0.01)
|
||||||
|
)
|
||||||
|
(fp_poly
|
||||||
|
(pts
|
||||||
|
(xy -1.2 -1.5)
|
||||||
|
(xy -0.7 -1.5)
|
||||||
|
(xy -0.7 -0.85)
|
||||||
|
(xy -1.2 -0.85)
|
||||||
|
) (layer F.Fab) (width 0.01)
|
||||||
|
)
|
||||||
|
(fp_poly
|
||||||
|
(pts
|
||||||
|
(xy -0.3 -1.5)
|
||||||
|
(xy 0.2 -1.5)
|
||||||
|
(xy 0.2 -0.85)
|
||||||
|
(xy -0.3 -0.85)
|
||||||
|
) (layer F.Fab) (width 0.01)
|
||||||
|
)
|
||||||
|
)
|
1
Hardware/FabReader2/Library/DW01A/how-to-import.htm
Normal file
1
Hardware/FabReader2/Library/DW01A/how-to-import.htm
Normal file
@ -0,0 +1 @@
|
|||||||
|
<!DOCTYPE HTML><html lang="en-US"> <head> <meta charset="UTF-8"> <meta http-equiv="refresh" content="0; url=https://www.snapeda.com/about/import/#"> <script type="text/javascript">window.location.href="https://www.snapeda.com/about/import/#" </script> <title>Page Redirection</title> </head> <body> If you are not redirected automatically, follow this <a href="https://www.snapeda.com/about/import/#">link to the import guide</a>. </body></html>
|
@ -0,0 +1,193 @@
|
|||||||
|
(kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor)
|
||||||
|
(symbol "ESP32-C3-WROOM-02-H4" (pin_names (offset 1.016)) (in_bom yes) (on_board yes)
|
||||||
|
(property "Reference" "U" (id 0) (at -12.7 21.082 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Value" "ESP32-C3-WROOM-02-H4" (id 1) (at -12.7 -18.542 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Footprint" "MODULE_ESP32-C3-WROOM-02-H4" (id 2) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "Datasheet" "" (id 3) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "STANDARD" "Manufacturer Recommendations" (id 4) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "MAXIMUM_PACKAGE_HEIGHT" "3.35 mm" (id 5) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "MANUFACTURER" "Espressif" (id 6) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "PARTREV" "V1.0" (id 7) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "ki_locked" "" (id 8) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)))
|
||||||
|
)
|
||||||
|
(symbol "ESP32-C3-WROOM-02-H4_0_0"
|
||||||
|
(rectangle (start -12.7 -17.78) (end 12.7 20.32)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type background))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 17.78 180) (length 5.08)
|
||||||
|
(name "3V3" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "1" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 17.78 2.54 180) (length 5.08)
|
||||||
|
(name "IO10" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "10" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at -17.78 -12.7 0) (length 5.08)
|
||||||
|
(name "RXD" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "11" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at -17.78 -10.16 0) (length 5.08)
|
||||||
|
(name "TXD" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "12" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 17.78 0 180) (length 5.08)
|
||||||
|
(name "IO18" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "13" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 17.78 -2.54 180) (length 5.08)
|
||||||
|
(name "IO19" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "14" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at -17.78 2.54 0) (length 5.08)
|
||||||
|
(name "IO3" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "15" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at -17.78 5.08 0) (length 5.08)
|
||||||
|
(name "IO2" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "16" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at -17.78 7.62 0) (length 5.08)
|
||||||
|
(name "IO1" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "17" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at -17.78 10.16 0) (length 5.08)
|
||||||
|
(name "IO0" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "18" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "19" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin input line (at -17.78 15.24 0) (length 5.08)
|
||||||
|
(name "EN" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "2" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "20" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "21" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "22" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "23" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "24" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "25" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "26" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "27" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "28" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "29" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at -17.78 0 0) (length 5.08)
|
||||||
|
(name "IO4" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "3" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "30" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "31" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "32" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "33" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "34" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "35" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "36" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "37" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "38" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "39" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at -17.78 -2.54 0) (length 5.08)
|
||||||
|
(name "IO5" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "4" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at -17.78 -5.08 0) (length 5.08)
|
||||||
|
(name "IO6" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "5" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 17.78 10.16 180) (length 5.08)
|
||||||
|
(name "IO7" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "6" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 17.78 7.62 180) (length 5.08)
|
||||||
|
(name "IO8" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "7" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 17.78 5.08 180) (length 5.08)
|
||||||
|
(name "IO9" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "8" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "9" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
@ -0,0 +1,61 @@
|
|||||||
|
EESchema-LIBRARY Version 2.3
|
||||||
|
#encoding utf-8
|
||||||
|
#(c) SnapEDA 2016 (snapeda.com)
|
||||||
|
#This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0
|
||||||
|
#
|
||||||
|
# ESP32-C3-WROOM-02-H4
|
||||||
|
#
|
||||||
|
DEF ESP32-C3-WROOM-02-H4 U 0 40 Y Y 1 L N
|
||||||
|
F0 "U" -500 830 50 H V L BNN
|
||||||
|
F1 "ESP32-C3-WROOM-02-H4" -500 -730 50 H V L BNN
|
||||||
|
F2 "MODULE_ESP32-C3-WROOM-02-H4" 0 0 50 H I L BNN
|
||||||
|
F3 "" 0 0 50 H I L BNN
|
||||||
|
F4 "Manufacturer Recommendations" 0 0 50 H I L BNN "STANDARD"
|
||||||
|
F5 "3.35 mm" 0 0 50 H I L BNN "MAXIMUM_PACKAGE_HEIGHT"
|
||||||
|
F6 "Espressif" 0 0 50 H I L BNN "MANUFACTURER"
|
||||||
|
F7 "V1.0" 0 0 50 H I L BNN "PARTREV"
|
||||||
|
DRAW
|
||||||
|
S -500 -700 500 800 0 0 10 f
|
||||||
|
X 3V3 1 700 700 200 L 40 40 0 0 W
|
||||||
|
X EN 2 -700 600 200 R 40 40 0 0 I
|
||||||
|
X GND 9 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 19 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 20 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 21 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 22 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 23 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 24 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 25 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 26 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 27 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 28 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 29 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 30 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 31 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 32 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 33 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 34 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 35 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 36 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 37 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 38 700 -600 200 L 40 40 0 0 W
|
||||||
|
X GND 39 700 -600 200 L 40 40 0 0 W
|
||||||
|
X IO0 18 -700 400 200 R 40 40 0 0 B
|
||||||
|
X IO1 17 -700 300 200 R 40 40 0 0 B
|
||||||
|
X IO2 16 -700 200 200 R 40 40 0 0 B
|
||||||
|
X IO3 15 -700 100 200 R 40 40 0 0 B
|
||||||
|
X IO4 3 -700 0 200 R 40 40 0 0 B
|
||||||
|
X IO5 4 -700 -100 200 R 40 40 0 0 B
|
||||||
|
X IO6 5 -700 -200 200 R 40 40 0 0 B
|
||||||
|
X IO7 6 700 400 200 L 40 40 0 0 B
|
||||||
|
X IO8 7 700 300 200 L 40 40 0 0 B
|
||||||
|
X IO9 8 700 200 200 L 40 40 0 0 B
|
||||||
|
X IO10 10 700 100 200 L 40 40 0 0 B
|
||||||
|
X IO18 13 700 0 200 L 40 40 0 0 B
|
||||||
|
X IO19 14 700 -100 200 L 40 40 0 0 B
|
||||||
|
X TXD 12 -700 -400 200 R 40 40 0 0 B
|
||||||
|
X RXD 11 -700 -500 200 R 40 40 0 0 B
|
||||||
|
ENDDRAW
|
||||||
|
ENDDEF
|
||||||
|
#
|
||||||
|
# End Library
|
File diff suppressed because it is too large
Load Diff
24
Hardware/FabReader2/Library/ESP32-C3-WROOM-02-H4/License.txt
Normal file
24
Hardware/FabReader2/Library/ESP32-C3-WROOM-02-H4/License.txt
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
BY ACCESSING OR USING THESE SYMBOLS & FOOTPRINTS ("MODELS"), YOU ARE ACKNOWLEDGING THAT YOU HAVE READ, FULLY UNDERSTAND AND AGREE TO THESE TERMS AND CONDITIONS (the "Agreement"), WHICH CONSTITUTE A BINDING AGREEMENT BETWEEN YOU AND SNAPEDA, INC., ENTERED INTO ON THE DATE OF SUCH OCCURRENCE (the "Effective Date"). IF YOU ARE ACCESSING OR USING THESE FILES ON BEHALF OF AN ENTITY, YOU REPRESENT THAT YOU HAVE THE RIGHT, AUTHORITY, AND CAPACITY TO BIND SUCH ENTITY TO THIS AGREEMENT AND HEREBY DO SO. IF YOU DO NOT AGREE WITH ANY OF THE TERMS OR CONDITIONS OF THIS AGREEMENT, YOU MUST NOT USE ANY PART OF THESE MODELS.
|
||||||
|
|
||||||
|
1. Design License
|
||||||
|
|
||||||
|
You and your sub-licensees are hereby licensed to design, manufacture, use and distribute, circuit board designs and circuit boards formed by combining Models provided by SnapEDA with other circuit elements of your choosing. You may then convey such combinations under licensing terms of your choice.
|
||||||
|
|
||||||
|
Individual Models remain the intellectual property of SnapEDA, Inc. You shall not (and shall not permit or encourage any third party to) to do any of the following :
|
||||||
|
|
||||||
|
(a) sell, assign, lease, lend, rent, issue, sublicense, make available, or otherwise distribute to any third party, or publicly perform, display or communicate, the Models (for example, by uploading Models to another website or software application);
|
||||||
|
(b) remove, alter, or conceal, any copyright, trademark, or other proprietary rights notice or legend displayed or contained in the individual Models.
|
||||||
|
|
||||||
|
For further clarity, once integrated into a schematic design or PCB layout, Models may be modified freely for the purpose of designing a circuit board.
|
||||||
|
|
||||||
|
|
||||||
|
2. Limitation of Liability
|
||||||
|
|
||||||
|
IN NO EVENT WILL SNAPEDA OR OUR SUBSIDIARIES, AGENTS, SUCCESSORS, THIRD PARTY PROVIDERS, AND/OR ANY OF THE FOREGOING ENTITIES' RESPECTIVE DIRECTORS, OFFICERS, EMPLOYEES, AGENTS, REPRESENTATIVES, CUSTOMERS, SUPPLIERS, OR LICENSORS BE RESPONSIBLE OR LIABLE UNDER, OR OTHERWISE IN CONNECTION WITH THIS AGREEMENT, FOR:
|
||||||
|
|
||||||
|
(a) ANY CONSEQUENTIAL, INDIRECT, SPECIAL, INCIDENTAL, OR PUNITIVE DAMAGES;
|
||||||
|
(b) ANY LOSS OF PROFITS, LOSS OF BUSINESS, LOSS OF REVENUE, OR LOSS OF ANTICIPATED SAVINGS;
|
||||||
|
(c) ANY LOSS OF, OR DAMAGE TO, DATA, REPUTATION, OR GOODWILL; AND/OR
|
||||||
|
(d) THE COST OF PROCURING ANY SUBSTITUTE GOODS OR SERVICES.
|
||||||
|
|
||||||
|
THE COMBINED AGGREGATE LIABILITY OF SNAPEDA AND ALL SNAPEDA CONTENT AFFILIATES UNDER, OR OTHERWISE IN CONNECTION WITH, THIS AGREEMENT SHALL NOT EXCEED THE TOTAL AMOUNT OF FEES RECEIVED BY SNAPEDA FROM YOU IN THE PREVIOUS TWELVE (12) MONTHS. THE FOREGOING EXCLUSIONS AND LIMITATIONS SHALL APPLY: (a) EVEN IF SNAPEDA OR ANY SNAPEDA CONTENT AFFILIATE HAS BEEN ADVISED, OR SHOULD HAVE BEEN AWARE, OF THE POSSIBILITY OF LOSSES, DAMAGES, OR COSTS; (b) EVEN IF ANY REMEDY IN THIS AGREEMENT FAILS OF ITS ESSENTIAL PURPOSE; AND (c) REGARDLESS OF THE THEORY OR BASIS OF LIABILITY (INCLUDING WITHOUT LIMITATION BREACH OF CONTRACT, TORT, NEGLIGENCE, AND STRICT LIABILITY).
|
@ -0,0 +1,110 @@
|
|||||||
|
|
||||||
|
(module MODULE_ESP32-C3-WROOM-02-H4 (layer F.Cu) (tedit 6269D75A)
|
||||||
|
(descr "")
|
||||||
|
(fp_text reference REF** (at -6.575 -11.085 0) (layer F.SilkS)
|
||||||
|
(effects (font (size 1.0 1.0) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(fp_text value MODULE_ESP32-C3-WROOM-02-H4 (at 7.395 11.085 0) (layer F.Fab)
|
||||||
|
(effects (font (size 1.0 1.0) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(pad 1 smd rect (at -8.75 -2.9) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 2 smd rect (at -8.75 -1.4) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 3 smd rect (at -8.75 0.1) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 4 smd rect (at -8.75 1.6) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 5 smd rect (at -8.75 3.1) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 6 smd rect (at -8.75 4.6) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 7 smd rect (at -8.75 6.1) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 8 smd rect (at -8.75 7.6) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 9 smd rect (at -8.75 9.1) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 10 smd rect (at 8.75 9.1) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 11 smd rect (at 8.75 7.6) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 12 smd rect (at 8.75 6.1) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 13 smd rect (at 8.75 4.6) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 14 smd rect (at 8.75 3.1) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 15 smd rect (at 8.75 1.6) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 16 smd rect (at 8.75 0.1) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 17 smd rect (at 8.75 -1.4) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 18 smd rect (at 8.75 -2.9) (size 1.5 0.9) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 23 smd rect (at 0.96 3.3) (size 0.7 0.7) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 24 smd rect (at 2.06 3.3) (size 0.7 0.7) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 22 smd rect (at -0.14 3.3) (size 0.7 0.7) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 19 smd rect (at -0.14 2.2) (size 0.7 0.7) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 20 smd rect (at 0.96 2.2) (size 0.7 0.7) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 21 smd rect (at 2.06 2.2) (size 0.7 0.7) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 27 smd rect (at 2.06 4.4) (size 0.7 0.7) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 26 smd rect (at 0.96 4.4) (size 0.7 0.7) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 25 smd rect (at -0.14 4.4) (size 0.7 0.7) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 29 thru_hole circle (at 1.51 2.2) (size 0.4 0.4) (drill 0.3) (layers *.Cu))
|
||||||
|
(pad 32 thru_hole circle (at 2.06 2.75) (size 0.4 0.4) (drill 0.3) (layers *.Cu))
|
||||||
|
(pad 37 thru_hole circle (at 2.06 3.85) (size 0.4 0.4) (drill 0.3) (layers *.Cu))
|
||||||
|
(pad 28 thru_hole circle (at 0.41 2.2) (size 0.4 0.4) (drill 0.3) (layers *.Cu))
|
||||||
|
(pad 34 thru_hole circle (at 1.51 3.3) (size 0.4 0.4) (drill 0.3) (layers *.Cu))
|
||||||
|
(pad 31 thru_hole circle (at 0.96 2.75) (size 0.4 0.4) (drill 0.3) (layers *.Cu))
|
||||||
|
(pad 30 thru_hole circle (at -0.14 2.75) (size 0.4 0.4) (drill 0.3) (layers *.Cu))
|
||||||
|
(pad 33 thru_hole circle (at 0.41 3.3) (size 0.4 0.4) (drill 0.3) (layers *.Cu))
|
||||||
|
(pad 39 thru_hole circle (at 1.51 4.4) (size 0.4 0.4) (drill 0.3) (layers *.Cu))
|
||||||
|
(pad 38 thru_hole circle (at 0.41 4.4) (size 0.4 0.4) (drill 0.3) (layers *.Cu))
|
||||||
|
(pad 36 thru_hole circle (at 0.96 3.85) (size 0.4 0.4) (drill 0.3) (layers *.Cu))
|
||||||
|
(pad 35 thru_hole circle (at -0.14 3.85) (size 0.4 0.4) (drill 0.3) (layers *.Cu))
|
||||||
|
(fp_line (start -9.0 -10.0) (end -9.0 -4.0) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start -9.0 -4.0) (end -9.0 10.0) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start -9.0 10.0) (end 9.0 10.0) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start 9.0 10.0) (end 9.0 -4.0) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start 9.0 -4.0) (end 9.0 -10.0) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start 9.0 -10.0) (end -9.0 -10.0) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start 9.0 -4.0) (end -9.0 -4.0) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start -9.0 10.0) (end -9.0 9.87) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 9.0 10.0) (end 9.0 9.87) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -9.0 -10.0) (end -9.0 -3.67) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -9.0 10.0) (end 9.0 10.0) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 9.0 -3.67) (end 9.0 -10.0) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 9.0 -10.0) (end -9.0 -10.0) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -9.75 -10.25) (end -9.75 10.25) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -9.75 10.25) (end 9.75 10.25) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start 9.75 10.25) (end 9.75 -10.25) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start 9.75 -10.25) (end -9.75 -10.25) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_circle (center -10.5 -2.9) (end -10.4 -2.9) (layer F.SilkS) (width 0.2))
|
||||||
|
(fp_circle (center -10.5 -2.9) (end -10.4 -2.9) (layer F.Fab) (width 0.2))
|
||||||
|
(zone (net 0) (net_name "") (layer F.Cu) (hatch full 0.508)
|
||||||
|
(connect_pads (clearance 0))
|
||||||
|
(min_thickness 0.01)
|
||||||
|
(keepout (tracks not_allowed) (vias not_allowed) (pads not_allowed ) (copperpour not_allowed) (footprints allowed))
|
||||||
|
(fill (thermal_gap 0.508) (thermal_bridge_width 0.508))
|
||||||
|
(polygon
|
||||||
|
(pts
|
||||||
|
(xy -9.0 -10.0)
|
||||||
|
(xy 9.0 -10.0)
|
||||||
|
(xy 9.0 -4.0)
|
||||||
|
(xy -9.0 -4.0)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(zone (net 0) (net_name "") (layers *.Cu) (hatch full 0.508)
|
||||||
|
(connect_pads (clearance 0))
|
||||||
|
(min_thickness 0.01)
|
||||||
|
(keepout (tracks allowed) (vias not_allowed) (pads allowed ) (copperpour allowed) (footprints allowed))
|
||||||
|
(fill (thermal_gap 0.508) (thermal_bridge_width 0.508))
|
||||||
|
(polygon
|
||||||
|
(pts
|
||||||
|
(xy -9.0 -10.0)
|
||||||
|
(xy 9.0 -10.0)
|
||||||
|
(xy 9.0 -4.0)
|
||||||
|
(xy -9.0 -4.0)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(zone (net 0) (net_name "") (layer B.Cu) (hatch full 0.508)
|
||||||
|
(connect_pads (clearance 0))
|
||||||
|
(min_thickness 0.01)
|
||||||
|
(keepout (tracks not_allowed) (vias not_allowed) (pads not_allowed ) (copperpour not_allowed) (footprints allowed))
|
||||||
|
(fill (thermal_gap 0.508) (thermal_bridge_width 0.508))
|
||||||
|
(polygon
|
||||||
|
(pts
|
||||||
|
(xy -9.0 -10.0)
|
||||||
|
(xy 9.0 -10.0)
|
||||||
|
(xy 9.0 -4.0)
|
||||||
|
(xy -9.0 -4.0)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
@ -0,0 +1 @@
|
|||||||
|
<!DOCTYPE HTML><html lang="en-US"> <head> <meta charset="UTF-8"> <meta http-equiv="refresh" content="0; url=https://www.snapeda.com/about/import/#"> <script type="text/javascript">window.location.href="https://www.snapeda.com/about/import/#" </script> <title>Page Redirection</title> </head> <body> If you are not redirected automatically, follow this <a href="https://www.snapeda.com/about/import/#">link to the import guide</a>. </body></html>
|
@ -0,0 +1,33 @@
|
|||||||
|
|
||||||
|
(module JST_S2B-PH-SM4-TB_LF__SN_ (layer F.Cu) (tedit 6269D647)
|
||||||
|
(descr "")
|
||||||
|
(fp_text reference REF** (at -0.69228 -3.184 0) (layer F.SilkS)
|
||||||
|
(effects (font (size 1.00218897638 1.00218897638) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(fp_text value JST_S2B-PH-SM4-TB_LF__SN_ (at 12.17833 9.48143 0) (layer F.Fab)
|
||||||
|
(effects (font (size 1.00357480315 1.00357480315) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(pad 2 smd rect (at 1.0 0.0 180.0) (size 1.0 3.5) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 1 smd rect (at -1.0 0.0 180.0) (size 1.0 3.5) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad S2 smd rect (at 3.35 5.75 180.0) (size 1.5 3.4) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad S1 smd rect (at -3.35 5.75 180.0) (size 1.5 3.4) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(fp_line (start 3.95 -0.35) (end 1.9 -0.35) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -1.9 -0.35) (end -3.95 -0.35) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -3.95 -0.35) (end -3.95 3.65) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_circle (center -2.15 -1.35) (end -2.05 -1.35) (layer F.SilkS) (width 0.3))
|
||||||
|
(fp_line (start -2.2 7.25) (end 2.2 7.25) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 3.95 3.65) (end 3.95 -0.35) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 4.35 7.7) (end -4.35 7.7) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -4.35 7.7) (end -4.35 -0.6) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -4.35 -0.6) (end -1.75 -0.6) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -1.75 -0.6) (end -1.75 -2.0) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -1.75 -2.0) (end 1.75 -2.0) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start 1.75 -2.0) (end 1.75 -0.6) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start 1.75 -0.6) (end 4.35 -0.6) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start 4.35 -0.6) (end 4.35 7.7) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start 3.95 -0.35) (end 3.95 7.25) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start 3.95 7.25) (end -3.95 7.25) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start -3.95 7.25) (end -3.95 -0.35) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start -3.95 -0.35) (end 3.95 -0.35) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_circle (center -2.15 -1.35) (end -2.05 -1.35) (layer F.Fab) (width 0.3))
|
||||||
|
)
|
@ -0,0 +1,24 @@
|
|||||||
|
BY ACCESSING OR USING THESE SYMBOLS & FOOTPRINTS ("MODELS"), YOU ARE ACKNOWLEDGING THAT YOU HAVE READ, FULLY UNDERSTAND AND AGREE TO THESE TERMS AND CONDITIONS (the "Agreement"), WHICH CONSTITUTE A BINDING AGREEMENT BETWEEN YOU AND SNAPEDA, INC., ENTERED INTO ON THE DATE OF SUCH OCCURRENCE (the "Effective Date"). IF YOU ARE ACCESSING OR USING THESE FILES ON BEHALF OF AN ENTITY, YOU REPRESENT THAT YOU HAVE THE RIGHT, AUTHORITY, AND CAPACITY TO BIND SUCH ENTITY TO THIS AGREEMENT AND HEREBY DO SO. IF YOU DO NOT AGREE WITH ANY OF THE TERMS OR CONDITIONS OF THIS AGREEMENT, YOU MUST NOT USE ANY PART OF THESE MODELS.
|
||||||
|
|
||||||
|
1. Design License
|
||||||
|
|
||||||
|
You and your sub-licensees are hereby licensed to design, manufacture, use and distribute, circuit board designs and circuit boards formed by combining Models provided by SnapEDA with other circuit elements of your choosing. You may then convey such combinations under licensing terms of your choice.
|
||||||
|
|
||||||
|
Individual Models remain the intellectual property of SnapEDA, Inc. You shall not (and shall not permit or encourage any third party to) to do any of the following :
|
||||||
|
|
||||||
|
(a) sell, assign, lease, lend, rent, issue, sublicense, make available, or otherwise distribute to any third party, or publicly perform, display or communicate, the Models (for example, by uploading Models to another website or software application);
|
||||||
|
(b) remove, alter, or conceal, any copyright, trademark, or other proprietary rights notice or legend displayed or contained in the individual Models.
|
||||||
|
|
||||||
|
For further clarity, once integrated into a schematic design or PCB layout, Models may be modified freely for the purpose of designing a circuit board.
|
||||||
|
|
||||||
|
|
||||||
|
2. Limitation of Liability
|
||||||
|
|
||||||
|
IN NO EVENT WILL SNAPEDA OR OUR SUBSIDIARIES, AGENTS, SUCCESSORS, THIRD PARTY PROVIDERS, AND/OR ANY OF THE FOREGOING ENTITIES' RESPECTIVE DIRECTORS, OFFICERS, EMPLOYEES, AGENTS, REPRESENTATIVES, CUSTOMERS, SUPPLIERS, OR LICENSORS BE RESPONSIBLE OR LIABLE UNDER, OR OTHERWISE IN CONNECTION WITH THIS AGREEMENT, FOR:
|
||||||
|
|
||||||
|
(a) ANY CONSEQUENTIAL, INDIRECT, SPECIAL, INCIDENTAL, OR PUNITIVE DAMAGES;
|
||||||
|
(b) ANY LOSS OF PROFITS, LOSS OF BUSINESS, LOSS OF REVENUE, OR LOSS OF ANTICIPATED SAVINGS;
|
||||||
|
(c) ANY LOSS OF, OR DAMAGE TO, DATA, REPUTATION, OR GOODWILL; AND/OR
|
||||||
|
(d) THE COST OF PROCURING ANY SUBSTITUTE GOODS OR SERVICES.
|
||||||
|
|
||||||
|
THE COMBINED AGGREGATE LIABILITY OF SNAPEDA AND ALL SNAPEDA CONTENT AFFILIATES UNDER, OR OTHERWISE IN CONNECTION WITH, THIS AGREEMENT SHALL NOT EXCEED THE TOTAL AMOUNT OF FEES RECEIVED BY SNAPEDA FROM YOU IN THE PREVIOUS TWELVE (12) MONTHS. THE FOREGOING EXCLUSIONS AND LIMITATIONS SHALL APPLY: (a) EVEN IF SNAPEDA OR ANY SNAPEDA CONTENT AFFILIATE HAS BEEN ADVISED, OR SHOULD HAVE BEEN AWARE, OF THE POSSIBILITY OF LOSSES, DAMAGES, OR COSTS; (b) EVEN IF ANY REMEDY IN THIS AGREEMENT FAILS OF ITS ESSENTIAL PURPOSE; AND (c) REGARDLESS OF THE THEORY OR BASIS OF LIABILITY (INCLUDING WITHOUT LIMITATION BREACH OF CONTRACT, TORT, NEGLIGENCE, AND STRICT LIABILITY).
|
@ -0,0 +1,47 @@
|
|||||||
|
(kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor)
|
||||||
|
(symbol "S2B-PH-SM4-TB(LF)(SN)" (pin_names (offset 1.016)) (in_bom yes) (on_board yes)
|
||||||
|
(property "Reference" "J" (id 0) (at -5.08 5.588 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Value" "S2B-PH-SM4-TB(LF)(SN)" (id 1) (at -5.08 -9.4234 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Footprint" "JST_S2B-PH-SM4-TB(LF)(SN)" (id 2) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "Datasheet" "" (id 3) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "STANDARD" "Manufacturer Recommendation" (id 4) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "MANUFACTURER" "JST" (id 5) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "ki_locked" "" (id 6) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)))
|
||||||
|
)
|
||||||
|
(symbol "S2B-PH-SM4-TB(LF)(SN)_0_0"
|
||||||
|
(rectangle (start -5.08 -7.62) (end 5.08 5.08)
|
||||||
|
(stroke (width 0.1524) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type background))
|
||||||
|
)
|
||||||
|
(pin passive line (at -7.62 2.54 0) (length 2.54)
|
||||||
|
(name "1" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "1" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -7.62 0 0) (length 2.54)
|
||||||
|
(name "2" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "2" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -7.62 -5.08 0) (length 2.54)
|
||||||
|
(name "SHIELD" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "S1" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -7.62 -5.08 0) (length 2.54)
|
||||||
|
(name "SHIELD" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "S2" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
@ -0,0 +1,24 @@
|
|||||||
|
EESchema-LIBRARY Version 2.3
|
||||||
|
#encoding utf-8
|
||||||
|
#(c) SnapEDA 2016 (snapeda.com)
|
||||||
|
#This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0
|
||||||
|
#
|
||||||
|
# S2B-PH-SM4-TB(LF)(SN)
|
||||||
|
#
|
||||||
|
DEF S2B-PH-SM4-TB(LF)(SN) J 0 40 Y Y 1 L N
|
||||||
|
F0 "J" -200 220 50 H V L BNN
|
||||||
|
F1 "S2B-PH-SM4-TB(LF)(SN)" -200 -371 50 H V L BNN
|
||||||
|
F2 "JST_S2B-PH-SM4-TB(LF)(SN)" 0 0 50 H I L BNN
|
||||||
|
F3 "" 0 0 50 H I L BNN
|
||||||
|
F4 "Manufacturer Recommendation" 0 0 50 H I L BNN "STANDARD"
|
||||||
|
F5 "JST" 0 0 50 H I L BNN "MANUFACTURER"
|
||||||
|
DRAW
|
||||||
|
S -200 -300 200 200 0 0 6 f
|
||||||
|
X 1 1 -300 100 100 R 40 40 0 0 P
|
||||||
|
X 2 2 -300 0 100 R 40 40 0 0 P
|
||||||
|
X SHIELD S1 -300 -200 100 R 40 40 0 0 P
|
||||||
|
X SHIELD S2 -300 -200 100 R 40 40 0 0 P
|
||||||
|
ENDDRAW
|
||||||
|
ENDDEF
|
||||||
|
#
|
||||||
|
# End Library
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@
|
|||||||
|
<!DOCTYPE HTML><html lang="en-US"> <head> <meta charset="UTF-8"> <meta http-equiv="refresh" content="0; url=https://www.snapeda.com/about/import/#"> <script type="text/javascript">window.location.href="https://www.snapeda.com/about/import/#" </script> <title>Page Redirection</title> </head> <body> If you are not redirected automatically, follow this <a href="https://www.snapeda.com/about/import/#">link to the import guide</a>. </body></html>
|
24
Hardware/FabReader2/Library/ST25R3911B-AQFT/License.txt
Normal file
24
Hardware/FabReader2/Library/ST25R3911B-AQFT/License.txt
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
BY ACCESSING OR USING THESE SYMBOLS & FOOTPRINTS ("MODELS"), YOU ARE ACKNOWLEDGING THAT YOU HAVE READ, FULLY UNDERSTAND AND AGREE TO THESE TERMS AND CONDITIONS (the "Agreement"), WHICH CONSTITUTE A BINDING AGREEMENT BETWEEN YOU AND SNAPEDA, INC., ENTERED INTO ON THE DATE OF SUCH OCCURRENCE (the "Effective Date"). IF YOU ARE ACCESSING OR USING THESE FILES ON BEHALF OF AN ENTITY, YOU REPRESENT THAT YOU HAVE THE RIGHT, AUTHORITY, AND CAPACITY TO BIND SUCH ENTITY TO THIS AGREEMENT AND HEREBY DO SO. IF YOU DO NOT AGREE WITH ANY OF THE TERMS OR CONDITIONS OF THIS AGREEMENT, YOU MUST NOT USE ANY PART OF THESE MODELS.
|
||||||
|
|
||||||
|
1. Design License
|
||||||
|
|
||||||
|
You and your sub-licensees are hereby licensed to design, manufacture, use and distribute, circuit board designs and circuit boards formed by combining Models provided by SnapEDA with other circuit elements of your choosing. You may then convey such combinations under licensing terms of your choice.
|
||||||
|
|
||||||
|
Individual Models remain the intellectual property of SnapEDA, Inc. You shall not (and shall not permit or encourage any third party to) to do any of the following :
|
||||||
|
|
||||||
|
(a) sell, assign, lease, lend, rent, issue, sublicense, make available, or otherwise distribute to any third party, or publicly perform, display or communicate, the Models (for example, by uploading Models to another website or software application);
|
||||||
|
(b) remove, alter, or conceal, any copyright, trademark, or other proprietary rights notice or legend displayed or contained in the individual Models.
|
||||||
|
|
||||||
|
For further clarity, once integrated into a schematic design or PCB layout, Models may be modified freely for the purpose of designing a circuit board.
|
||||||
|
|
||||||
|
|
||||||
|
2. Limitation of Liability
|
||||||
|
|
||||||
|
IN NO EVENT WILL SNAPEDA OR OUR SUBSIDIARIES, AGENTS, SUCCESSORS, THIRD PARTY PROVIDERS, AND/OR ANY OF THE FOREGOING ENTITIES' RESPECTIVE DIRECTORS, OFFICERS, EMPLOYEES, AGENTS, REPRESENTATIVES, CUSTOMERS, SUPPLIERS, OR LICENSORS BE RESPONSIBLE OR LIABLE UNDER, OR OTHERWISE IN CONNECTION WITH THIS AGREEMENT, FOR:
|
||||||
|
|
||||||
|
(a) ANY CONSEQUENTIAL, INDIRECT, SPECIAL, INCIDENTAL, OR PUNITIVE DAMAGES;
|
||||||
|
(b) ANY LOSS OF PROFITS, LOSS OF BUSINESS, LOSS OF REVENUE, OR LOSS OF ANTICIPATED SAVINGS;
|
||||||
|
(c) ANY LOSS OF, OR DAMAGE TO, DATA, REPUTATION, OR GOODWILL; AND/OR
|
||||||
|
(d) THE COST OF PROCURING ANY SUBSTITUTE GOODS OR SERVICES.
|
||||||
|
|
||||||
|
THE COMBINED AGGREGATE LIABILITY OF SNAPEDA AND ALL SNAPEDA CONTENT AFFILIATES UNDER, OR OTHERWISE IN CONNECTION WITH, THIS AGREEMENT SHALL NOT EXCEED THE TOTAL AMOUNT OF FEES RECEIVED BY SNAPEDA FROM YOU IN THE PREVIOUS TWELVE (12) MONTHS. THE FOREGOING EXCLUSIONS AND LIMITATIONS SHALL APPLY: (a) EVEN IF SNAPEDA OR ANY SNAPEDA CONTENT AFFILIATE HAS BEEN ADVISED, OR SHOULD HAVE BEEN AWARE, OF THE POSSIBILITY OF LOSSES, DAMAGES, OR COSTS; (b) EVEN IF ANY REMEDY IN THIS AGREEMENT FAILS OF ITS ESSENTIAL PURPOSE; AND (c) REGARDLESS OF THE THEORY OR BASIS OF LIABILITY (INCLUDING WITHOUT LIMITATION BREACH OF CONTRACT, TORT, NEGLIGENCE, AND STRICT LIABILITY).
|
@ -0,0 +1,69 @@
|
|||||||
|
|
||||||
|
(module QFN50P500X500X100-33N (layer F.Cu) (tedit 6269D679)
|
||||||
|
(descr "")
|
||||||
|
(fp_text reference REF** (at -0.165 -4.74 0) (layer F.SilkS)
|
||||||
|
(effects (font (size 1.0 1.0) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(fp_text value QFN50P500X500X100-33N (at 9.995 4.74 0) (layer F.Fab)
|
||||||
|
(effects (font (size 1.0 1.0) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(pad 9 smd roundrect (roundrect_rratio 0.03) (at -1.75 2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 10 smd roundrect (roundrect_rratio 0.03) (at -1.25 2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 11 smd roundrect (roundrect_rratio 0.03) (at -0.75 2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 12 smd roundrect (roundrect_rratio 0.03) (at -0.25 2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 13 smd roundrect (roundrect_rratio 0.03) (at 0.25 2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 14 smd roundrect (roundrect_rratio 0.03) (at 0.75 2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 15 smd roundrect (roundrect_rratio 0.03) (at 1.25 2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 16 smd roundrect (roundrect_rratio 0.03) (at 1.75 2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 25 smd roundrect (roundrect_rratio 0.03) (at 1.75 -2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 26 smd roundrect (roundrect_rratio 0.03) (at 1.25 -2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 27 smd roundrect (roundrect_rratio 0.03) (at 0.75 -2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 28 smd roundrect (roundrect_rratio 0.03) (at 0.25 -2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 29 smd roundrect (roundrect_rratio 0.03) (at -0.25 -2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 30 smd roundrect (roundrect_rratio 0.03) (at -0.75 -2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 31 smd roundrect (roundrect_rratio 0.03) (at -1.25 -2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 32 smd roundrect (roundrect_rratio 0.03) (at -1.75 -2.45 90.0) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 1 smd roundrect (roundrect_rratio 0.03) (at -2.45 -1.75) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 2 smd roundrect (roundrect_rratio 0.03) (at -2.45 -1.25) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 3 smd roundrect (roundrect_rratio 0.03) (at -2.45 -0.75) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 4 smd roundrect (roundrect_rratio 0.03) (at -2.45 -0.25) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 5 smd roundrect (roundrect_rratio 0.03) (at -2.45 0.25) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 6 smd roundrect (roundrect_rratio 0.03) (at -2.45 0.75) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 7 smd roundrect (roundrect_rratio 0.03) (at -2.45 1.25) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 8 smd roundrect (roundrect_rratio 0.03) (at -2.45 1.75) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 17 smd roundrect (roundrect_rratio 0.03) (at 2.45 1.75) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 18 smd roundrect (roundrect_rratio 0.03) (at 2.45 1.25) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 19 smd roundrect (roundrect_rratio 0.03) (at 2.45 0.75) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 20 smd roundrect (roundrect_rratio 0.03) (at 2.45 0.25) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 21 smd roundrect (roundrect_rratio 0.03) (at 2.45 -0.25) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 22 smd roundrect (roundrect_rratio 0.03) (at 2.45 -0.75) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 23 smd roundrect (roundrect_rratio 0.03) (at 2.45 -1.25) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 24 smd roundrect (roundrect_rratio 0.03) (at 2.45 -1.75) (size 0.81 0.26) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 33 smd rect (at 0.0 0.0) (size 3.5 3.5) (layers F.Cu F.Mask))
|
||||||
|
(fp_poly
|
||||||
|
(pts
|
||||||
|
(xy -1.11 -1.11)
|
||||||
|
(xy 1.11 -1.11)
|
||||||
|
(xy 1.11 1.11)
|
||||||
|
(xy -1.11 1.11)
|
||||||
|
) (layer F.Paste) (width 0.01)
|
||||||
|
)
|
||||||
|
(fp_circle (center -3.475 -1.75) (end -3.375 -1.75) (layer F.SilkS) (width 0.2))
|
||||||
|
(fp_circle (center -3.475 -1.75) (end -3.375 -1.75) (layer F.Fab) (width 0.2))
|
||||||
|
(fp_line (start 2.5 2.5) (end -2.5 2.5) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start 2.5 -2.5) (end -2.5 -2.5) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start 2.5 2.5) (end 2.5 -2.5) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start -2.5 2.5) (end -2.5 -2.5) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start 2.5 2.5) (end 2.2 2.5) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 2.5 -2.5) (end 2.2 -2.5) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -2.5 2.5) (end -2.2 2.5) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -2.5 -2.5) (end -2.2 -2.5) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 2.5 2.5) (end 2.5 2.2) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 2.5 -2.5) (end 2.5 -2.2) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -2.5 2.5) (end -2.5 2.2) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -2.5 -2.5) (end -2.5 -2.2) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -3.105 3.105) (end 3.105 3.105) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -3.105 -3.105) (end 3.105 -3.105) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -3.105 3.105) (end -3.105 -3.105) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start 3.105 3.105) (end 3.105 -3.105) (layer F.CrtYd) (width 0.05))
|
||||||
|
)
|
@ -0,0 +1,268 @@
|
|||||||
|
(kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor)
|
||||||
|
(symbol "ST25R3911B-AQFT" (pin_names (offset 1.016)) (in_bom yes) (on_board yes)
|
||||||
|
(property "Reference" "U" (id 0) (at -15.24 31.242 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Value" "ST25R3911B-AQFT" (id 1) (at -15.24 -35.56 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Footprint" "QFN50P500X500X100-33N" (id 2) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "Datasheet" "" (id 3) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "E_MAX" "5.0" (id 4) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "BODY_DIAMETER" "" (id 5) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "B_MIN" "0.18" (id 6) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "THERMAL_PAD" "" (id 7) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "E_MIN" "5.0" (id 8) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "BALL_COLUMNS" "" (id 9) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "BALL_ROWS" "" (id 10) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "L_MIN" "0.3" (id 11) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "PARTREV" "6" (id 12) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "B_MAX" "0.3" (id 13) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "MANUFACTURER" "ST Microelectronics" (id 14) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "DMAX" "" (id 15) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "EMAX" "" (id 16) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "D_MAX" "5.0" (id 17) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "PIN_COUNT_D" "8.0" (id 18) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "L_NOM" "0.4" (id 19) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "SNAPEDA_PACKAGE_ID" "" (id 20) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "E2_NOM" "3.5" (id 21) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "IPC" "" (id 22) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "JEDEC" "" (id 23) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "STANDARD" "IPC 7351B" (id 24) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "PINS" "" (id 25) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "D2_NOM" "3.5" (id 26) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "PIN_COLUMNS" "" (id 27) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "L_MAX" "0.5" (id 28) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "D_NOM" "5.0" (id 29) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "DMIN" "" (id 30) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "ENOM" "0.5" (id 31) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "PIN_COUNT_E" "8.0" (id 32) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "D_MIN" "5.0" (id 33) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "EMIN" "" (id 34) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "DNOM" "" (id 35) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "E_NOM" "5.0" (id 36) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "PACKAGE_TYPE" "" (id 37) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "A_MAX" "1.0" (id 38) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "VACANCIES" "" (id 39) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "B_NOM" "0.24" (id 40) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "ki_locked" "" (id 41) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)))
|
||||||
|
)
|
||||||
|
(symbol "ST25R3911B-AQFT_0_0"
|
||||||
|
(rectangle (start -15.24 -33.02) (end 15.24 30.48)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type background))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 20.32 27.94 180) (length 5.08)
|
||||||
|
(name "VDD_IO" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "1" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin output line (at 20.32 20.32 180) (length 5.08)
|
||||||
|
(name "RFO1" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "10" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin output line (at 20.32 17.78 180) (length 5.08)
|
||||||
|
(name "RFO2" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "11" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 20.32 -27.94 180) (length 5.08)
|
||||||
|
(name "VSN_RF" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "12" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 20.32 -2.54 180) (length 5.08)
|
||||||
|
(name "TRIM1_3" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "13" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 20.32 -5.08 180) (length 5.08)
|
||||||
|
(name "TRIM2_3" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "14" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 20.32 2.54 180) (length 5.08)
|
||||||
|
(name "TRIM1_2" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "15" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 20.32 0 180) (length 5.08)
|
||||||
|
(name "TRIM2_2" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "16" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 20.32 7.62 180) (length 5.08)
|
||||||
|
(name "TRIM1_1" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "17" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 20.32 5.08 180) (length 5.08)
|
||||||
|
(name "TRIM2_1" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "18" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 20.32 12.7 180) (length 5.08)
|
||||||
|
(name "TRIM1_0" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "19" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin output line (at -20.32 2.54 0) (length 5.08)
|
||||||
|
(name "CSO" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "2" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at 20.32 10.16 180) (length 5.08)
|
||||||
|
(name "TRIM2_0" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "20" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 20.32 -30.48 180) (length 5.08)
|
||||||
|
(name "VSS" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "21" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin input line (at -20.32 20.32 0) (length 5.08)
|
||||||
|
(name "RFI1" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "22" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin input line (at -20.32 17.78 0) (length 5.08)
|
||||||
|
(name "RFI2" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "23" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin bidirectional line (at -20.32 -20.32 0) (length 5.08)
|
||||||
|
(name "AGD" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "24" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin input line (at -20.32 5.08 0) (length 5.08)
|
||||||
|
(name "CSI" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "25" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 20.32 -22.86 180) (length 5.08)
|
||||||
|
(name "VSN_A" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "26" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin output line (at -20.32 -12.7 0) (length 5.08)
|
||||||
|
(name "IRQ" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "27" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin output clock (at -20.32 -15.24 0) (length 5.08)
|
||||||
|
(name "MCU_CLK" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "28" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin output line (at -20.32 -5.08 0) (length 5.08)
|
||||||
|
(name "MISO" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "29" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin output line (at 20.32 -12.7 180) (length 5.08)
|
||||||
|
(name "VSP_D" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "3" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin input line (at -20.32 -7.62 0) (length 5.08)
|
||||||
|
(name "MOSI" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "30" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin input clock (at -20.32 -10.16 0) (length 5.08)
|
||||||
|
(name "SCLK" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "31" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin input line (at -20.32 -2.54 0) (length 5.08)
|
||||||
|
(name "~{SS}" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "32" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 20.32 -30.48 180) (length 5.08)
|
||||||
|
(name "VSS" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "33" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin output line (at -20.32 10.16 0) (length 5.08)
|
||||||
|
(name "XTO" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "4" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin input line (at -20.32 12.7 0) (length 5.08)
|
||||||
|
(name "XTI" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "5" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 20.32 -25.4 180) (length 5.08)
|
||||||
|
(name "VSN_D" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "6" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin output line (at 20.32 -10.16 180) (length 5.08)
|
||||||
|
(name "VSP_A" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "7" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 20.32 25.4 180) (length 5.08)
|
||||||
|
(name "VDD" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "8" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin output line (at 20.32 -15.24 180) (length 5.08)
|
||||||
|
(name "VSP_RF" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "9" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
@ -0,0 +1,88 @@
|
|||||||
|
EESchema-LIBRARY Version 2.3
|
||||||
|
#encoding utf-8
|
||||||
|
#(c) SnapEDA 2016 (snapeda.com)
|
||||||
|
#This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0
|
||||||
|
#
|
||||||
|
# ST25R3911B-AQFT
|
||||||
|
#
|
||||||
|
DEF ST25R3911B-AQFT U 0 40 Y Y 1 L N
|
||||||
|
F0 "U" -600 1230 50 H V L BNN
|
||||||
|
F1 "ST25R3911B-AQFT" -600 -1400 50 H V L BNN
|
||||||
|
F2 "QFN50P500X500X100-33N" 0 0 50 H I L BNN
|
||||||
|
F3 "" 0 0 50 H I L BNN
|
||||||
|
F4 "5.0" 0 0 50 H I L BNN "E_MAX"
|
||||||
|
F5 "" 0 0 50 H I L BNN "BODY_DIAMETER"
|
||||||
|
F6 "0.18" 0 0 50 H I L BNN "B_MIN"
|
||||||
|
F7 "" 0 0 50 H I L BNN "THERMAL_PAD"
|
||||||
|
F8 "5.0" 0 0 50 H I L BNN "E_MIN"
|
||||||
|
F9 "" 0 0 50 H I L BNN "BALL_COLUMNS"
|
||||||
|
F10 "" 0 0 50 H I L BNN "BALL_ROWS"
|
||||||
|
F11 "0.3" 0 0 50 H I L BNN "L_MIN"
|
||||||
|
F12 "6" 0 0 50 H I L BNN "PARTREV"
|
||||||
|
F13 "0.3" 0 0 50 H I L BNN "B_MAX"
|
||||||
|
F14 "ST Microelectronics" 0 0 50 H I L BNN "MANUFACTURER"
|
||||||
|
F15 "" 0 0 50 H I L BNN "DMAX"
|
||||||
|
F16 "" 0 0 50 H I L BNN "EMAX"
|
||||||
|
F17 "5.0" 0 0 50 H I L BNN "D_MAX"
|
||||||
|
F18 "8.0" 0 0 50 H I L BNN "PIN_COUNT_D"
|
||||||
|
F19 "0.4" 0 0 50 H I L BNN "L_NOM"
|
||||||
|
F20 "" 0 0 50 H I L BNN "SNAPEDA_PACKAGE_ID"
|
||||||
|
F21 "3.5" 0 0 50 H I L BNN "E2_NOM"
|
||||||
|
F22 "" 0 0 50 H I L BNN "IPC"
|
||||||
|
F23 "" 0 0 50 H I L BNN "JEDEC"
|
||||||
|
F24 "IPC 7351B" 0 0 50 H I L BNN "STANDARD"
|
||||||
|
F25 "" 0 0 50 H I L BNN "PINS"
|
||||||
|
F26 "3.5" 0 0 50 H I L BNN "D2_NOM"
|
||||||
|
F27 "" 0 0 50 H I L BNN "PIN_COLUMNS"
|
||||||
|
F28 "0.5" 0 0 50 H I L BNN "L_MAX"
|
||||||
|
F29 "5.0" 0 0 50 H I L BNN "D_NOM"
|
||||||
|
F30 "" 0 0 50 H I L BNN "DMIN"
|
||||||
|
F31 "0.5" 0 0 50 H I L BNN "ENOM"
|
||||||
|
F32 "8.0" 0 0 50 H I L BNN "PIN_COUNT_E"
|
||||||
|
F33 "5.0" 0 0 50 H I L BNN "D_MIN"
|
||||||
|
F34 "" 0 0 50 H I L BNN "EMIN"
|
||||||
|
F35 "" 0 0 50 H I L BNN "DNOM"
|
||||||
|
F36 "5.0" 0 0 50 H I L BNN "E_NOM"
|
||||||
|
F37 "" 0 0 50 H I L BNN "PACKAGE_TYPE"
|
||||||
|
F38 "1.0" 0 0 50 H I L BNN "A_MAX"
|
||||||
|
F39 "" 0 0 50 H I L BNN "VACANCIES"
|
||||||
|
F40 "0.24" 0 0 50 H I L BNN "B_NOM"
|
||||||
|
DRAW
|
||||||
|
S -600 -1300 600 1200 0 0 10 f
|
||||||
|
X VDD_IO 1 800 1100 200 L 40 40 0 0 W
|
||||||
|
X CSO 2 -800 100 200 R 40 40 0 0 O
|
||||||
|
X VSP_D 3 800 -500 200 L 40 40 0 0 O
|
||||||
|
X XTO 4 -800 400 200 R 40 40 0 0 O
|
||||||
|
X XTI 5 -800 500 200 R 40 40 0 0 I
|
||||||
|
X VSN_D 6 800 -1000 200 L 40 40 0 0 W
|
||||||
|
X VSP_A 7 800 -400 200 L 40 40 0 0 O
|
||||||
|
X VDD 8 800 1000 200 L 40 40 0 0 W
|
||||||
|
X VSP_RF 9 800 -600 200 L 40 40 0 0 O
|
||||||
|
X RFO1 10 800 800 200 L 40 40 0 0 O
|
||||||
|
X RFO2 11 800 700 200 L 40 40 0 0 O
|
||||||
|
X TRIM1_3 13 800 -100 200 L 40 40 0 0 B
|
||||||
|
X VSN_RF 12 800 -1100 200 L 40 40 0 0 W
|
||||||
|
X TRIM2_3 14 800 -200 200 L 40 40 0 0 B
|
||||||
|
X TRIM1_2 15 800 100 200 L 40 40 0 0 B
|
||||||
|
X TRIM2_2 16 800 0 200 L 40 40 0 0 B
|
||||||
|
X TRIM1_1 17 800 300 200 L 40 40 0 0 B
|
||||||
|
X TRIM2_1 18 800 200 200 L 40 40 0 0 B
|
||||||
|
X TRIM1_0 19 800 500 200 L 40 40 0 0 B
|
||||||
|
X TRIM2_0 20 800 400 200 L 40 40 0 0 B
|
||||||
|
X VSS 21 800 -1200 200 L 40 40 0 0 W
|
||||||
|
X VSS 33 800 -1200 200 L 40 40 0 0 W
|
||||||
|
X RFI1 22 -800 800 200 R 40 40 0 0 I
|
||||||
|
X RFI2 23 -800 700 200 R 40 40 0 0 I
|
||||||
|
X AGD 24 -800 -800 200 R 40 40 0 0 B
|
||||||
|
X CSI 25 -800 200 200 R 40 40 0 0 I
|
||||||
|
X VSN_A 26 800 -900 200 L 40 40 0 0 W
|
||||||
|
X IRQ 27 -800 -500 200 R 40 40 0 0 O
|
||||||
|
X MCU_CLK 28 -800 -600 200 R 40 40 0 0 O C
|
||||||
|
X MISO 29 -800 -200 200 R 40 40 0 0 O
|
||||||
|
X MOSI 30 -800 -300 200 R 40 40 0 0 I
|
||||||
|
X SCLK 31 -800 -400 200 R 40 40 0 0 I C
|
||||||
|
X ~SS 32 -800 -100 200 R 40 40 0 0 I
|
||||||
|
ENDDRAW
|
||||||
|
ENDDEF
|
||||||
|
#
|
||||||
|
# End Library
|
@ -0,0 +1 @@
|
|||||||
|
<!DOCTYPE HTML><html lang="en-US"> <head> <meta charset="UTF-8"> <meta http-equiv="refresh" content="0; url=https://www.snapeda.com/about/import/#"> <script type="text/javascript">window.location.href="https://www.snapeda.com/about/import/#" </script> <title>Page Redirection</title> </head> <body> If you are not redirected automatically, follow this <a href="https://www.snapeda.com/about/import/#">link to the import guide</a>. </body></html>
|
2304
Hardware/FabReader2/Library/TPS63060DSCT/CONV_TPS63060DSCT.kicad_mod
Normal file
2304
Hardware/FabReader2/Library/TPS63060DSCT/CONV_TPS63060DSCT.kicad_mod
Normal file
File diff suppressed because it is too large
Load Diff
24
Hardware/FabReader2/Library/TPS63060DSCT/License.txt
Normal file
24
Hardware/FabReader2/Library/TPS63060DSCT/License.txt
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
BY ACCESSING OR USING THESE SYMBOLS & FOOTPRINTS ("MODELS"), YOU ARE ACKNOWLEDGING THAT YOU HAVE READ, FULLY UNDERSTAND AND AGREE TO THESE TERMS AND CONDITIONS (the "Agreement"), WHICH CONSTITUTE A BINDING AGREEMENT BETWEEN YOU AND SNAPEDA, INC., ENTERED INTO ON THE DATE OF SUCH OCCURRENCE (the "Effective Date"). IF YOU ARE ACCESSING OR USING THESE FILES ON BEHALF OF AN ENTITY, YOU REPRESENT THAT YOU HAVE THE RIGHT, AUTHORITY, AND CAPACITY TO BIND SUCH ENTITY TO THIS AGREEMENT AND HEREBY DO SO. IF YOU DO NOT AGREE WITH ANY OF THE TERMS OR CONDITIONS OF THIS AGREEMENT, YOU MUST NOT USE ANY PART OF THESE MODELS.
|
||||||
|
|
||||||
|
1. Design License
|
||||||
|
|
||||||
|
You and your sub-licensees are hereby licensed to design, manufacture, use and distribute, circuit board designs and circuit boards formed by combining Models provided by SnapEDA with other circuit elements of your choosing. You may then convey such combinations under licensing terms of your choice.
|
||||||
|
|
||||||
|
Individual Models remain the intellectual property of SnapEDA, Inc. You shall not (and shall not permit or encourage any third party to) to do any of the following :
|
||||||
|
|
||||||
|
(a) sell, assign, lease, lend, rent, issue, sublicense, make available, or otherwise distribute to any third party, or publicly perform, display or communicate, the Models (for example, by uploading Models to another website or software application);
|
||||||
|
(b) remove, alter, or conceal, any copyright, trademark, or other proprietary rights notice or legend displayed or contained in the individual Models.
|
||||||
|
|
||||||
|
For further clarity, once integrated into a schematic design or PCB layout, Models may be modified freely for the purpose of designing a circuit board.
|
||||||
|
|
||||||
|
|
||||||
|
2. Limitation of Liability
|
||||||
|
|
||||||
|
IN NO EVENT WILL SNAPEDA OR OUR SUBSIDIARIES, AGENTS, SUCCESSORS, THIRD PARTY PROVIDERS, AND/OR ANY OF THE FOREGOING ENTITIES' RESPECTIVE DIRECTORS, OFFICERS, EMPLOYEES, AGENTS, REPRESENTATIVES, CUSTOMERS, SUPPLIERS, OR LICENSORS BE RESPONSIBLE OR LIABLE UNDER, OR OTHERWISE IN CONNECTION WITH THIS AGREEMENT, FOR:
|
||||||
|
|
||||||
|
(a) ANY CONSEQUENTIAL, INDIRECT, SPECIAL, INCIDENTAL, OR PUNITIVE DAMAGES;
|
||||||
|
(b) ANY LOSS OF PROFITS, LOSS OF BUSINESS, LOSS OF REVENUE, OR LOSS OF ANTICIPATED SAVINGS;
|
||||||
|
(c) ANY LOSS OF, OR DAMAGE TO, DATA, REPUTATION, OR GOODWILL; AND/OR
|
||||||
|
(d) THE COST OF PROCURING ANY SUBSTITUTE GOODS OR SERVICES.
|
||||||
|
|
||||||
|
THE COMBINED AGGREGATE LIABILITY OF SNAPEDA AND ALL SNAPEDA CONTENT AFFILIATES UNDER, OR OTHERWISE IN CONNECTION WITH, THIS AGREEMENT SHALL NOT EXCEED THE TOTAL AMOUNT OF FEES RECEIVED BY SNAPEDA FROM YOU IN THE PREVIOUS TWELVE (12) MONTHS. THE FOREGOING EXCLUSIONS AND LIMITATIONS SHALL APPLY: (a) EVEN IF SNAPEDA OR ANY SNAPEDA CONTENT AFFILIATE HAS BEEN ADVISED, OR SHOULD HAVE BEEN AWARE, OF THE POSSIBILITY OF LOSSES, DAMAGES, OR COSTS; (b) EVEN IF ANY REMEDY IN THIS AGREEMENT FAILS OF ITS ESSENTIAL PURPOSE; AND (c) REGARDLESS OF THE THEORY OR BASIS OF LIABILITY (INCLUDING WITHOUT LIMITATION BREACH OF CONTRACT, TORT, NEGLIGENCE, AND STRICT LIABILITY).
|
@ -0,0 +1,81 @@
|
|||||||
|
(kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor)
|
||||||
|
(symbol "TPS63060DSCT" (pin_names (offset 1.016)) (in_bom yes) (on_board yes)
|
||||||
|
(property "Reference" "U" (id 0) (at -12.7 18.542 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Value" "TPS63060DSCT" (id 1) (at -12.7 -18.542 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Footprint" "CONV_TPS63060DSCT" (id 2) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "Datasheet" "" (id 3) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "PARTREV" "B" (id 4) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "MANUFACTURER" "Texas Instruments" (id 5) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "MAXIMUM_PACKAGE_HEIGHT" "0.8 mm" (id 6) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "STANDARD" "Manufacturer Recommendations" (id 7) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "ki_locked" "" (id 8) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)))
|
||||||
|
)
|
||||||
|
(symbol "TPS63060DSCT_0_0"
|
||||||
|
(rectangle (start -12.7 -17.78) (end 12.7 17.78)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type background))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 -5.08 0) (length 5.08)
|
||||||
|
(name "L1" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "1" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 -7.62 0) (length 5.08)
|
||||||
|
(name "L2" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "10" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -15.24 180) (length 5.08)
|
||||||
|
(name "PGND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "11" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin input line (at -17.78 15.24 0) (length 5.08)
|
||||||
|
(name "VIN" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "2" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin input line (at -17.78 10.16 0) (length 5.08)
|
||||||
|
(name "EN" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "3" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin input line (at -17.78 5.08 0) (length 5.08)
|
||||||
|
(name "PS/SYNC" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "4" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin output line (at 17.78 5.08 180) (length 5.08)
|
||||||
|
(name "PG" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "5" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -17.78 0 0) (length 5.08)
|
||||||
|
(name "VAUX" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "6" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin power_in line (at 17.78 -12.7 180) (length 5.08)
|
||||||
|
(name "GND" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "7" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin input line (at 17.78 10.16 180) (length 5.08)
|
||||||
|
(name "FB" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "8" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin output line (at 17.78 15.24 180) (length 5.08)
|
||||||
|
(name "VOUT" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "9" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
33
Hardware/FabReader2/Library/TPS63060DSCT/TPS63060DSCT.lib
Normal file
33
Hardware/FabReader2/Library/TPS63060DSCT/TPS63060DSCT.lib
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
EESchema-LIBRARY Version 2.3
|
||||||
|
#encoding utf-8
|
||||||
|
#(c) SnapEDA 2016 (snapeda.com)
|
||||||
|
#This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0
|
||||||
|
#
|
||||||
|
# TPS63060DSCT
|
||||||
|
#
|
||||||
|
DEF TPS63060DSCT U 0 40 Y Y 1 L N
|
||||||
|
F0 "U" -500 730 50 H V L BNN
|
||||||
|
F1 "TPS63060DSCT" -500 -730 50 H V L BNN
|
||||||
|
F2 "CONV_TPS63060DSCT" 0 0 50 H I L BNN
|
||||||
|
F3 "" 0 0 50 H I L BNN
|
||||||
|
F4 "B" 0 0 50 H I L BNN "PARTREV"
|
||||||
|
F5 "Texas Instruments" 0 0 50 H I L BNN "MANUFACTURER"
|
||||||
|
F6 "0.8 mm" 0 0 50 H I L BNN "MAXIMUM_PACKAGE_HEIGHT"
|
||||||
|
F7 "Manufacturer Recommendations" 0 0 50 H I L BNN "STANDARD"
|
||||||
|
DRAW
|
||||||
|
S -500 -700 500 700 0 0 10 f
|
||||||
|
X VAUX 6 -700 0 200 R 40 40 0 0 P
|
||||||
|
X GND 7 700 -500 200 L 40 40 0 0 W
|
||||||
|
X PGND 11 700 -600 200 L 40 40 0 0 W
|
||||||
|
X VIN 2 -700 600 200 R 40 40 0 0 I
|
||||||
|
X EN 3 -700 400 200 R 40 40 0 0 I
|
||||||
|
X VOUT 9 700 600 200 L 40 40 0 0 O
|
||||||
|
X PS/SYNC 4 -700 200 200 R 40 40 0 0 I
|
||||||
|
X PG 5 700 200 200 L 40 40 0 0 O
|
||||||
|
X L1 1 -700 -200 200 R 40 40 0 0 P
|
||||||
|
X L2 10 -700 -300 200 R 40 40 0 0 P
|
||||||
|
X FB 8 700 400 200 L 40 40 0 0 I
|
||||||
|
ENDDRAW
|
||||||
|
ENDDEF
|
||||||
|
#
|
||||||
|
# End Library
|
7322
Hardware/FabReader2/Library/TPS63060DSCT/TPS63060DSCT.step
Normal file
7322
Hardware/FabReader2/Library/TPS63060DSCT/TPS63060DSCT.step
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1 @@
|
|||||||
|
<!DOCTYPE HTML><html lang="en-US"> <head> <meta charset="UTF-8"> <meta http-equiv="refresh" content="0; url=https://www.snapeda.com/about/import/#"> <script type="text/javascript">window.location.href="https://www.snapeda.com/about/import/#" </script> <title>Page Redirection</title> </head> <body> If you are not redirected automatically, follow this <a href="https://www.snapeda.com/about/import/#">link to the import guide</a>. </body></html>
|
@ -0,0 +1,24 @@
|
|||||||
|
BY ACCESSING OR USING THESE SYMBOLS & FOOTPRINTS ("MODELS"), YOU ARE ACKNOWLEDGING THAT YOU HAVE READ, FULLY UNDERSTAND AND AGREE TO THESE TERMS AND CONDITIONS (the "Agreement"), WHICH CONSTITUTE A BINDING AGREEMENT BETWEEN YOU AND SNAPEDA, INC., ENTERED INTO ON THE DATE OF SUCH OCCURRENCE (the "Effective Date"). IF YOU ARE ACCESSING OR USING THESE FILES ON BEHALF OF AN ENTITY, YOU REPRESENT THAT YOU HAVE THE RIGHT, AUTHORITY, AND CAPACITY TO BIND SUCH ENTITY TO THIS AGREEMENT AND HEREBY DO SO. IF YOU DO NOT AGREE WITH ANY OF THE TERMS OR CONDITIONS OF THIS AGREEMENT, YOU MUST NOT USE ANY PART OF THESE MODELS.
|
||||||
|
|
||||||
|
1. Design License
|
||||||
|
|
||||||
|
You and your sub-licensees are hereby licensed to design, manufacture, use and distribute, circuit board designs and circuit boards formed by combining Models provided by SnapEDA with other circuit elements of your choosing. You may then convey such combinations under licensing terms of your choice.
|
||||||
|
|
||||||
|
Individual Models remain the intellectual property of SnapEDA, Inc. You shall not (and shall not permit or encourage any third party to) to do any of the following :
|
||||||
|
|
||||||
|
(a) sell, assign, lease, lend, rent, issue, sublicense, make available, or otherwise distribute to any third party, or publicly perform, display or communicate, the Models (for example, by uploading Models to another website or software application);
|
||||||
|
(b) remove, alter, or conceal, any copyright, trademark, or other proprietary rights notice or legend displayed or contained in the individual Models.
|
||||||
|
|
||||||
|
For further clarity, once integrated into a schematic design or PCB layout, Models may be modified freely for the purpose of designing a circuit board.
|
||||||
|
|
||||||
|
|
||||||
|
2. Limitation of Liability
|
||||||
|
|
||||||
|
IN NO EVENT WILL SNAPEDA OR OUR SUBSIDIARIES, AGENTS, SUCCESSORS, THIRD PARTY PROVIDERS, AND/OR ANY OF THE FOREGOING ENTITIES' RESPECTIVE DIRECTORS, OFFICERS, EMPLOYEES, AGENTS, REPRESENTATIVES, CUSTOMERS, SUPPLIERS, OR LICENSORS BE RESPONSIBLE OR LIABLE UNDER, OR OTHERWISE IN CONNECTION WITH THIS AGREEMENT, FOR:
|
||||||
|
|
||||||
|
(a) ANY CONSEQUENTIAL, INDIRECT, SPECIAL, INCIDENTAL, OR PUNITIVE DAMAGES;
|
||||||
|
(b) ANY LOSS OF PROFITS, LOSS OF BUSINESS, LOSS OF REVENUE, OR LOSS OF ANTICIPATED SAVINGS;
|
||||||
|
(c) ANY LOSS OF, OR DAMAGE TO, DATA, REPUTATION, OR GOODWILL; AND/OR
|
||||||
|
(d) THE COST OF PROCURING ANY SUBSTITUTE GOODS OR SERVICES.
|
||||||
|
|
||||||
|
THE COMBINED AGGREGATE LIABILITY OF SNAPEDA AND ALL SNAPEDA CONTENT AFFILIATES UNDER, OR OTHERWISE IN CONNECTION WITH, THIS AGREEMENT SHALL NOT EXCEED THE TOTAL AMOUNT OF FEES RECEIVED BY SNAPEDA FROM YOU IN THE PREVIOUS TWELVE (12) MONTHS. THE FOREGOING EXCLUSIONS AND LIMITATIONS SHALL APPLY: (a) EVEN IF SNAPEDA OR ANY SNAPEDA CONTENT AFFILIATE HAS BEEN ADVISED, OR SHOULD HAVE BEEN AWARE, OF THE POSSIBILITY OF LOSSES, DAMAGES, OR COSTS; (b) EVEN IF ANY REMEDY IN THIS AGREEMENT FAILS OF ITS ESSENTIAL PURPOSE; AND (c) REGARDLESS OF THE THEORY OR BASIS OF LIABILITY (INCLUDING WITHOUT LIMITATION BREACH OF CONTRACT, TORT, NEGLIGENCE, AND STRICT LIABILITY).
|
@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
(module SW_TS04-66-95-BK-260-SMT (layer F.Cu) (tedit 6269D6C4)
|
||||||
|
(descr "")
|
||||||
|
(fp_text reference REF** (at -2.675 -4.385 0) (layer F.SilkS)
|
||||||
|
(effects (font (size 1.0 1.0) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(fp_text value SW_TS04-66-95-BK-260-SMT (at 9.39 4.385 0) (layer F.Fab)
|
||||||
|
(effects (font (size 1.0 1.0) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
(pad 2 smd rect (at -4.55 2.25) (size 2.1 1.4) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 1 smd rect (at -4.55 -2.25) (size 2.1 1.4) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 3 smd rect (at 4.55 -2.25) (size 2.1 1.4) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(pad 4 smd rect (at 4.55 2.25) (size 2.1 1.4) (layers F.Cu F.Mask F.Paste))
|
||||||
|
(fp_line (start -3.0 -3.0) (end -3.0 3.0) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start -3.0 3.0) (end 3.0 3.0) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start 3.0 3.0) (end 3.0 -3.0) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start 3.0 -3.0) (end -3.0 -3.0) (layer F.Fab) (width 0.127))
|
||||||
|
(fp_line (start -3.0 -3.0) (end -3.0 3.0) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -3.0 3.0) (end 3.0 3.0) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 3.0 3.0) (end 3.0 -3.0) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start 3.0 -3.0) (end -3.0 -3.0) (layer F.SilkS) (width 0.127))
|
||||||
|
(fp_line (start -5.85 -3.25) (end -5.85 3.25) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -5.85 3.25) (end 5.85 3.25) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start 5.85 3.25) (end 5.85 -3.25) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start 5.85 -3.25) (end -5.85 -3.25) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_circle (center -6.25 -2.25) (end -6.15 -2.25) (layer F.SilkS) (width 0.2))
|
||||||
|
(fp_circle (center -6.25 -2.25) (end -6.15 -2.25) (layer F.Fab) (width 0.2))
|
||||||
|
)
|
@ -0,0 +1,174 @@
|
|||||||
|
(kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor)
|
||||||
|
(symbol "TS04-66-95-BK-260-SMT" (pin_names (offset 1.016) hide) (in_bom yes) (on_board yes)
|
||||||
|
(property "Reference" "S" (id 0) (at -7.62 8.382 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Value" "TS04-66-95-BK-260-SMT" (id 1) (at -7.62 -8.382 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom))
|
||||||
|
)
|
||||||
|
(property "Footprint" "SW_TS04-66-95-BK-260-SMT" (id 2) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "Datasheet" "" (id 3) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "PARTREV" "1.0" (id 4) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "STANDARD" "Manufacturer Recommendations" (id 5) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "MANUFACTURER" "CUI Devices" (id 6) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)) (justify left bottom) hide)
|
||||||
|
)
|
||||||
|
(property "ki_locked" "" (id 7) (at 0 0 0)
|
||||||
|
(effects (font (size 1.27 1.27)))
|
||||||
|
)
|
||||||
|
(symbol "TS04-66-95-BK-260-SMT_0_0"
|
||||||
|
(circle (center 0 -1.905) (radius 0.635)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy -7.62 -7.62)
|
||||||
|
(xy 7.62 -7.62)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy -7.62 -5.08)
|
||||||
|
(xy -7.62 -7.62)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy -7.62 5.08)
|
||||||
|
(xy -7.62 -5.08)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy -7.62 7.62)
|
||||||
|
(xy -7.62 5.08)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 0 -5.08)
|
||||||
|
(xy -7.62 -5.08)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 0 -5.08)
|
||||||
|
(xy 7.62 -5.08)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 0 -2.54)
|
||||||
|
(xy 0 -5.08)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 0 5.08)
|
||||||
|
(xy -7.62 5.08)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 0 5.08)
|
||||||
|
(xy 0 2.54)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 0 5.08)
|
||||||
|
(xy 7.62 5.08)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 0.635 -2.2352)
|
||||||
|
(xy 2.54 1.27)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 7.62 -7.62)
|
||||||
|
(xy 7.62 -5.08)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 7.62 -5.08)
|
||||||
|
(xy 7.62 5.08)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 7.62 5.08)
|
||||||
|
(xy 7.62 7.62)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(polyline
|
||||||
|
(pts
|
||||||
|
(xy 7.62 7.62)
|
||||||
|
(xy -7.62 7.62)
|
||||||
|
)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(circle (center 0 1.905) (radius 0.635)
|
||||||
|
(stroke (width 0.254) (type default) (color 0 0 0 0))
|
||||||
|
(fill (type none))
|
||||||
|
)
|
||||||
|
(pin passive line (at -12.7 5.08 0) (length 5.08)
|
||||||
|
(name "~" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "1" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at -12.7 -5.08 0) (length 5.08)
|
||||||
|
(name "~" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "2" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at 12.7 5.08 180) (length 5.08)
|
||||||
|
(name "~" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "3" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
(pin passive line (at 12.7 -5.08 180) (length 5.08)
|
||||||
|
(name "~" (effects (font (size 1.016 1.016))))
|
||||||
|
(number "4" (effects (font (size 1.016 1.016))))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
@ -0,0 +1,41 @@
|
|||||||
|
EESchema-LIBRARY Version 2.3
|
||||||
|
#encoding utf-8
|
||||||
|
#(c) SnapEDA 2016 (snapeda.com)
|
||||||
|
#This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0
|
||||||
|
#
|
||||||
|
# TS04-66-95-BK-260-SMT
|
||||||
|
#
|
||||||
|
DEF TS04-66-95-BK-260-SMT S 0 40 Y N 1 L N
|
||||||
|
F0 "S" -300 330 50 H V L BNN
|
||||||
|
F1 "TS04-66-95-BK-260-SMT" -300 -330 50 H V L BNN
|
||||||
|
F2 "SW_TS04-66-95-BK-260-SMT" 0 0 50 H I L BNN
|
||||||
|
F3 "" 0 0 50 H I L BNN
|
||||||
|
F4 "1.0" 0 0 50 H I L BNN "PARTREV"
|
||||||
|
F5 "Manufacturer Recommendations" 0 0 50 H I L BNN "STANDARD"
|
||||||
|
F6 "CUI Devices" 0 0 50 H I L BNN "MANUFACTURER"
|
||||||
|
DRAW
|
||||||
|
P 2 0 0 10 0 200 0 100 N
|
||||||
|
P 2 0 0 10 0 -100 0 -200 N
|
||||||
|
P 2 0 0 10 -300 300 -300 200 N
|
||||||
|
P 2 0 0 10 -300 200 -300 -200 N
|
||||||
|
P 2 0 0 10 -300 -200 -300 -300 N
|
||||||
|
P 2 0 0 10 -300 -300 300 -300 N
|
||||||
|
P 2 0 0 10 300 -300 300 -200 N
|
||||||
|
P 2 0 0 10 300 -200 300 200 N
|
||||||
|
P 2 0 0 10 300 200 300 300 N
|
||||||
|
P 2 0 0 10 300 300 -300 300 N
|
||||||
|
P 2 0 0 10 0 200 -300 200 N
|
||||||
|
P 2 0 0 10 0 200 300 200 N
|
||||||
|
P 2 0 0 10 0 -200 -300 -200 N
|
||||||
|
P 2 0 0 10 0 -200 300 -200 N
|
||||||
|
C 0 -75 25 0 0 10 N
|
||||||
|
C 0 75 25 0 0 10 N
|
||||||
|
P 2 0 0 10 25 -88 100 50 N
|
||||||
|
X ~ 1 -500 200 200 R 40 40 0 0 P
|
||||||
|
X ~ 2 -500 -200 200 R 40 40 0 0 P
|
||||||
|
X ~ 3 500 200 200 L 40 40 0 0 P
|
||||||
|
X ~ 4 500 -200 200 L 40 40 0 0 P
|
||||||
|
ENDDRAW
|
||||||
|
ENDDEF
|
||||||
|
#
|
||||||
|
# End Library
|
@ -0,0 +1 @@
|
|||||||
|
<!DOCTYPE HTML><html lang="en-US"> <head> <meta charset="UTF-8"> <meta http-equiv="refresh" content="0; url=https://www.snapeda.com/about/import/#"> <script type="text/javascript">window.location.href="https://www.snapeda.com/about/import/#" </script> <title>Page Redirection</title> </head> <body> If you are not redirected automatically, follow this <a href="https://www.snapeda.com/about/import/#">link to the import guide</a>. </body></html>
|
10
Hardware/FabReader2/sym-lib-table
Normal file
10
Hardware/FabReader2/sym-lib-table
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
(sym_lib_table
|
||||||
|
(lib (name "2305018-2")(type "KiCad")(uri "${KIPRJMOD}/Library/2305018-2/2305018-2.kicad_sym")(options "")(descr ""))
|
||||||
|
(lib (name "CMI-9705-0380-SMT-TR")(type "KiCad")(uri "${KIPRJMOD}/Library/CMI-9705-0380-SMT-TR/CMI-9705-0380-SMT-TR.kicad_sym")(options "")(descr ""))
|
||||||
|
(lib (name "DW01A")(type "KiCad")(uri "${KIPRJMOD}/Library/DW01A/DW01A.kicad_sym")(options "")(descr ""))
|
||||||
|
(lib (name "ESP32-C3-WROOM-02-H4")(type "KiCad")(uri "${KIPRJMOD}/Library/ESP32-C3-WROOM-02-H4/ESP32-C3-WROOM-02-H4.kicad_sym")(options "")(descr ""))
|
||||||
|
(lib (name "S2B-PH-SM4-TB_LF__SN_")(type "KiCad")(uri "${KIPRJMOD}/Library/S2B-PH-SM4-TB_LF__SN_/S2B-PH-SM4-TB_LF__SN_.kicad_sym")(options "")(descr ""))
|
||||||
|
(lib (name "ST25R3911B-AQFT")(type "KiCad")(uri "${KIPRJMOD}/Library/ST25R3911B-AQFT/ST25R3911B-AQFT.kicad_sym")(options "")(descr ""))
|
||||||
|
(lib (name "TPS63060DSCT")(type "KiCad")(uri "${KIPRJMOD}/Library/TPS63060DSCT/TPS63060DSCT.kicad_sym")(options "")(descr ""))
|
||||||
|
(lib (name "TS04-66-95-BK-260-SMT")(type "KiCad")(uri "${KIPRJMOD}/Library/TS04-66-95-BK-260-SMT/TS04-66-95-BK-260-SMT.kicad_sym")(options "")(descr ""))
|
||||||
|
)
|
73
Software/CMakeLists.txt
Normal file
73
Software/CMakeLists.txt
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
#THIS FILE IS AUTO GENERATED FROM THE TEMPLATE! DO NOT CHANGE!
|
||||||
|
set(CMAKE_SYSTEM_NAME Generic)
|
||||||
|
set(CMAKE_SYSTEM_VERSION 1)
|
||||||
|
cmake_minimum_required(VERSION 3.21)
|
||||||
|
|
||||||
|
# specify cross compilers and tools
|
||||||
|
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
|
||||||
|
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
|
||||||
|
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
|
||||||
|
set(CMAKE_AR arm-none-eabi-ar)
|
||||||
|
set(CMAKE_OBJCOPY arm-none-eabi-objcopy)
|
||||||
|
set(CMAKE_OBJDUMP arm-none-eabi-objdump)
|
||||||
|
set(SIZE arm-none-eabi-size)
|
||||||
|
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
||||||
|
|
||||||
|
# project settings
|
||||||
|
project(FabReader2 C CXX ASM)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_C_STANDARD 11)
|
||||||
|
|
||||||
|
#Uncomment for hardware floating point
|
||||||
|
#add_compile_definitions(ARM_MATH_CM4;ARM_MATH_MATRIX_CHECK;ARM_MATH_ROUNDING)
|
||||||
|
#add_compile_options(-mfloat-abi=hard -mfpu=fpv4-sp-d16)
|
||||||
|
#add_link_options(-mfloat-abi=hard -mfpu=fpv4-sp-d16)
|
||||||
|
|
||||||
|
#Uncomment for software floating point
|
||||||
|
#add_compile_options(-mfloat-abi=soft)
|
||||||
|
|
||||||
|
add_compile_options(-mcpu=cortex-m4 -mthumb -mthumb-interwork)
|
||||||
|
add_compile_options(-ffunction-sections -fdata-sections -fno-common -fmessage-length=0)
|
||||||
|
|
||||||
|
# uncomment to mitigate c++17 absolute addresses warnings
|
||||||
|
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-register")
|
||||||
|
|
||||||
|
# Enable assembler files preprocessing
|
||||||
|
add_compile_options($<$<COMPILE_LANGUAGE:ASM>:-x$<SEMICOLON>assembler-with-cpp>)
|
||||||
|
|
||||||
|
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||||
|
message(STATUS "Maximum optimization for speed")
|
||||||
|
add_compile_options(-Ofast)
|
||||||
|
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
|
||||||
|
message(STATUS "Maximum optimization for speed, debug info included")
|
||||||
|
add_compile_options(-Ofast -g)
|
||||||
|
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
|
||||||
|
message(STATUS "Maximum optimization for size")
|
||||||
|
add_compile_options(-Os)
|
||||||
|
else ()
|
||||||
|
message(STATUS "Minimal optimization, debug info included")
|
||||||
|
add_compile_options(-Og -g)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
include_directories(Core/Inc Drivers/STM32F3xx_HAL_Driver/Inc Drivers/STM32F3xx_HAL_Driver/Inc/Legacy Drivers/CMSIS/Device/ST/STM32F3xx/Include Drivers/CMSIS/Include)
|
||||||
|
|
||||||
|
add_definitions(-DDEBUG -DUSE_HAL_DRIVER -DSTM32F303xE)
|
||||||
|
|
||||||
|
file(GLOB_RECURSE SOURCES "Core/*.*" "Drivers/*.*")
|
||||||
|
|
||||||
|
set(LINKER_SCRIPT ${CMAKE_SOURCE_DIR}/STM32F303RETX_FLASH.ld)
|
||||||
|
|
||||||
|
add_link_options(-Wl,-gc-sections,--print-memory-usage,-Map=${PROJECT_BINARY_DIR}/${PROJECT_NAME}.map)
|
||||||
|
add_link_options(-mcpu=cortex-m4 -mthumb -mthumb-interwork)
|
||||||
|
add_link_options(-T ${LINKER_SCRIPT})
|
||||||
|
|
||||||
|
add_executable(${PROJECT_NAME}.elf ${SOURCES} ${LINKER_SCRIPT})
|
||||||
|
|
||||||
|
set(HEX_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.hex)
|
||||||
|
set(BIN_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.bin)
|
||||||
|
|
||||||
|
add_custom_command(TARGET ${PROJECT_NAME}.elf POST_BUILD
|
||||||
|
COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${PROJECT_NAME}.elf> ${HEX_FILE}
|
||||||
|
COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${PROJECT_NAME}.elf> ${BIN_FILE}
|
||||||
|
COMMENT "Building ${HEX_FILE}
|
||||||
|
Building ${BIN_FILE}")
|
72
Software/CMakeLists_template.txt
Normal file
72
Software/CMakeLists_template.txt
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
#${templateWarning}
|
||||||
|
set(CMAKE_SYSTEM_NAME Generic)
|
||||||
|
set(CMAKE_SYSTEM_VERSION 1)
|
||||||
|
${cmakeRequiredVersion}
|
||||||
|
# specify cross compilers and tools
|
||||||
|
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
|
||||||
|
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
|
||||||
|
set(CMAKE_ASM_COMPILER arm-none-eabi-gcc)
|
||||||
|
set(CMAKE_AR arm-none-eabi-ar)
|
||||||
|
set(CMAKE_OBJCOPY arm-none-eabi-objcopy)
|
||||||
|
set(CMAKE_OBJDUMP arm-none-eabi-objdump)
|
||||||
|
set(SIZE arm-none-eabi-size)
|
||||||
|
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
||||||
|
|
||||||
|
# project settings
|
||||||
|
project(${projectName} C CXX ASM)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_C_STANDARD 11)
|
||||||
|
|
||||||
|
#Uncomment for hardware floating point
|
||||||
|
#add_compile_definitions(ARM_MATH_CM4;ARM_MATH_MATRIX_CHECK;ARM_MATH_ROUNDING)
|
||||||
|
#add_compile_options(-mfloat-abi=hard -mfpu=fpv4-sp-d16)
|
||||||
|
#add_link_options(-mfloat-abi=hard -mfpu=fpv4-sp-d16)
|
||||||
|
|
||||||
|
#Uncomment for software floating point
|
||||||
|
#add_compile_options(-mfloat-abi=soft)
|
||||||
|
|
||||||
|
add_compile_options(-mcpu=${mcpu} -mthumb -mthumb-interwork)
|
||||||
|
add_compile_options(-ffunction-sections -fdata-sections -fno-common -fmessage-length=0)
|
||||||
|
|
||||||
|
# uncomment to mitigate c++17 absolute addresses warnings
|
||||||
|
#set(CMAKE_CXX_FLAGS "$${CMAKE_CXX_FLAGS} -Wno-register")
|
||||||
|
|
||||||
|
# Enable assembler files preprocessing
|
||||||
|
add_compile_options($<$<COMPILE_LANGUAGE:ASM>:-x$<SEMICOLON>assembler-with-cpp>)
|
||||||
|
|
||||||
|
if ("$${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
||||||
|
message(STATUS "Maximum optimization for speed")
|
||||||
|
add_compile_options(-Ofast)
|
||||||
|
elseif ("$${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
|
||||||
|
message(STATUS "Maximum optimization for speed, debug info included")
|
||||||
|
add_compile_options(-Ofast -g)
|
||||||
|
elseif ("$${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel")
|
||||||
|
message(STATUS "Maximum optimization for size")
|
||||||
|
add_compile_options(-Os)
|
||||||
|
else ()
|
||||||
|
message(STATUS "Minimal optimization, debug info included")
|
||||||
|
add_compile_options(-Og -g)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
include_directories(${includes})
|
||||||
|
|
||||||
|
add_definitions(${defines})
|
||||||
|
|
||||||
|
file(GLOB_RECURSE SOURCES ${sources})
|
||||||
|
|
||||||
|
set(LINKER_SCRIPT $${CMAKE_SOURCE_DIR}/${linkerScript})
|
||||||
|
|
||||||
|
add_link_options(-Wl,-gc-sections,--print-memory-usage,-Map=$${PROJECT_BINARY_DIR}/$${PROJECT_NAME}.map)
|
||||||
|
add_link_options(-mcpu=${mcpu} -mthumb -mthumb-interwork)
|
||||||
|
add_link_options(-T $${LINKER_SCRIPT})
|
||||||
|
|
||||||
|
add_executable($${PROJECT_NAME}.elf $${SOURCES} $${LINKER_SCRIPT})
|
||||||
|
|
||||||
|
set(HEX_FILE $${PROJECT_BINARY_DIR}/$${PROJECT_NAME}.hex)
|
||||||
|
set(BIN_FILE $${PROJECT_BINARY_DIR}/$${PROJECT_NAME}.bin)
|
||||||
|
|
||||||
|
add_custom_command(TARGET $${PROJECT_NAME}.elf POST_BUILD
|
||||||
|
COMMAND $${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:$${PROJECT_NAME}.elf> $${HEX_FILE}
|
||||||
|
COMMAND $${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:$${PROJECT_NAME}.elf> $${BIN_FILE}
|
||||||
|
COMMENT "Building $${HEX_FILE}
|
||||||
|
Building $${BIN_FILE}")
|
62
Software/Core/Inc/demo.h
Normal file
62
Software/Core/Inc/demo.h
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
*
|
||||||
|
* COPYRIGHT(c) 2017 STMicroelectronics
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author
|
||||||
|
*
|
||||||
|
* \brief Demo functionality header file
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __DEMO_H
|
||||||
|
#define __DEMO_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "platform.h"
|
||||||
|
#include "st_errno.h"
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Exported functions ------------------------------------------------------- */
|
||||||
|
bool demoIni( void );
|
||||||
|
extern void demoCycle(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __DEMO_H */
|
||||||
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
127
Software/Core/Inc/demo_ce.h
Normal file
127
Software/Core/Inc/demo_ce.h
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file demo_ce.h
|
||||||
|
* @author MMY Application Team
|
||||||
|
* @brief Implementation of Common CardEmulation parts
|
||||||
|
******************************************************************************
|
||||||
|
** This notice applies to any and all portions of this file
|
||||||
|
* that are not between comment pairs USER CODE BEGIN and
|
||||||
|
* USER CODE END. Other portions of this file, whether
|
||||||
|
* inserted by the user or by software development tools
|
||||||
|
* are owned by their respective copyright owners.
|
||||||
|
*
|
||||||
|
* COPYRIGHT(c) 2018 STMicroelectronics
|
||||||
|
*
|
||||||
|
* 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 DEMO_CE_H
|
||||||
|
#define DEMO_CE_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "platform.h"
|
||||||
|
|
||||||
|
/** @addtogroup X-CUBE-NFC6_Applications
|
||||||
|
* @brief Sample applications for X-NUCLEO-NFC06A1 STM32 expansion boards.
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup CardEmulation
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CE_CardEmul
|
||||||
|
* @brief Card Emulation management functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/* T3T Information Block Bytes offset */
|
||||||
|
#define T3T_INFBLK_VER_OFFSET 0
|
||||||
|
#define T3T_INFBLK_NBR_OFFSET 1
|
||||||
|
#define T3T_INFBLK_NBW_OFFSET 2
|
||||||
|
#define T3T_INFBLK_NMAXB_OFFSET 3
|
||||||
|
#define T3T_INFBLK_WRITEFLAG_OFFSET 9
|
||||||
|
#define T3T_INFBLK_RWFLAG_OFFSET 10
|
||||||
|
#define T3T_INFBLK_LN_OFFSET 11
|
||||||
|
#define T3T_INFBCK_CHECKSUM_OFFSET 14
|
||||||
|
|
||||||
|
/* T3T Information Block WriteFlag values */
|
||||||
|
#define T3T_WRITEFLAG_OFF 0x00
|
||||||
|
#define T3T_WRITEFLAG_ON 0x0F
|
||||||
|
|
||||||
|
/* T3T COMMAND OFFSET */
|
||||||
|
#define T3T_CHECK_RESP_CMD_OFFSET 0
|
||||||
|
#define T3T_CHECK_RESP_NFCID2_OFFSET 1
|
||||||
|
#define T3T_CHECK_RESP_SF1_OFFSET 9
|
||||||
|
#define T3T_CHECK_RESP_SF2_OFFSET 10
|
||||||
|
#define T3T_CHECK_RESP_NOB_OFFSET 11
|
||||||
|
#define T3T_CHECK_RESP_DATA_OFFSET 12
|
||||||
|
#define T3T_UPDATE_RESP_CMD_OFFSET 0
|
||||||
|
#define T3T_UPDATE_RESP_NFCID2_OFFSET 1
|
||||||
|
#define T3T_UPDATE_RESP_SF1_OFFSET 9
|
||||||
|
#define T3T_UPDATE_RESP_SF2_OFFSET 10
|
||||||
|
|
||||||
|
/* External variables --------------------------------------------------------*/
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/* Exported functions ------------------------------------------------------- */
|
||||||
|
/** @defgroup CE_CardEmul_Exported_functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
void demoCeInit(uint8_t* nfcfNfcid);
|
||||||
|
uint16_t demoCeT3T(uint8_t *rxData, uint16_t rxDataLen, uint8_t *txBuf, uint16_t txBufLen );
|
||||||
|
uint16_t demoCeT4T(uint8_t *rxData, uint16_t rxDataLen, uint8_t *txBuf, uint16_t txBufLen );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* DEMO_CE_H */
|
||||||
|
|
||||||
|
/******************* (C) COPYRIGHT 2018 STMicroelectronics *****END OF FILE****/
|
96
Software/Core/Inc/logger.h
Normal file
96
Software/Core/Inc/logger.h
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* http://www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
/*
|
||||||
|
* PROJECT:
|
||||||
|
* $Revision: $
|
||||||
|
* LANGUAGE: ANSI C
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author
|
||||||
|
*
|
||||||
|
* \brief serial output log declaration file
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
*
|
||||||
|
* This driver provides a printf-like way to output log messages
|
||||||
|
* via the UART interface. It makes use of the uart driver.
|
||||||
|
*
|
||||||
|
* API:
|
||||||
|
* - Write a log message to UART output: #DEBUG
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef LOGGER_H
|
||||||
|
#define LOGGER_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#include "platform.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#define LOGGER_ON 1
|
||||||
|
#define LOGGER_OFF 0
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Writes out a formated string via UART interface
|
||||||
|
*
|
||||||
|
* This function is used to write a formated string via the UART interface.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void logUsartInit(UART_HandleTypeDef *husart);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Writes out a formated string via UART interface
|
||||||
|
*
|
||||||
|
* This function is used to write a formated string via the UART interface.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern int logUsart(const char* format, ...);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief helper to convert hex data into formated string
|
||||||
|
*
|
||||||
|
* \param[in] data : pointer to buffer to be dumped.
|
||||||
|
*
|
||||||
|
* \param[in] dataLen : buffer length
|
||||||
|
*
|
||||||
|
* \return hex formated string
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern char* hex2Str(unsigned char * data, size_t dataLen);
|
||||||
|
|
||||||
|
#endif /* LOGGER_H */
|
||||||
|
|
80
Software/Core/Inc/main.h
Normal file
80
Software/Core/Inc/main.h
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file : main.h
|
||||||
|
* @brief : Header for main.c file.
|
||||||
|
* This file contains the common defines of the application.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __MAIN_H
|
||||||
|
#define __MAIN_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32f3xx_hal.h"
|
||||||
|
|
||||||
|
/* Private includes ----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN ET */
|
||||||
|
|
||||||
|
/* USER CODE END ET */
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EC */
|
||||||
|
|
||||||
|
/* USER CODE END EC */
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EM */
|
||||||
|
|
||||||
|
/* USER CODE END EM */
|
||||||
|
|
||||||
|
/* Exported functions prototypes ---------------------------------------------*/
|
||||||
|
void Error_Handler(void);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN EFP */
|
||||||
|
|
||||||
|
/* USER CODE END EFP */
|
||||||
|
|
||||||
|
/* Private defines -----------------------------------------------------------*/
|
||||||
|
#define B1_Pin GPIO_PIN_13
|
||||||
|
#define B1_GPIO_Port GPIOC
|
||||||
|
#define USART_TX_Pin GPIO_PIN_2
|
||||||
|
#define USART_TX_GPIO_Port GPIOA
|
||||||
|
#define USART_RX_Pin GPIO_PIN_3
|
||||||
|
#define USART_RX_GPIO_Port GPIOA
|
||||||
|
#define TMS_Pin GPIO_PIN_13
|
||||||
|
#define TMS_GPIO_Port GPIOA
|
||||||
|
#define TCK_Pin GPIO_PIN_14
|
||||||
|
#define TCK_GPIO_Port GPIOA
|
||||||
|
#define SWO_Pin GPIO_PIN_3
|
||||||
|
#define SWO_GPIO_Port GPIOB
|
||||||
|
/* USER CODE BEGIN Private defines */
|
||||||
|
|
||||||
|
/* USER CODE END Private defines */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __MAIN_H */
|
247
Software/Core/Inc/ndef_dump.h
Normal file
247
Software/Core/Inc/ndef_dump.h
Normal file
@ -0,0 +1,247 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* \attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2019 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PROJECT: NDEF firmware
|
||||||
|
* Revision:
|
||||||
|
* LANGUAGE: ISO C99
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author
|
||||||
|
*
|
||||||
|
* \brief NDEF message dump utils header file
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NDEF_DUMP_H
|
||||||
|
#define NDEF_DUMP_H
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "platform.h"
|
||||||
|
#include "ndef_record.h"
|
||||||
|
#include "ndef_message.h"
|
||||||
|
#include "ndef_types.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL TYPES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL FUNCTION PROTOTYPES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* Dump an NDEF record
|
||||||
|
*
|
||||||
|
* This function dumps an NDEF record in a formatted readable style
|
||||||
|
* The verbose selector enables more or less dump output.
|
||||||
|
*
|
||||||
|
* \param[in] record
|
||||||
|
* \param[in] verbose
|
||||||
|
*
|
||||||
|
* \return ERR_NONE if successful or a standard error code
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode ndefRecordDump(const ndefRecord* record, bool verbose);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* Dump an NDEF message
|
||||||
|
*
|
||||||
|
* This function dumps an NDEF message in a formatted readable style
|
||||||
|
* The verbose selector enables more or less dump output.
|
||||||
|
*
|
||||||
|
* \param[in] message
|
||||||
|
* \param[in] verbose
|
||||||
|
*
|
||||||
|
* \return ERR_NONE if successful or a standard error code
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode ndefMessageDump(const ndefMessage* message, bool verbose);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* Dump an Empty type
|
||||||
|
*
|
||||||
|
* \param[in] empty: Type to dump
|
||||||
|
*
|
||||||
|
* \return ERR_NONE if successful or a standard error code
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode ndefEmptyTypeDump(const ndefType* empty);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* Dump a Device Information RTD well-known type
|
||||||
|
*
|
||||||
|
* \param[in] devInfo: Well-known type to dump
|
||||||
|
*
|
||||||
|
* \return ERR_NONE if successful or a standard error code
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode ndefRtdDeviceInfoDump(const ndefType* devInfo);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* Dump a Text RTD well-known type
|
||||||
|
*
|
||||||
|
* \param[in] text: Well-known type to dump
|
||||||
|
*
|
||||||
|
* \return ERR_NONE if successful or a standard error code
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode ndefRtdTextDump(const ndefType* text);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* Dump a URI RTD well-known type
|
||||||
|
*
|
||||||
|
* \param[in] uri: Well-known type to dump
|
||||||
|
*
|
||||||
|
* \return ERR_NONE if successful or a standard error code
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode ndefRtdUriDump(const ndefType* uri);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* Dump an External RTD type
|
||||||
|
*
|
||||||
|
* \param[in] ext: Well-known type to dump
|
||||||
|
*
|
||||||
|
* \return ERR_NONE if successful or a standard error code
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode ndefRtdAarDump(const ndefType* ext);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* Dump a Media type
|
||||||
|
*
|
||||||
|
* \param[in] media: Media type to dump
|
||||||
|
*
|
||||||
|
* \return ERR_NONE if successful or a standard error code
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode ndefMediaTypeDump(const ndefType* media);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* Dump a vCard Media type
|
||||||
|
*
|
||||||
|
* \param[in] vCard: vCard to dump
|
||||||
|
*
|
||||||
|
* \return ERR_NONE if successful or a standard error code
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode ndefMediaVCardDump(const ndefType* vCard);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* Dump a Wifi Media type
|
||||||
|
*
|
||||||
|
* \param[in] wifi: Wifi parameters to dump
|
||||||
|
*
|
||||||
|
* \return ERR_NONE if successful or a standard error code
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode ndefMediaWifiDump(const ndefType* wifi);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* Dump a well-known type
|
||||||
|
*
|
||||||
|
* \param[in] record: Record to dump
|
||||||
|
*
|
||||||
|
* \return ERR_NONE if successful or a standard error code
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode ndefRecordDumpType(const ndefRecord* record);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* Dump a raw buffer stored in a ndefBuffer
|
||||||
|
*
|
||||||
|
* This function dumps a raw buffer in a formatted style
|
||||||
|
*
|
||||||
|
* \param[in] string: Message displayed before the buffer
|
||||||
|
* \param[in] bufPayload: Payload buffer to display
|
||||||
|
* \param[in] verbose Increase the lenght displayed
|
||||||
|
*
|
||||||
|
* \return ERR_NONE if successful or a standard error code
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode ndefBufferDump(const char* string, const ndefConstBuffer* bufPayload, bool verbose);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* Dump a raw buffer stored in a ndefBuffer
|
||||||
|
*
|
||||||
|
* This function dumps a raw buffer in a formatted style
|
||||||
|
*
|
||||||
|
* \param[in] prefix: String displayed before the buffer
|
||||||
|
* \param[in] bufPayload: Payload buffer to display
|
||||||
|
* \param[in] suffix: String displayed after the buffer
|
||||||
|
*
|
||||||
|
* \return ERR_NONE if successful or a standard error code
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode ndefBufferPrint(const char* prefix, const ndefConstBuffer* bufPayload, const char* suffix);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* Dump a raw buffer stored in a ndefBuffer8
|
||||||
|
*
|
||||||
|
* This function dumps a raw buffer in a formatted style
|
||||||
|
*
|
||||||
|
* \param[in] prefix: String displayed before the buffer
|
||||||
|
* \param[in] bufPayload: Payload buffer to display
|
||||||
|
* \param[in] suffix: String displayed after the buffer
|
||||||
|
*
|
||||||
|
* \return ERR_NONE if successful or a standard error code
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode ndefBuffer8Print(const char* prefix, const ndefConstBuffer8* bufPayload, const char* suffix);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* NDEF_DUMP_H */
|
201
Software/Core/Inc/platform.h
Normal file
201
Software/Core/Inc/platform.h
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* http://www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author
|
||||||
|
*
|
||||||
|
* \brief Platform header file. Defining platform independent functionality.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PROJECT:
|
||||||
|
* $Revision: $
|
||||||
|
* LANGUAGE: ISO C99
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file platform.h
|
||||||
|
*
|
||||||
|
* \author Gustavo Patricio
|
||||||
|
*
|
||||||
|
* \brief Platform specific definition layer
|
||||||
|
*
|
||||||
|
* This should contain all platform and hardware specifics such as
|
||||||
|
* GPIO assignment, system resources, locks, IRQs, etc
|
||||||
|
*
|
||||||
|
* Each distinct platform/system/board must provide this definitions
|
||||||
|
* for all SW layers to use
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef PLATFORM_H
|
||||||
|
#define PLATFORM_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#ifdef STM32L476xx
|
||||||
|
#include "stm32l4xx_hal.h"
|
||||||
|
#else
|
||||||
|
#include "stm32f4xx_hal.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
|
#include "spi.h"
|
||||||
|
#include "timer.h"
|
||||||
|
#include "../../../../../../Downloads/STM32CubeExpansion_NFC5_V2.0.0 2/Projects/STM32F401RE-Nucleo/Applications/PollingTagDetect/Inc/main.h"
|
||||||
|
#include "logger.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#define ST25R391X_SS_PIN SPI1_CS_Pin /*!< GPIO pin used for ST25R3911 SPI SS */
|
||||||
|
#define ST25R391X_SS_PORT SPI1_CS_GPIO_Port /*!< GPIO port used for ST25R3911 SPI SS port */
|
||||||
|
|
||||||
|
#define ST25R391X_INT_PIN IRQ_3911_Pin /*!< GPIO pin used for ST25R3911 External Interrupt */
|
||||||
|
#define ST25R391X_INT_PORT IRQ_3911_GPIO_Port /*!< GPIO port used for ST25R3911 External Interrupt */
|
||||||
|
|
||||||
|
#ifdef LED_FIELD_Pin
|
||||||
|
#define PLATFORM_LED_FIELD_PIN LED_FIELD_Pin /*!< GPIO pin used as field LED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef LED_FIELD_GPIO_Port
|
||||||
|
#define PLATFORM_LED_FIELD_PORT LED_FIELD_GPIO_Port /*!< GPIO port used as field LED */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#define PLATFORM_LED_A_PIN LED_A_Pin /*!< GPIO pin used for LED A */
|
||||||
|
#define PLATFORM_LED_A_PORT LED_A_GPIO_Port /*!< GPIO port used for LED A */
|
||||||
|
#define PLATFORM_LED_B_PIN LED_B_Pin /*!< GPIO pin used for LED B */
|
||||||
|
#define PLATFORM_LED_B_PORT LED_B_GPIO_Port /*!< GPIO port used for LED B */
|
||||||
|
#define PLATFORM_LED_F_PIN LED_F_Pin /*!< GPIO pin used for LED F */
|
||||||
|
#define PLATFORM_LED_F_PORT LED_F_GPIO_Port /*!< GPIO port used for LED F */
|
||||||
|
#define PLATFORM_LED_V_PIN LED_V_Pin /*!< GPIO pin used for LED V */
|
||||||
|
#define PLATFORM_LED_V_PORT LED_V_GPIO_Port /*!< GPIO port used for LED V */
|
||||||
|
#define PLATFORM_LED_AP2P_PIN LED_AP2P_Pin /*!< GPIO pin used for LED AP2P */
|
||||||
|
#define PLATFORM_LED_AP2P_PORT LED_AP2P_GPIO_Port /*!< GPIO port used for LED AP2P*/
|
||||||
|
|
||||||
|
#define PLATFORM_USER_BUTTON_PIN B1_Pin /*!< GPIO pin user button */
|
||||||
|
#define PLATFORM_USER_BUTTON_PORT B1_GPIO_Port /*!< GPIO port user button */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL MACROS
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#define platformProtectST25R391xComm() do{ globalCommProtectCnt++; __DSB();NVIC_DisableIRQ(EXTI0_IRQn);__DSB();__ISB();}while(0) /*!< Protect unique access to ST25R391x communication channel - IRQ disable on single thread environment (MCU) ; Mutex lock on a multi thread environment */
|
||||||
|
#define platformUnprotectST25R391xComm() do{ if (--globalCommProtectCnt==0U) {NVIC_EnableIRQ(EXTI0_IRQn);} }while(0) /*!< Unprotect unique access to ST25R391x communication channel - IRQ enable on a single thread environment (MCU) ; Mutex unlock on a multi thread environment */
|
||||||
|
|
||||||
|
#define platformProtectST25R391xIrqStatus() platformProtectST25R391xComm() /*!< Protect unique access to IRQ status var - IRQ disable on single thread environment (MCU) ; Mutex lock on a multi thread environment */
|
||||||
|
#define platformUnprotectST25R391xIrqStatus() platformUnprotectST25R391xComm() /*!< Unprotect the IRQ status var - IRQ enable on a single thread environment (MCU) ; Mutex unlock on a multi thread environment */
|
||||||
|
|
||||||
|
#define platformProtectWorker() /* Protect RFAL Worker/Task/Process from concurrent execution on multi thread platforms */
|
||||||
|
#define platformUnprotectWorker() /* Unprotect RFAL Worker/Task/Process from concurrent execution on multi thread platforms */
|
||||||
|
|
||||||
|
|
||||||
|
#define platformIrqST25R3911SetCallback( cb )
|
||||||
|
#define platformIrqST25R3911PinInitialize()
|
||||||
|
|
||||||
|
#define platformIrqST25R3916SetCallback( cb )
|
||||||
|
#define platformIrqST25R3916PinInitialize()
|
||||||
|
|
||||||
|
|
||||||
|
#define platformLedsInitialize() /*!< Initializes the pins used as LEDs to outputs*/
|
||||||
|
|
||||||
|
#define platformLedOff( port, pin ) platformGpioClear((port), (pin)) /*!< Turns the given LED Off */
|
||||||
|
#define platformLedOn( port, pin ) platformGpioSet((port), (pin)) /*!< Turns the given LED On */
|
||||||
|
#define platformLedToogle( port, pin ) platformGpioToogle((port), (pin)) /*!< Toogle the given LED */
|
||||||
|
|
||||||
|
#define platformGpioSet( port, pin ) HAL_GPIO_WritePin(port, pin, GPIO_PIN_SET) /*!< Turns the given GPIO High */
|
||||||
|
#define platformGpioClear( port, pin ) HAL_GPIO_WritePin(port, pin, GPIO_PIN_RESET) /*!< Turns the given GPIO Low */
|
||||||
|
#define platformGpioToogle( port, pin ) HAL_GPIO_TogglePin(port, pin) /*!< Toogles the given GPIO */
|
||||||
|
#define platformGpioIsHigh( port, pin ) (HAL_GPIO_ReadPin(port, pin) == GPIO_PIN_SET) /*!< Checks if the given LED is High */
|
||||||
|
#define platformGpioIsLow( port, pin ) (!platformGpioIsHigh(port, pin)) /*!< Checks if the given LED is Low */
|
||||||
|
|
||||||
|
#define platformTimerCreate( t ) timerCalculateTimer(t) /*!< Create a timer with the given time (ms) */
|
||||||
|
#define platformTimerIsExpired( timer ) timerIsExpired(timer) /*!< Checks if the given timer is expired */
|
||||||
|
#define platformDelay( t ) HAL_Delay( t ) /*!< Performs a delay for the given time (ms) */
|
||||||
|
|
||||||
|
#define platformGetSysTick() HAL_GetTick() /*!< Get System Tick ( 1 tick = 1 ms) */
|
||||||
|
|
||||||
|
#define platformSpiSelect() platformGpioClear( ST25R391X_SS_PORT, ST25R391X_SS_PIN ) /*!< SPI SS\CS: Chip|Slave Select */
|
||||||
|
#define platformSpiDeselect() platformGpioSet( ST25R391X_SS_PORT, ST25R391X_SS_PIN ) /*!< SPI SS\CS: Chip|Slave Deselect */
|
||||||
|
#define platformSpiTxRx( txBuf, rxBuf, len ) spiTxRx( (txBuf), (rxBuf), (len) ) /*!< SPI transceive */
|
||||||
|
|
||||||
|
|
||||||
|
#define platformI2CTx( txBuf, len ) /*!< I2C Transmit */
|
||||||
|
#define platformI2CRx( txBuf, len ) /*!< I2C Receive */
|
||||||
|
#define platformI2CStart() /*!< I2C Start condition */
|
||||||
|
#define platformI2CStop() /*!< I2C Stop condition */
|
||||||
|
#define platformI2CRepeatStart() /*!< I2C Repeat Start */
|
||||||
|
#define platformI2CSlaveAddrWR(add) /*!< I2C Slave address for Write operation */
|
||||||
|
#define platformI2CSlaveAddrRD(add) /*!< I2C Slave address for Read operation */
|
||||||
|
|
||||||
|
#define platformLog(...) logUsart(__VA_ARGS__) /*!< Log method */
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL VARIABLES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
extern uint8_t globalCommProtectCnt; /* Global Protection Counter provided per platform - instantiated in main.c */
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* RFAL FEATURES CONFIGURATION
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define RFAL_FEATURE_LISTEN_MODE false /*!< Enable/Disable RFAL support for Listen Mode */
|
||||||
|
#define RFAL_FEATURE_WAKEUP_MODE true /*!< Enable/Disable RFAL support for the Wake-Up mode */
|
||||||
|
#define RFAL_FEATURE_NFCA true /*!< Enable/Disable RFAL support for NFC-A (ISO14443A) */
|
||||||
|
#define RFAL_FEATURE_NFCB true /*!< Enable/Disable RFAL support for NFC-B (ISO14443B) */
|
||||||
|
#define RFAL_FEATURE_NFCF true /*!< Enable/Disable RFAL support for NFC-F (FeliCa) */
|
||||||
|
#define RFAL_FEATURE_NFCV true /*!< Enable/Disable RFAL support for NFC-V (ISO15693) */
|
||||||
|
#define RFAL_FEATURE_T1T true /*!< Enable/Disable RFAL support for T1T (Topaz) */
|
||||||
|
#define RFAL_FEATURE_T2T true /*!< Enable/Disable RFAL support for T2T */
|
||||||
|
#define RFAL_FEATURE_T4T true /*!< Enable/Disable RFAL support for T4T */
|
||||||
|
#define RFAL_FEATURE_ST25TB true /*!< Enable/Disable RFAL support for ST25TB */
|
||||||
|
#define RFAL_FEATURE_ST25xV true /*!< Enable/Disable RFAL support for ST25TV/ST25DV */
|
||||||
|
#define RFAL_FEATURE_DYNAMIC_ANALOG_CONFIG false /*!< Enable/Disable Analog Configs to be dynamically updated (RAM) */
|
||||||
|
#define RFAL_FEATURE_DYNAMIC_POWER false /*!< Enable/Disable RFAL dynamic power support */
|
||||||
|
#define RFAL_FEATURE_ISO_DEP true /*!< Enable/Disable RFAL support for ISO-DEP (ISO14443-4) */
|
||||||
|
#define RFAL_FEATURE_ISO_DEP_POLL true /*!< Enable/Disable RFAL support for Poller mode (PCD) ISO-DEP (ISO14443-4) */
|
||||||
|
#define RFAL_FEATURE_ISO_DEP_LISTEN false /*!< Enable/Disable RFAL support for Listen mode (PICC) ISO-DEP (ISO14443-4) */
|
||||||
|
#define RFAL_FEATURE_NFC_DEP true /*!< Enable/Disable RFAL support for NFC-DEP (NFCIP1/P2P) */
|
||||||
|
|
||||||
|
|
||||||
|
#define RFAL_FEATURE_ISO_DEP_IBLOCK_MAX_LEN 256U /*!< ISO-DEP I-Block max length. Please use values as defined by rfalIsoDepFSx */
|
||||||
|
#define RFAL_FEATURE_ISO_DEP_APDU_MAX_LEN 1024U /*!< ISO-DEP APDU max length. Please use multiples of I-Block max length */
|
||||||
|
|
||||||
|
#endif /* PLATFORM_H */
|
||||||
|
|
||||||
|
|
104
Software/Core/Inc/spi.h
Normal file
104
Software/Core/Inc/spi.h
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* COPYRIGHT(c) 2016 STMicroelectronics
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author
|
||||||
|
*
|
||||||
|
* \brief SPI communication header file
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __spi_H
|
||||||
|
#define __spi_H
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "platform.h"
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Initalize SPI
|
||||||
|
*
|
||||||
|
* This function initalize the SPI handle.
|
||||||
|
*
|
||||||
|
* \param[in] hspi : pointer to initalized SPI block
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
void spiInit(SPI_HandleTypeDef *hspi);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Set SPI CS line
|
||||||
|
*
|
||||||
|
* \param[in] ssPort : pointer CS gpio port
|
||||||
|
*
|
||||||
|
* \param[in] ssPin : CS pin
|
||||||
|
*
|
||||||
|
* \return : none
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
void spiSelect(GPIO_TypeDef *ssPort, uint16_t ssPin);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Reset SPI CS line
|
||||||
|
*
|
||||||
|
* \param[in] ssPort : pointer CS gpio port
|
||||||
|
*
|
||||||
|
* \param[in] ssPin : CS pin
|
||||||
|
*
|
||||||
|
* \return : none
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
void spiDeselect(GPIO_TypeDef *ssPort, uint16_t ssPin);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Transmit Receive data
|
||||||
|
*
|
||||||
|
* This funtion transmits first no of "length" bytes from "txData" and tries
|
||||||
|
* then to receive "length" bytes.
|
||||||
|
*
|
||||||
|
* \param[in] txData : pointer to buffer to be transmitted.
|
||||||
|
*
|
||||||
|
* \param[out] rxData : pointer to buffer to be received.
|
||||||
|
*
|
||||||
|
* \param[in] length : buffer length
|
||||||
|
*
|
||||||
|
* \return : HAL error code
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
HAL_StatusTypeDef spiTxRx(const uint8_t *txData, uint8_t *rxData, uint16_t length);
|
||||||
|
|
||||||
|
#endif /*__spi_H */
|
||||||
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
359
Software/Core/Inc/stm32f3xx_hal_conf.h
Normal file
359
Software/Core/Inc/stm32f3xx_hal_conf.h
Normal file
@ -0,0 +1,359 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32f3xx_hal_conf.h
|
||||||
|
* @brief HAL configuration file.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2016 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __STM32F3xx_HAL_CONF_H
|
||||||
|
#define __STM32F3xx_HAL_CONF_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* ########################## Module Selection ############################## */
|
||||||
|
/**
|
||||||
|
* @brief This is the list of modules to be used in the HAL driver
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define HAL_MODULE_ENABLED
|
||||||
|
/*#define HAL_ADC_MODULE_ENABLED */
|
||||||
|
/*#define HAL_CRYP_MODULE_ENABLED */
|
||||||
|
/*#define HAL_CAN_MODULE_ENABLED */
|
||||||
|
/*#define HAL_CEC_MODULE_ENABLED */
|
||||||
|
/*#define HAL_NAND_MODULE_ENABLED */
|
||||||
|
/*#define HAL_NOR_MODULE_ENABLED */
|
||||||
|
/*#define HAL_PCCARD_MODULE_ENABLED */
|
||||||
|
/*#define HAL_SRAM_MODULE_ENABLED */
|
||||||
|
/*#define HAL_HRTIM_MODULE_ENABLED */
|
||||||
|
/*#define HAL_OPAMP_MODULE_ENABLED */
|
||||||
|
/*#define HAL_SDADC_MODULE_ENABLED */
|
||||||
|
/*#define HAL_TSC_MODULE_ENABLED */
|
||||||
|
/*#define HAL_COMP_MODULE_ENABLED */
|
||||||
|
/*#define HAL_CRC_MODULE_ENABLED */
|
||||||
|
/*#define HAL_CRYP_MODULE_ENABLED */
|
||||||
|
/*#define HAL_DAC_MODULE_ENABLED */
|
||||||
|
/*#define HAL_I2S_MODULE_ENABLED */
|
||||||
|
/*#define HAL_IWDG_MODULE_ENABLED */
|
||||||
|
/*#define HAL_LCD_MODULE_ENABLED */
|
||||||
|
/*#define HAL_LPTIM_MODULE_ENABLED */
|
||||||
|
/*#define HAL_RNG_MODULE_ENABLED */
|
||||||
|
/*#define HAL_RTC_MODULE_ENABLED */
|
||||||
|
#define HAL_SPI_MODULE_ENABLED
|
||||||
|
/*#define HAL_TIM_MODULE_ENABLED */
|
||||||
|
/*#define HAL_UART_MODULE_ENABLED */
|
||||||
|
/*#define HAL_USART_MODULE_ENABLED */
|
||||||
|
/*#define HAL_IRDA_MODULE_ENABLED */
|
||||||
|
/*#define HAL_SMARTCARD_MODULE_ENABLED */
|
||||||
|
/*#define HAL_SMBUS_MODULE_ENABLED */
|
||||||
|
/*#define HAL_WWDG_MODULE_ENABLED */
|
||||||
|
/*#define HAL_PCD_MODULE_ENABLED */
|
||||||
|
#define HAL_GPIO_MODULE_ENABLED
|
||||||
|
#define HAL_EXTI_MODULE_ENABLED
|
||||||
|
/* #define HAL_CAN_LEGACY_MODULE_ENABLED */
|
||||||
|
#define HAL_DMA_MODULE_ENABLED
|
||||||
|
#define HAL_RCC_MODULE_ENABLED
|
||||||
|
#define HAL_FLASH_MODULE_ENABLED
|
||||||
|
#define HAL_PWR_MODULE_ENABLED
|
||||||
|
#define HAL_CORTEX_MODULE_ENABLED
|
||||||
|
#define HAL_I2C_MODULE_ENABLED
|
||||||
|
/* ########################## HSE/HSI Values adaptation ##################### */
|
||||||
|
/**
|
||||||
|
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
||||||
|
* This value is used by the RCC HAL module to compute the system frequency
|
||||||
|
* (when HSE is used as system clock source, directly or through the PLL).
|
||||||
|
*/
|
||||||
|
#if !defined (HSE_VALUE)
|
||||||
|
#define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */
|
||||||
|
#endif /* HSE_VALUE */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief In the following line adjust the External High Speed oscillator (HSE) Startup
|
||||||
|
* Timeout value
|
||||||
|
*/
|
||||||
|
#if !defined (HSE_STARTUP_TIMEOUT)
|
||||||
|
#define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */
|
||||||
|
#endif /* HSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Internal High Speed oscillator (HSI) value.
|
||||||
|
* This value is used by the RCC HAL module to compute the system frequency
|
||||||
|
* (when HSI is used as system clock source, directly or through the PLL).
|
||||||
|
*/
|
||||||
|
#if !defined (HSI_VALUE)
|
||||||
|
#define HSI_VALUE ((uint32_t)8000000) /*!< Value of the Internal oscillator in Hz*/
|
||||||
|
#endif /* HSI_VALUE */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup
|
||||||
|
* Timeout value
|
||||||
|
*/
|
||||||
|
#if !defined (HSI_STARTUP_TIMEOUT)
|
||||||
|
#define HSI_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSI start up */
|
||||||
|
#endif /* HSI_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Internal Low Speed oscillator (LSI) value.
|
||||||
|
*/
|
||||||
|
#if !defined (LSI_VALUE)
|
||||||
|
#define LSI_VALUE ((uint32_t)40000)
|
||||||
|
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||||
|
The real value may vary depending on the variations
|
||||||
|
in voltage and temperature. */
|
||||||
|
/**
|
||||||
|
* @brief External Low Speed oscillator (LSE) value.
|
||||||
|
*/
|
||||||
|
#if !defined (LSE_VALUE)
|
||||||
|
#define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */
|
||||||
|
#endif /* LSE_VALUE */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Time out for LSE start up value in ms.
|
||||||
|
*/
|
||||||
|
#if !defined (LSE_STARTUP_TIMEOUT)
|
||||||
|
#define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */
|
||||||
|
#endif /* LSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief External clock source for I2S peripheral
|
||||||
|
* This value is used by the I2S HAL module to compute the I2S clock source
|
||||||
|
* frequency, this source is inserted directly through I2S_CKIN pad.
|
||||||
|
* - External clock generated through external PLL component on EVAL 303 (based on MCO or crystal)
|
||||||
|
* - External clock not generated on EVAL 373
|
||||||
|
*/
|
||||||
|
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||||
|
#define EXTERNAL_CLOCK_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz*/
|
||||||
|
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||||
|
|
||||||
|
/* Tip: To avoid modifying this file each time you need to use different HSE,
|
||||||
|
=== you can define the HSE value in your toolchain compiler preprocessor. */
|
||||||
|
|
||||||
|
/* ########################### System Configuration ######################### */
|
||||||
|
/**
|
||||||
|
* @brief This is the HAL system configuration section
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */
|
||||||
|
#define TICK_INT_PRIORITY ((uint32_t)0) /*!< tick interrupt priority (lowest by default) */
|
||||||
|
#define USE_RTOS 0
|
||||||
|
#define PREFETCH_ENABLE 1
|
||||||
|
#define INSTRUCTION_CACHE_ENABLE 0
|
||||||
|
#define DATA_CACHE_ENABLE 0
|
||||||
|
#define USE_SPI_CRC 0U
|
||||||
|
|
||||||
|
#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
|
||||||
|
#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
|
||||||
|
#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */
|
||||||
|
#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
|
||||||
|
#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
|
||||||
|
#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
|
||||||
|
#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
|
||||||
|
#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
|
||||||
|
#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
|
||||||
|
#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
|
||||||
|
#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */
|
||||||
|
#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
|
||||||
|
#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
|
||||||
|
#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
|
||||||
|
#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
|
||||||
|
#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
|
||||||
|
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
|
||||||
|
#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* OPAMP register callback disabled */
|
||||||
|
#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
|
||||||
|
#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
|
||||||
|
#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
|
||||||
|
#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
|
||||||
|
#define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */
|
||||||
|
#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
|
||||||
|
|
||||||
|
/* ########################## Assert Selection ############################## */
|
||||||
|
/**
|
||||||
|
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||||
|
* HAL drivers code
|
||||||
|
*/
|
||||||
|
/* #define USE_FULL_ASSERT 1U */
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
/**
|
||||||
|
* @brief Include module's header file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAL_RCC_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_rcc.h"
|
||||||
|
#endif /* HAL_RCC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_GPIO_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_gpio.h"
|
||||||
|
#endif /* HAL_GPIO_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_EXTI_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_exti.h"
|
||||||
|
#endif /* HAL_EXTI_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_DMA_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_dma.h"
|
||||||
|
#endif /* HAL_DMA_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_CORTEX_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_cortex.h"
|
||||||
|
#endif /* HAL_CORTEX_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_ADC_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_adc.h"
|
||||||
|
#endif /* HAL_ADC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_CAN_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_can.h"
|
||||||
|
#endif /* HAL_CAN_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_can_legacy.h"
|
||||||
|
#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_CEC_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_cec.h"
|
||||||
|
#endif /* HAL_CEC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_COMP_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_comp.h"
|
||||||
|
#endif /* HAL_COMP_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_CRC_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_crc.h"
|
||||||
|
#endif /* HAL_CRC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_DAC_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_dac.h"
|
||||||
|
#endif /* HAL_DAC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_FLASH_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_flash.h"
|
||||||
|
#endif /* HAL_FLASH_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SRAM_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_sram.h"
|
||||||
|
#endif /* HAL_SRAM_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_NOR_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_nor.h"
|
||||||
|
#endif /* HAL_NOR_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_NAND_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_nand.h"
|
||||||
|
#endif /* HAL_NAND_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_PCCARD_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_pccard.h"
|
||||||
|
#endif /* HAL_PCCARD_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_HRTIM_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_hrtim.h"
|
||||||
|
#endif /* HAL_HRTIM_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_I2C_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_i2c.h"
|
||||||
|
#endif /* HAL_I2C_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_I2S_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_i2s.h"
|
||||||
|
#endif /* HAL_I2S_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_IRDA_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_irda.h"
|
||||||
|
#endif /* HAL_IRDA_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_IWDG_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_iwdg.h"
|
||||||
|
#endif /* HAL_IWDG_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_OPAMP_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_opamp.h"
|
||||||
|
#endif /* HAL_OPAMP_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_PCD_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_pcd.h"
|
||||||
|
#endif /* HAL_PCD_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_PWR_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_pwr.h"
|
||||||
|
#endif /* HAL_PWR_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_RTC_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_rtc.h"
|
||||||
|
#endif /* HAL_RTC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SDADC_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_sdadc.h"
|
||||||
|
#endif /* HAL_SDADC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SMARTCARD_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_smartcard.h"
|
||||||
|
#endif /* HAL_SMARTCARD_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SMBUS_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_smbus.h"
|
||||||
|
#endif /* HAL_SMBUS_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SPI_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_spi.h"
|
||||||
|
#endif /* HAL_SPI_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_TIM_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_tim.h"
|
||||||
|
#endif /* HAL_TIM_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_TSC_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_tsc.h"
|
||||||
|
#endif /* HAL_TSC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_UART_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_uart.h"
|
||||||
|
#endif /* HAL_UART_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_USART_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_usart.h"
|
||||||
|
#endif /* HAL_USART_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_WWDG_MODULE_ENABLED
|
||||||
|
#include "stm32f3xx_hal_wwdg.h"
|
||||||
|
#endif /* HAL_WWDG_MODULE_ENABLED */
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
#ifdef USE_FULL_ASSERT
|
||||||
|
/**
|
||||||
|
* @brief The assert_param macro is used for function's parameters check.
|
||||||
|
* @param expr If expr is false, it calls assert_failed function
|
||||||
|
* which reports the name of the source file and the source
|
||||||
|
* line number of the call that failed.
|
||||||
|
* If expr is true, it returns no value.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||||
|
/* Exported functions ------------------------------------------------------- */
|
||||||
|
void assert_failed(uint8_t* file, uint32_t line);
|
||||||
|
#else
|
||||||
|
#define assert_param(expr) ((void)0U)
|
||||||
|
#endif /* USE_FULL_ASSERT */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __STM32F3xx_HAL_CONF_H */
|
66
Software/Core/Inc/stm32f3xx_it.h
Normal file
66
Software/Core/Inc/stm32f3xx_it.h
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32f3xx_it.h
|
||||||
|
* @brief This file contains the headers of the interrupt handlers.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __STM32F3xx_IT_H
|
||||||
|
#define __STM32F3xx_IT_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Private includes ----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN ET */
|
||||||
|
|
||||||
|
/* USER CODE END ET */
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EC */
|
||||||
|
|
||||||
|
/* USER CODE END EC */
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EM */
|
||||||
|
|
||||||
|
/* USER CODE END EM */
|
||||||
|
|
||||||
|
/* Exported functions prototypes ---------------------------------------------*/
|
||||||
|
void NMI_Handler(void);
|
||||||
|
void HardFault_Handler(void);
|
||||||
|
void MemManage_Handler(void);
|
||||||
|
void BusFault_Handler(void);
|
||||||
|
void UsageFault_Handler(void);
|
||||||
|
void SVC_Handler(void);
|
||||||
|
void DebugMon_Handler(void);
|
||||||
|
void PendSV_Handler(void);
|
||||||
|
void SysTick_Handler(void);
|
||||||
|
/* USER CODE BEGIN EFP */
|
||||||
|
|
||||||
|
/* USER CODE END EFP */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __STM32F3xx_IT_H */
|
64
Software/Core/Inc/usart.h
Normal file
64
Software/Core/Inc/usart.h
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* COPYRIGHT(c) 2016 STMicroelectronics
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author
|
||||||
|
*
|
||||||
|
* \brief UART communication header file
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __usart_H
|
||||||
|
#define __usart_H
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "platform.h"
|
||||||
|
|
||||||
|
void UsartInit(UART_HandleTypeDef *husart);
|
||||||
|
uint8_t UsartTxByte(uint8_t data);
|
||||||
|
uint8_t UsartTx(uint8_t *data, uint16_t dataLen);
|
||||||
|
uint8_t UsartRx(uint8_t *data, uint16_t *dataLen);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /*__usart_H */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
651
Software/Core/Src/demo.c
Normal file
651
Software/Core/Src/demo.c
Normal file
@ -0,0 +1,651 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* \attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2019 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author
|
||||||
|
*
|
||||||
|
* \brief Demo application
|
||||||
|
*
|
||||||
|
* This demo shows how to poll for several types of NFC cards/devices and how
|
||||||
|
* to exchange data with these devices, using the RFAL library.
|
||||||
|
*
|
||||||
|
* This demo does not fully implement the activities according to the standards,
|
||||||
|
* it performs the required to communicate with a card/device and retrieve
|
||||||
|
* its UID. Also blocking methods are used for data exchange which may lead to
|
||||||
|
* long periods of blocking CPU/MCU.
|
||||||
|
* For standard compliant example please refer to the Examples provided
|
||||||
|
* with the RFAL library.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#include "demo.h"
|
||||||
|
#include "utils.h"
|
||||||
|
#include "rfal_nfc.h"
|
||||||
|
|
||||||
|
#if defined(ST25R3916) && defined(RFAL_FEATURE_LISTEN_MODE)
|
||||||
|
#include "demo_ce.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Definition of possible states the demo state machine could have */
|
||||||
|
#define DEMO_ST_NOTINIT 0 /*!< Demo State: Not initialized */
|
||||||
|
#define DEMO_ST_START_DISCOVERY 1 /*!< Demo State: Start Discovery */
|
||||||
|
#define DEMO_ST_DISCOVERY 2 /*!< Demo State: Discovery */
|
||||||
|
|
||||||
|
#define DEMO_NFCV_BLOCK_LEN 4 /*!< NFCV Block len */
|
||||||
|
|
||||||
|
#define DEMO_NFCV_USE_SELECT_MODE false /*!< NFCV demonstrate select mode */
|
||||||
|
#define DEMO_NFCV_WRITE_TAG false /*!< NFCV demonstrate Write Single Block */
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL MACROS
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL VARIABLES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* P2P communication data */
|
||||||
|
static uint8_t NFCID3[] = {0x01, 0xFE, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A};
|
||||||
|
static uint8_t GB[] = {0x46, 0x66, 0x6d, 0x01, 0x01, 0x11, 0x02, 0x02, 0x07, 0x80, 0x03, 0x02, 0x00, 0x03, 0x04, 0x01, 0x32, 0x07, 0x01, 0x03};
|
||||||
|
|
||||||
|
/* APDUs communication data */
|
||||||
|
static uint8_t ndefSelectApp[] = { 0x00, 0xA4, 0x04, 0x00, 0x07, 0xD2, 0x76, 0x00, 0x00, 0x85, 0x01, 0x01, 0x00 };
|
||||||
|
static uint8_t ccSelectFile[] = { 0x00, 0xA4, 0x00, 0x0C, 0x02, 0xE1, 0x03};
|
||||||
|
static uint8_t readBynary[] = { 0x00, 0xB0, 0x00, 0x00, 0x0F };
|
||||||
|
/*static uint8_t ppseSelectApp[] = { 0x00, 0xA4, 0x04, 0x00, 0x0E, 0x32, 0x50, 0x41, 0x59, 0x2E, 0x53, 0x59, 0x53, 0x2E, 0x44, 0x44, 0x46, 0x30, 0x31, 0x00 };*/
|
||||||
|
|
||||||
|
/* P2P communication data */
|
||||||
|
static uint8_t ndefLLCPSYMM[] = {0x00, 0x00};
|
||||||
|
static uint8_t ndefInit[] = {0x05, 0x20, 0x06, 0x0F, 0x75, 0x72, 0x6E, 0x3A, 0x6E, 0x66, 0x63, 0x3A, 0x73, 0x6E, 0x3A, 0x73, 0x6E, 0x65, 0x70, 0x02, 0x02, 0x07, 0x80, 0x05, 0x01, 0x02};
|
||||||
|
static uint8_t ndefUriSTcom[] = {0x13, 0x20, 0x00, 0x10, 0x02, 0x00, 0x00, 0x00, 0x19, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x12, 0x55, 0x00, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x74, 0x2e, 0x63, 0x6f, 0x6d};
|
||||||
|
|
||||||
|
#if defined(ST25R3916) && defined(RFAL_FEATURE_LISTEN_MODE)
|
||||||
|
/* NFC-A CE config */
|
||||||
|
static uint8_t ceNFCA_NFCID[] = {0x02, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66}; /* NFCID / UID (7 bytes) */
|
||||||
|
static uint8_t ceNFCA_SENS_RES[] = {0x44, 0x00}; /* SENS_RES / ATQA */
|
||||||
|
static uint8_t ceNFCA_SEL_RES = 0x20; /* SEL_RES / SAK */
|
||||||
|
|
||||||
|
/* NFC-F CE config */
|
||||||
|
static uint8_t ceNFCF_nfcid2[] = {0x02, 0xFE, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66};
|
||||||
|
static uint8_t ceNFCF_SC[] = {0x12, 0xFC};
|
||||||
|
static uint8_t ceNFCF_SENSF_RES[] = {0x01, /* SENSF_RES */
|
||||||
|
0x02, 0xFE, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, /* NFCID2 */
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x00, /* PAD0, PAD01, MRTIcheck, MRTIupdate, PAD2 */
|
||||||
|
0x00, 0x00 }; /* RD */
|
||||||
|
#endif /* RFAL_FEATURE_LISTEN_MODE */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL VARIABLES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
static rfalNfcDiscoverParam discParam;
|
||||||
|
static uint8_t state = DEMO_ST_NOTINIT;
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL FUNCTION PROTOTYPES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void demoP2P( void );
|
||||||
|
static void demoAPDU( void );
|
||||||
|
static void demoNfcv( rfalNfcvListenDevice *nfcvDev );
|
||||||
|
static void demoNfcf( rfalNfcfListenDevice *nfcfDev );
|
||||||
|
static void demoCE( rfalNfcDevice *nfcDev );
|
||||||
|
static void demoNotif( rfalNfcState st );
|
||||||
|
ReturnCode demoTransceiveBlocking( uint8_t *txBuf, uint16_t txBufSize, uint8_t **rxBuf, uint16_t **rcvLen, uint32_t fwt );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Demo Notification
|
||||||
|
*
|
||||||
|
* This function receives the event notifications from RFAL
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
static void demoNotif( rfalNfcState st )
|
||||||
|
{
|
||||||
|
uint8_t devCnt;
|
||||||
|
rfalNfcDevice *dev;
|
||||||
|
|
||||||
|
|
||||||
|
if( st == RFAL_NFC_STATE_WAKEUP_MODE )
|
||||||
|
{
|
||||||
|
platformLog("Wake Up mode started \r\n");
|
||||||
|
}
|
||||||
|
else if( st == RFAL_NFC_STATE_POLL_TECHDETECT )
|
||||||
|
{
|
||||||
|
platformLog("Wake Up mode terminated. Polling for devices \r\n");
|
||||||
|
}
|
||||||
|
else if( st == RFAL_NFC_STATE_POLL_SELECT )
|
||||||
|
{
|
||||||
|
/* Multiple devices were found, activate first of them */
|
||||||
|
rfalNfcGetDevicesFound( &dev, &devCnt );
|
||||||
|
rfalNfcSelect( 0 );
|
||||||
|
|
||||||
|
platformLog("Multiple Tags detected: %d \r\n", devCnt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Demo Ini
|
||||||
|
*
|
||||||
|
* This function Initializes the required layers for the demo
|
||||||
|
*
|
||||||
|
* \return true : Initialization ok
|
||||||
|
* \return false : Initialization failed
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
bool demoIni( void )
|
||||||
|
{
|
||||||
|
ReturnCode err;
|
||||||
|
|
||||||
|
err = rfalNfcInitialize();
|
||||||
|
if( err == ERR_NONE )
|
||||||
|
{
|
||||||
|
discParam.compMode = RFAL_COMPLIANCE_MODE_NFC;
|
||||||
|
discParam.devLimit = 1U;
|
||||||
|
discParam.nfcfBR = RFAL_BR_212;
|
||||||
|
discParam.ap2pBR = RFAL_BR_424;
|
||||||
|
|
||||||
|
ST_MEMCPY( &discParam.nfcid3, NFCID3, sizeof(NFCID3) );
|
||||||
|
ST_MEMCPY( &discParam.GB, GB, sizeof(GB) );
|
||||||
|
discParam.GBLen = sizeof(GB);
|
||||||
|
|
||||||
|
discParam.notifyCb = demoNotif;
|
||||||
|
discParam.totalDuration = 1000U;
|
||||||
|
discParam.wakeupEnabled = false;
|
||||||
|
discParam.wakeupConfigDefault = true;
|
||||||
|
discParam.techs2Find = ( RFAL_NFC_POLL_TECH_A | RFAL_NFC_POLL_TECH_B | RFAL_NFC_POLL_TECH_F | RFAL_NFC_POLL_TECH_V | RFAL_NFC_POLL_TECH_ST25TB );
|
||||||
|
|
||||||
|
#if defined(ST25R3911) || defined(ST25R3916)
|
||||||
|
discParam.techs2Find |= RFAL_NFC_POLL_TECH_AP2P;
|
||||||
|
#endif /* ST25R95 */
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(ST25R3916)
|
||||||
|
|
||||||
|
/* Set configuration for NFC-A CE */
|
||||||
|
ST_MEMCPY( discParam.lmConfigPA.SENS_RES, ceNFCA_SENS_RES, RFAL_LM_SENS_RES_LEN ); /* Set SENS_RES / ATQA */
|
||||||
|
ST_MEMCPY( discParam.lmConfigPA.nfcid, ceNFCA_NFCID, RFAL_NFCID2_LEN ); /* Set NFCID / UID */
|
||||||
|
discParam.lmConfigPA.nfcidLen = RFAL_LM_NFCID_LEN_07; /* Set NFCID length to 7 bytes */
|
||||||
|
discParam.lmConfigPA.SEL_RES = ceNFCA_SEL_RES; /* Set SEL_RES / SAK */
|
||||||
|
|
||||||
|
/* Set configuration for NFC-F CE */
|
||||||
|
ST_MEMCPY( discParam.lmConfigPF.SC, ceNFCF_SC, RFAL_LM_SENSF_SC_LEN ); /* Set System Code */
|
||||||
|
ST_MEMCPY( &ceNFCF_SENSF_RES[RFAL_NFCF_LENGTH_LEN], ceNFCF_nfcid2, RFAL_LM_SENSF_RES_LEN ); /* Load NFCID2 on SENSF_RES */
|
||||||
|
ST_MEMCPY( discParam.lmConfigPF.SENSF_RES, ceNFCF_SENSF_RES, RFAL_LM_SENSF_RES_LEN ); /* Set SENSF_RES / Poll Response */
|
||||||
|
|
||||||
|
discParam.techs2Find |= ( RFAL_NFC_LISTEN_TECH_A | RFAL_NFC_LISTEN_TECH_F );
|
||||||
|
|
||||||
|
#endif /* ST25R95 */
|
||||||
|
|
||||||
|
state = DEMO_ST_START_DISCOVERY;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Demo Cycle
|
||||||
|
*
|
||||||
|
* This function executes the demo state machine.
|
||||||
|
* It must be called periodically
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
void demoCycle( void )
|
||||||
|
{
|
||||||
|
static rfalNfcDevice *nfcDevice;
|
||||||
|
|
||||||
|
rfalNfcWorker(); /* Run RFAL worker periodically */
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* Check if USER button is pressed */
|
||||||
|
if( platformGpioIsLow(PLATFORM_USER_BUTTON_PORT, PLATFORM_USER_BUTTON_PIN))
|
||||||
|
{
|
||||||
|
discParam.wakeupEnabled = !discParam.wakeupEnabled; /* enable/disable wakeup */
|
||||||
|
state = DEMO_ST_START_DISCOVERY; /* restart loop */
|
||||||
|
platformLog("Toggling Wake Up mode %s\r\n", discParam.wakeupEnabled ? "ON": "OFF");
|
||||||
|
|
||||||
|
/* Debounce button */
|
||||||
|
while( platformGpioIsLow(PLATFORM_USER_BUTTON_PORT, PLATFORM_USER_BUTTON_PIN) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
switch( state )
|
||||||
|
{
|
||||||
|
/*******************************************************************************/
|
||||||
|
case DEMO_ST_START_DISCOVERY:
|
||||||
|
|
||||||
|
platformLedOff(PLATFORM_LED_A_PORT, PLATFORM_LED_A_PIN);
|
||||||
|
platformLedOff(PLATFORM_LED_B_PORT, PLATFORM_LED_B_PIN);
|
||||||
|
platformLedOff(PLATFORM_LED_F_PORT, PLATFORM_LED_F_PIN);
|
||||||
|
platformLedOff(PLATFORM_LED_V_PORT, PLATFORM_LED_V_PIN);
|
||||||
|
platformLedOff(PLATFORM_LED_AP2P_PORT, PLATFORM_LED_AP2P_PIN);
|
||||||
|
platformLedOff(PLATFORM_LED_FIELD_PORT, PLATFORM_LED_FIELD_PIN);
|
||||||
|
|
||||||
|
rfalNfcDeactivate( false );
|
||||||
|
rfalNfcDiscover( &discParam );
|
||||||
|
|
||||||
|
state = DEMO_ST_DISCOVERY;
|
||||||
|
break;
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
case DEMO_ST_DISCOVERY:
|
||||||
|
|
||||||
|
if( rfalNfcIsDevActivated( rfalNfcGetState() ) )
|
||||||
|
{
|
||||||
|
rfalNfcGetActiveDevice( &nfcDevice );
|
||||||
|
|
||||||
|
switch( nfcDevice->type )
|
||||||
|
{
|
||||||
|
/*******************************************************************************/
|
||||||
|
case RFAL_NFC_LISTEN_TYPE_NFCA:
|
||||||
|
|
||||||
|
platformLedOn(PLATFORM_LED_A_PORT, PLATFORM_LED_A_PIN);
|
||||||
|
switch( nfcDevice->dev.nfca.type )
|
||||||
|
{
|
||||||
|
case RFAL_NFCA_T1T:
|
||||||
|
platformLog("ISO14443A/Topaz (NFC-A T1T) TAG found. UID: %s\r\n", hex2Str( nfcDevice->nfcid, nfcDevice->nfcidLen ) );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RFAL_NFCA_T4T:
|
||||||
|
platformLog("NFCA Passive ISO-DEP device found. UID: %s\r\n", hex2Str( nfcDevice->nfcid, nfcDevice->nfcidLen ) );
|
||||||
|
|
||||||
|
demoAPDU();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RFAL_NFCA_T4T_NFCDEP:
|
||||||
|
case RFAL_NFCA_NFCDEP:
|
||||||
|
platformLog("NFCA Passive P2P device found. NFCID: %s\r\n", hex2Str( nfcDevice->nfcid, nfcDevice->nfcidLen ) );
|
||||||
|
|
||||||
|
demoP2P();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
platformLog("ISO14443A/NFC-A card found. UID: %s\r\n", hex2Str( nfcDevice->nfcid, nfcDevice->nfcidLen ) );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
case RFAL_NFC_LISTEN_TYPE_NFCB:
|
||||||
|
|
||||||
|
platformLog("ISO14443B/NFC-B card found. UID: %s\r\n", hex2Str( nfcDevice->nfcid, nfcDevice->nfcidLen ) );
|
||||||
|
platformLedOn(PLATFORM_LED_B_PORT, PLATFORM_LED_B_PIN);
|
||||||
|
|
||||||
|
if( rfalNfcbIsIsoDepSupported( &nfcDevice->dev.nfcb ) )
|
||||||
|
{
|
||||||
|
demoAPDU();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
case RFAL_NFC_LISTEN_TYPE_NFCF:
|
||||||
|
|
||||||
|
if( rfalNfcfIsNfcDepSupported( &nfcDevice->dev.nfcf ) )
|
||||||
|
{
|
||||||
|
platformLog("NFCF Passive P2P device found. NFCID: %s\r\n", hex2Str( nfcDevice->nfcid, nfcDevice->nfcidLen ) );
|
||||||
|
demoP2P();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
platformLog("Felica/NFC-F card found. UID: %s\r\n", hex2Str( nfcDevice->nfcid, nfcDevice->nfcidLen ));
|
||||||
|
|
||||||
|
demoNfcf( &nfcDevice->dev.nfcf );
|
||||||
|
}
|
||||||
|
|
||||||
|
platformLedOn(PLATFORM_LED_F_PORT, PLATFORM_LED_F_PIN);
|
||||||
|
break;
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
case RFAL_NFC_LISTEN_TYPE_NFCV:
|
||||||
|
{
|
||||||
|
uint8_t devUID[RFAL_NFCV_UID_LEN];
|
||||||
|
|
||||||
|
ST_MEMCPY( devUID, nfcDevice->nfcid, nfcDevice->nfcidLen ); /* Copy the UID into local var */
|
||||||
|
REVERSE_BYTES( devUID, RFAL_NFCV_UID_LEN ); /* Reverse the UID for display purposes */
|
||||||
|
platformLog("ISO15693/NFC-V card found. UID: %s\r\n", hex2Str(devUID, RFAL_NFCV_UID_LEN));
|
||||||
|
|
||||||
|
platformLedOn(PLATFORM_LED_V_PORT, PLATFORM_LED_V_PIN);
|
||||||
|
|
||||||
|
demoNfcv( &nfcDevice->dev.nfcv );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
case RFAL_NFC_LISTEN_TYPE_ST25TB:
|
||||||
|
|
||||||
|
platformLog("ST25TB card found. UID: %s\r\n", hex2Str( nfcDevice->nfcid, nfcDevice->nfcidLen ));
|
||||||
|
platformLedOn(PLATFORM_LED_B_PORT, PLATFORM_LED_B_PIN);
|
||||||
|
break;
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
case RFAL_NFC_LISTEN_TYPE_AP2P:
|
||||||
|
|
||||||
|
platformLog("NFC Active P2P device found. NFCID3: %s\r\n", hex2Str(nfcDevice->nfcid, nfcDevice->nfcidLen));
|
||||||
|
platformLedOn(PLATFORM_LED_AP2P_PORT, PLATFORM_LED_AP2P_PIN);
|
||||||
|
|
||||||
|
demoP2P();
|
||||||
|
break;
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
case RFAL_NFC_POLL_TYPE_NFCA:
|
||||||
|
case RFAL_NFC_POLL_TYPE_NFCF:
|
||||||
|
|
||||||
|
platformLog("Activated in CE %s mode.\r\n", (nfcDevice->type == RFAL_NFC_POLL_TYPE_NFCA) ? "NFC-A" : "NFC-F");
|
||||||
|
platformLedOn( ((nfcDevice->type == RFAL_NFC_POLL_TYPE_NFCA) ? PLATFORM_LED_A_PORT : PLATFORM_LED_F_PORT),
|
||||||
|
((nfcDevice->type == RFAL_NFC_POLL_TYPE_NFCA) ? PLATFORM_LED_A_PIN : PLATFORM_LED_F_PIN) );
|
||||||
|
|
||||||
|
demoCE( nfcDevice );
|
||||||
|
break;
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
rfalNfcDeactivate( false );
|
||||||
|
platformDelay( 500 );
|
||||||
|
state = DEMO_ST_START_DISCOVERY;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
case DEMO_ST_NOTINIT:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void demoCE( rfalNfcDevice *nfcDev )
|
||||||
|
{
|
||||||
|
#if defined(ST25R3916) && defined(RFAL_FEATURE_LISTEN_MODE)
|
||||||
|
|
||||||
|
ReturnCode err;
|
||||||
|
uint8_t *rxData;
|
||||||
|
uint16_t *rcvLen;
|
||||||
|
uint8_t txBuf[100];
|
||||||
|
uint16_t txLen;
|
||||||
|
|
||||||
|
demoCeInit( ceNFCF_nfcid2 );
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
rfalNfcWorker();
|
||||||
|
|
||||||
|
switch( rfalNfcGetState() )
|
||||||
|
{
|
||||||
|
case RFAL_NFC_STATE_ACTIVATED:
|
||||||
|
err = demoTransceiveBlocking( NULL, 0, &rxData, &rcvLen, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RFAL_NFC_STATE_DATAEXCHANGE:
|
||||||
|
case RFAL_NFC_STATE_DATAEXCHANGE_DONE:
|
||||||
|
|
||||||
|
txLen = ( (nfcDev->type == RFAL_NFC_POLL_TYPE_NFCA) ? demoCeT4T( rxData, *rcvLen, txBuf, sizeof(txBuf) ): demoCeT3T( rxData, *rcvLen, txBuf, sizeof(txBuf) ) );
|
||||||
|
err = demoTransceiveBlocking( txBuf, txLen, &rxData, &rcvLen, RFAL_FWT_NONE );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RFAL_NFC_STATE_LISTEN_SLEEP:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while( (err == ERR_NONE) || (err == ERR_SLEEP_REQ) );
|
||||||
|
|
||||||
|
#endif /* RFAL_FEATURE_LISTEN_MODE */
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Demo NFC-F
|
||||||
|
*
|
||||||
|
* Example how to exchange read and write blocks on a NFC-F tag
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
static void demoNfcf( rfalNfcfListenDevice *nfcfDev )
|
||||||
|
{
|
||||||
|
ReturnCode err;
|
||||||
|
uint8_t buf[ (RFAL_NFCF_NFCID2_LEN + RFAL_NFCF_CMD_LEN + (3*RFAL_NFCF_BLOCK_LEN)) ];
|
||||||
|
uint16_t rcvLen;
|
||||||
|
rfalNfcfServ srv = RFAL_NFCF_SERVICECODE_RDWR;
|
||||||
|
rfalNfcfBlockListElem bl[3];
|
||||||
|
rfalNfcfServBlockListParam servBlock;
|
||||||
|
//uint8_t wrData[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF };
|
||||||
|
|
||||||
|
servBlock.numServ = 1; /* Only one Service to be used */
|
||||||
|
servBlock.servList = &srv; /* Service Code: NDEF is Read/Writeable */
|
||||||
|
servBlock.numBlock = 1; /* Only one block to be used */
|
||||||
|
servBlock.blockList = bl;
|
||||||
|
bl[0].conf = RFAL_NFCF_BLOCKLISTELEM_LEN; /* Two-byte Block List Element */
|
||||||
|
bl[0].blockNum = 0x0001; /* Block: NDEF Data */
|
||||||
|
|
||||||
|
err = rfalNfcfPollerCheck( nfcfDev->sensfRes.NFCID2, &servBlock, buf, sizeof(buf), &rcvLen);
|
||||||
|
platformLog(" Check Block: %s Data: %s \r\n", (err != ERR_NONE) ? "FAIL": "OK", (err != ERR_NONE) ? "" : hex2Str( &buf[1], RFAL_NFCF_BLOCK_LEN) );
|
||||||
|
|
||||||
|
#if 0 /* Writing example */
|
||||||
|
err = rfalNfcfPollerUpdate( nfcfDev->sensfRes.NFCID2, &servBlock, buf , sizeof(buf), wrData, buf, sizeof(buf) );
|
||||||
|
platformLog(" Update Block: %s Data: %s \r\n", (err != ERR_NONE) ? "FAIL": "OK", (err != ERR_NONE) ? "" : hex2Str( wrData, RFAL_NFCF_BLOCK_LEN) );
|
||||||
|
err = rfalNfcfPollerCheck( nfcfDev->sensfRes.NFCID2, &servBlock, buf, sizeof(buf), &rcvLen);
|
||||||
|
platformLog(" Check Block: %s Data: %s \r\n", (err != ERR_NONE) ? "FAIL": "OK", (err != ERR_NONE) ? "" : hex2Str( &buf[1], RFAL_NFCF_BLOCK_LEN) );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Demo NFC-V Exchange
|
||||||
|
*
|
||||||
|
* Example how to exchange read and write blocks on a NFC-V tag
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
static void demoNfcv( rfalNfcvListenDevice *nfcvDev )
|
||||||
|
{
|
||||||
|
ReturnCode err;
|
||||||
|
uint16_t rcvLen;
|
||||||
|
uint8_t blockNum = 1;
|
||||||
|
uint8_t rxBuf[ 1 + DEMO_NFCV_BLOCK_LEN + RFAL_CRC_LEN ]; /* Flags + Block Data + CRC */
|
||||||
|
uint8_t * uid;
|
||||||
|
#if DEMO_NFCV_WRITE_TAG
|
||||||
|
uint8_t wrData[DEMO_NFCV_BLOCK_LEN] = { 0x11, 0x22, 0x33, 0x99 }; /* Write block example */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
uid = nfcvDev->InvRes.UID;
|
||||||
|
|
||||||
|
#if DEMO_NFCV_USE_SELECT_MODE
|
||||||
|
/*
|
||||||
|
* Activate selected state
|
||||||
|
*/
|
||||||
|
err = rfalNfcvPollerSelect(RFAL_NFCV_REQ_FLAG_DEFAULT, nfcvDev->InvRes.UID );
|
||||||
|
platformLog(" Select %s \r\n", (err != ERR_NONE) ? "FAIL (revert to addressed mode)": "OK" );
|
||||||
|
if( err == ERR_NONE )
|
||||||
|
{
|
||||||
|
uid = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read block using Read Single Block command
|
||||||
|
* with addressed mode (uid != NULL) or selected mode (uid == NULL)
|
||||||
|
*/
|
||||||
|
err = rfalNfcvPollerReadSingleBlock(RFAL_NFCV_REQ_FLAG_DEFAULT, uid, blockNum, rxBuf, sizeof(rxBuf), &rcvLen);
|
||||||
|
platformLog(" Read Block: %s %s\r\n", (err != ERR_NONE) ? "FAIL": "OK Data:", (err != ERR_NONE) ? "" : hex2Str( &rxBuf[1], DEMO_NFCV_BLOCK_LEN));
|
||||||
|
|
||||||
|
#if DEMO_NFCV_WRITE_TAG /* Writing example */
|
||||||
|
err = rfalNfcvPollerWriteSingleBlock(RFAL_NFCV_REQ_FLAG_DEFAULT, uid, blockNum, wrData, sizeof(wrData));
|
||||||
|
platformLog(" Write Block: %s Data: %s\r\n", (err != ERR_NONE) ? "FAIL": "OK", hex2Str( wrData, DEMO_NFCV_BLOCK_LEN) );
|
||||||
|
err = rfalNfcvPollerReadSingleBlock(RFAL_NFCV_REQ_FLAG_DEFAULT, uid, blockNum, rxBuf, sizeof(rxBuf), &rcvLen);
|
||||||
|
platformLog(" Read Block: %s %s\r\n", (err != ERR_NONE) ? "FAIL": "OK Data:", (err != ERR_NONE) ? "" : hex2Str( &rxBuf[1], DEMO_NFCV_BLOCK_LEN));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Demo P2P Exchange
|
||||||
|
*
|
||||||
|
* Sends a NDEF URI record 'http://www.ST.com' via NFC-DEP (P2P) protocol.
|
||||||
|
*
|
||||||
|
* This method sends a set of static predefined frames which tries to establish
|
||||||
|
* a LLCP connection, followed by the NDEF record, and then keeps sending
|
||||||
|
* LLCP SYMM packets to maintain the connection.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
void demoP2P( void )
|
||||||
|
{
|
||||||
|
uint16_t *rxLen;
|
||||||
|
uint8_t *rxData;
|
||||||
|
ReturnCode err;
|
||||||
|
|
||||||
|
platformLog(" Initalize device .. ");
|
||||||
|
err = demoTransceiveBlocking( ndefInit, sizeof(ndefInit), &rxData, &rxLen, RFAL_FWT_NONE);
|
||||||
|
if( err != ERR_NONE )
|
||||||
|
{
|
||||||
|
platformLog("failed.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
platformLog("succeeded.\r\n");
|
||||||
|
|
||||||
|
platformLog(" Push NDEF Uri: www.ST.com .. ");
|
||||||
|
err = demoTransceiveBlocking( ndefUriSTcom, sizeof(ndefUriSTcom), &rxData, &rxLen, RFAL_FWT_NONE);
|
||||||
|
if( err != ERR_NONE )
|
||||||
|
{
|
||||||
|
platformLog("failed.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
platformLog("succeeded.\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
platformLog(" Device present, maintaining connection ");
|
||||||
|
while(err == ERR_NONE)
|
||||||
|
{
|
||||||
|
err = demoTransceiveBlocking( ndefLLCPSYMM, sizeof(ndefLLCPSYMM), &rxData, &rxLen, RFAL_FWT_NONE);
|
||||||
|
platformLog(".");
|
||||||
|
platformDelay(50);
|
||||||
|
}
|
||||||
|
platformLog("\r\n Device removed.\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Demo APDUs Exchange
|
||||||
|
*
|
||||||
|
* Example how to exchange a set of predefined APDUs with PICC. The NDEF
|
||||||
|
* application will be selected and then CC will be selected and read.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
void demoAPDU( void )
|
||||||
|
{
|
||||||
|
ReturnCode err;
|
||||||
|
uint16_t *rxLen;
|
||||||
|
uint8_t *rxData;
|
||||||
|
|
||||||
|
|
||||||
|
/* Exchange APDU: NDEF Tag Application Select command */
|
||||||
|
err = demoTransceiveBlocking( ndefSelectApp, sizeof(ndefSelectApp), &rxData, &rxLen, RFAL_FWT_NONE );
|
||||||
|
platformLog(" Select NDEF Application: %s Data: %s\r\n", (err != ERR_NONE) ? "FAIL": "OK", hex2Str( rxData, *rxLen) );
|
||||||
|
|
||||||
|
if( (err == ERR_NONE) && rxData[0] == 0x90 && rxData[1] == 0x00)
|
||||||
|
{
|
||||||
|
/* Exchange APDU: Select Capability Container File */
|
||||||
|
err = demoTransceiveBlocking( ccSelectFile, sizeof(ccSelectFile), &rxData, &rxLen, RFAL_FWT_NONE );
|
||||||
|
platformLog(" Select CC: %s Data: %s\r\n", (err != ERR_NONE) ? "FAIL": "OK", hex2Str( rxData, *rxLen) );
|
||||||
|
|
||||||
|
/* Exchange APDU: Read Capability Container File */
|
||||||
|
err = demoTransceiveBlocking( readBynary, sizeof(readBynary), &rxData, &rxLen, RFAL_FWT_NONE );
|
||||||
|
platformLog(" Read CC: %s Data: %s\r\n", (err != ERR_NONE) ? "FAIL": "OK", hex2Str( rxData, *rxLen) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Demo Blocking Transceive
|
||||||
|
*
|
||||||
|
* Helper function to send data in a blocking manner via the rfalNfc module
|
||||||
|
*
|
||||||
|
* \warning A protocol transceive handles long timeouts (several seconds),
|
||||||
|
* transmission errors and retransmissions which may lead to a long period of
|
||||||
|
* time where the MCU/CPU is blocked in this method.
|
||||||
|
* This is a demo implementation, for a non-blocking usage example please
|
||||||
|
* refer to the Examples available with RFAL
|
||||||
|
*
|
||||||
|
* \param[in] txBuf : data to be transmitted
|
||||||
|
* \param[in] txBufSize : size of the data to be transmited
|
||||||
|
* \param[out] rxData : location where the received data has been placed
|
||||||
|
* \param[out] rcvLen : number of data bytes received
|
||||||
|
* \param[in] fwt : FWT to be used (only for RF frame interface,
|
||||||
|
* otherwise use RFAL_FWT_NONE)
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* \return ERR_PARAM : Invalid parameters
|
||||||
|
* \return ERR_TIMEOUT : Timeout error
|
||||||
|
* \return ERR_FRAMING : Framing error detected
|
||||||
|
* \return ERR_PROTO : Protocol error detected
|
||||||
|
* \return ERR_NONE : No error, activation successful
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode demoTransceiveBlocking( uint8_t *txBuf, uint16_t txBufSize, uint8_t **rxData, uint16_t **rcvLen, uint32_t fwt )
|
||||||
|
{
|
||||||
|
ReturnCode err;
|
||||||
|
|
||||||
|
err = rfalNfcDataExchangeStart( txBuf, txBufSize, rxData, rcvLen, fwt );
|
||||||
|
if( err == ERR_NONE )
|
||||||
|
{
|
||||||
|
do{
|
||||||
|
rfalNfcWorker();
|
||||||
|
err = rfalNfcDataExchangeGetStatus();
|
||||||
|
}
|
||||||
|
while( err == ERR_BUSY );
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
672
Software/Core/Src/demo_ce.c
Normal file
672
Software/Core/Src/demo_ce.c
Normal file
@ -0,0 +1,672 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file demo_ce.c
|
||||||
|
* @author MMY Application Team
|
||||||
|
* @brief Body function to manage card emul mode
|
||||||
|
******************************************************************************
|
||||||
|
** This notice applies to any and all portions of this file
|
||||||
|
* that are not between comment pairs USER CODE BEGIN and
|
||||||
|
* USER CODE END. Other portions of this file, whether
|
||||||
|
* inserted by the user or by software development tools
|
||||||
|
* are owned by their respective copyright owners.
|
||||||
|
*
|
||||||
|
* COPYRIGHT(c) 2018 STMicroelectronics
|
||||||
|
*
|
||||||
|
* 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 "demo_ce.h"
|
||||||
|
#include "utils.h"
|
||||||
|
#include "st_errno.h"
|
||||||
|
#include "rfal_rf.h"
|
||||||
|
#include "rfal_nfca.h"
|
||||||
|
#include "rfal_nfcf.h"
|
||||||
|
|
||||||
|
/** @addtogroup X-CUBE-NFC6_Applications
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup CardEmulation
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup CE_CardEmul
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
/** @defgroup CE_CardEmul_Private_Typedef
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
enum States
|
||||||
|
{
|
||||||
|
STATE_IDLE = 0, /*!< Emulated Tag state idle */
|
||||||
|
STATE_APP_SELECTED = 1, /*!< Emulated Tag state application selected */
|
||||||
|
STATE_CC_SELECTED = 2, /*!< Emulated Tag state CCFile selected */
|
||||||
|
STATE_FID_SELECTED = 3, /*!< Emulated Tag state FileID selected */
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private define ------------------------------------------------------------*/
|
||||||
|
/** @defgroup CE_CardEmul_Private_Define
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define NDEF_SIZE 0xFFFE /*!< Max NDEF size emulated */
|
||||||
|
#define T4T_CLA_00 0x00 /*!< CLA value for type 4 command */
|
||||||
|
#define T4T_INS_SELECT 0xA4 /*!< INS value for select command */
|
||||||
|
#define T4T_INS_READ 0xB0 /*!< INS value for reabbinary command */
|
||||||
|
#define T4T_INS_UPDATE 0xD6 /*!< INS value for update command */
|
||||||
|
#define FID_CC 0xE103 /*!< File ID number for CCFile */
|
||||||
|
#define FID_NDEF 0xE104 /*!< File ID number for NDEF file */
|
||||||
|
#define T3T_BLOCK_SIZE 0x10 /*!< Block size in Type 3 Tag */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private macro -------------------------------------------------------------*/
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/** @defgroup CE_CardEmul_Private_Variables
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
static uint8_t gNfcfNfcid[RFAL_NFCF_NFCID2_LEN];
|
||||||
|
static uint8_t ndefFile[2048]; /*!< Buffer to store NDEF File */
|
||||||
|
static int8_t nState = STATE_IDLE; /*!< Type 4 tag emulation status */
|
||||||
|
static int32_t nSelectedIdx = -1; /*!< current file selected */
|
||||||
|
static int32_t nFiles = 2; /*!< Number of file emulated */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CCLEN : Indicates the size of this CC File <BR>
|
||||||
|
* T4T_VNo : Indicates the Mapping Version <BR>
|
||||||
|
* MLe high : Max R-APDU size <BR>
|
||||||
|
* MLc high : Max C-APDU size <BR>
|
||||||
|
* NDEF FCI T: Indicates the NDEF-File_Ctrl_TLV <BR>
|
||||||
|
* NDEF FCI L: The length of the V-field <BR>
|
||||||
|
* NDEF FCI V1: NDEF File Identifier <BR>
|
||||||
|
* NDEF FCI V2: NDEF File size <BR>
|
||||||
|
* NDEF FCI V3: NDEF Read AC <BR>
|
||||||
|
* NDEF FCI V4: NDEF Write AC <BR>
|
||||||
|
*/
|
||||||
|
static uint8_t ccfile[] = {
|
||||||
|
0x00, 0x0F, /* CCLEN */
|
||||||
|
0x20, /* T4T_VNo */
|
||||||
|
0x00, 0x7F, /* MLe */
|
||||||
|
0x00, 0x7F, /* MLc */
|
||||||
|
0x04, /* T */
|
||||||
|
0x06, /* L */
|
||||||
|
(FID_NDEF & 0xFF00) >> 8, (FID_NDEF & 0x00FF), /* V1 */
|
||||||
|
(NDEF_SIZE & 0xFF00) >> 8, (NDEF_SIZE & 0x00FF), /* V2 */
|
||||||
|
0x00, /* V3 */
|
||||||
|
0x00 /* V4 */
|
||||||
|
};
|
||||||
|
|
||||||
|
static uint32_t pdwFileSize[] = {sizeof(ccfile), NDEF_SIZE}; /*!< Current emulated files size */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NDEF length <BR>
|
||||||
|
* NDEF Header: MB,ME,SR,Well known Type <BR>
|
||||||
|
* NDEF type length <BR>
|
||||||
|
* NDEF payload length <BR>
|
||||||
|
* NDEF Type : URI <BR>
|
||||||
|
* NDEF URI abreviation field : http://www. <BR>
|
||||||
|
* NDEF URI string : st.com/st25r <BR>
|
||||||
|
* NDEF URI string : st.com/st25-demo <BR>
|
||||||
|
*/
|
||||||
|
static const uint8_t ndef_uri[] = { 0x00, 0x15, /* NDEF length */
|
||||||
|
0xD1, /* NDEF Header */
|
||||||
|
0x01, /* NDEF type length */
|
||||||
|
0x11, /* NDEF payload length */
|
||||||
|
0x55, /* NDEF Type */
|
||||||
|
0x01, /* NDEF URI abreviation field */
|
||||||
|
0x73, 0x74, 0x2E, 0x63, 0x6F, /* NDEF URI string */
|
||||||
|
0x6D, 0x2F, 0x73, 0x74, 0x32,
|
||||||
|
0x35, 0x2D, 0x64, 0x65, 0x6D, 0x6F };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ver : Indicates the NDEF mapping versiom <BR>
|
||||||
|
* Nbr : Indicates the number of blocks that can be read <BR>
|
||||||
|
* Nbw : Indicates the number of blocks that can be written <BR>
|
||||||
|
* NmaxB : Indicates the maximum number of blocks available for NDEF data <BR>
|
||||||
|
* WriteFlag : Indicates whether a previous NDEF write procedure has finished or not <BR>
|
||||||
|
* RWFlag : Indicates data can be updated or not <BR>
|
||||||
|
* Ln : Is the size of the actual stored NDEF data in bytes <BR>
|
||||||
|
* Checksum : allows the Reader/Writer to check whether the Attribute Data are correct <BR>
|
||||||
|
*/
|
||||||
|
static uint8_t InformationBlock[] = { 0x10, /* Ver */
|
||||||
|
0x0F, /* Nbr */
|
||||||
|
0x0D, /* Nbw */
|
||||||
|
0x00, 0x0F, /* NmaxB */
|
||||||
|
0x00, 0x00, 0x00, 0x00, /* RFU */
|
||||||
|
0x00, /* WriteFlag */
|
||||||
|
0x01, /* RWFlag */
|
||||||
|
0x00, 0x00, 0x15, /* Ln */
|
||||||
|
0x00, 0x51 /* Checksum */
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
/** @defgroup CE_CardEmul_Private_Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
*****************************************************************************
|
||||||
|
* @brief Compare 2 commands supplied in parameters
|
||||||
|
*
|
||||||
|
* @param[in] cmd : pointer to the received command.
|
||||||
|
* @param[in] find : pointer to the avalaible command.
|
||||||
|
* @param[in] len : length of the available command.
|
||||||
|
*
|
||||||
|
* @retval True : Same command.
|
||||||
|
* @retval False : Different command.
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
static bool cmdCompare(uint8_t *cmd, uint8_t *find, uint16_t len)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < 20; i++)
|
||||||
|
{
|
||||||
|
if(!memcmp(&cmd[i],find, len))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*****************************************************************************
|
||||||
|
* @brief Manage the T4T Select answer to the reader
|
||||||
|
*
|
||||||
|
* @param[in] cmdData : pointer to the received command.
|
||||||
|
* @param[out] rspData : pointer to the answer to send.
|
||||||
|
*
|
||||||
|
* @return Answer size.
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
static uint16_t demoCeT4TSelect(uint8_t *cmdData, uint8_t *rspData)
|
||||||
|
{
|
||||||
|
bool success = false;
|
||||||
|
/*
|
||||||
|
* Cmd: CLA(1) | INS(1) | P1(1) | P2(1) | Lc(1) | Data(n) | [Le(1)]
|
||||||
|
* Rsp: [FCI(n)] | SW12
|
||||||
|
*
|
||||||
|
* Select App by Name NDEF: 00 A4 04 00 07 D2 76 00 00 85 01 01 00
|
||||||
|
* Select App by Name NDEF 4 ST: 00 A4 04 00 07 A0 00 00 00 03 00 00 00
|
||||||
|
* Select CC FID: 00 A4 00 0C 02 xx xx
|
||||||
|
* Select NDEF FID: 00 A4 00 0C 02 xx xx
|
||||||
|
*/
|
||||||
|
|
||||||
|
uint8_t aid[] = {0xD2, 0x76, 0x00, 0x00, 0x85, 0x01, 0x01};
|
||||||
|
uint8_t fidCC[] = {FID_CC >> 8 , FID_CC & 0xFF};
|
||||||
|
uint8_t fidNDEF[] = {FID_NDEF >> 8, FID_NDEF & 0xFF};
|
||||||
|
uint8_t selectFileId[] = {0xA4, 0x00, 0x0C, 0x02, 0x00, 0x01 };
|
||||||
|
|
||||||
|
if(cmdCompare( cmdData, aid, sizeof(aid)))
|
||||||
|
{ /* Select Appli */
|
||||||
|
nState = STATE_APP_SELECTED;
|
||||||
|
success = true;
|
||||||
|
}
|
||||||
|
else if((nState >= STATE_APP_SELECTED) && cmdCompare(cmdData, fidCC, sizeof(fidCC)))
|
||||||
|
{ /* Select CC */
|
||||||
|
nState = STATE_CC_SELECTED;
|
||||||
|
nSelectedIdx = 0;
|
||||||
|
success = true;
|
||||||
|
}
|
||||||
|
else if((nState >= STATE_APP_SELECTED) && (cmdCompare(cmdData,fidNDEF,sizeof(fidNDEF)) || cmdCompare(cmdData,selectFileId,sizeof(selectFileId))))
|
||||||
|
{ /* Select NDEF */
|
||||||
|
nState = STATE_FID_SELECTED;
|
||||||
|
nSelectedIdx = 1;
|
||||||
|
success = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nState = STATE_IDLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
rspData[0] = (success ? (char)0x90 : 0x6A);
|
||||||
|
rspData[1] = (success ? (char)0x00 : 0x82);
|
||||||
|
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*****************************************************************************
|
||||||
|
* @brief Manage the T4T Read answer to the reader
|
||||||
|
*
|
||||||
|
* @param[in] cmdData : pointer to the received command.
|
||||||
|
* @param[out] rspData : pointer to the answer to send.
|
||||||
|
*
|
||||||
|
* @return Answer size.
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
static uint16_t demoCeT4TRead(uint8_t *cmdData, uint8_t *rspData)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Cmd: CLA(1) | INS(1) | P1(1).. offset inside file high | P2(1).. offset inside file high | Le(1).. nBytes to read
|
||||||
|
* Rsp: BytesRead | SW12
|
||||||
|
*/
|
||||||
|
unsigned short offset = (cmdData[2] << 8) | cmdData[3];
|
||||||
|
unsigned short toRead = cmdData[4];
|
||||||
|
uint8_t * ppbMemory;
|
||||||
|
|
||||||
|
/* Any file selected */
|
||||||
|
if(nSelectedIdx < 0 || nSelectedIdx >= nFiles)
|
||||||
|
{
|
||||||
|
rspData[0] = ((char)0x6A);
|
||||||
|
rspData[1] = ((char)0x82);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* offset + length exceed file size */
|
||||||
|
if((unsigned long)(offset + toRead) > pdwFileSize[nSelectedIdx])
|
||||||
|
{
|
||||||
|
toRead = pdwFileSize[nSelectedIdx] - offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
ppbMemory = (nSelectedIdx == 0 ? ccfile : ndefFile);
|
||||||
|
/* read data */
|
||||||
|
memcpy(rspData, &ppbMemory[offset], toRead);
|
||||||
|
|
||||||
|
rspData[toRead] = ((char)0x90);
|
||||||
|
rspData[toRead+1] = ((char)0x00);
|
||||||
|
return toRead + 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*****************************************************************************
|
||||||
|
* @brief Manage the T4T Update answer to the reader
|
||||||
|
*
|
||||||
|
* @param[in] cmdData : pointer to the received command.
|
||||||
|
* @param[in] rspData : pointer to the answer to send.
|
||||||
|
*
|
||||||
|
* @return Answer size.
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
static uint16_t demoCeT4TUpdate(uint8_t *cmdData, uint8_t *rspData)
|
||||||
|
{
|
||||||
|
uint32_t offset = (cmdData[2] << 8) | cmdData[3];
|
||||||
|
uint32_t length = cmdData[4];
|
||||||
|
|
||||||
|
if(nSelectedIdx != 1)
|
||||||
|
{
|
||||||
|
rspData[0] = ((char)0x6A);
|
||||||
|
rspData[1] = ((char)0x82);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((unsigned long)(offset + length) > pdwFileSize[nSelectedIdx])
|
||||||
|
{
|
||||||
|
rspData[0] = ((char)0x62);
|
||||||
|
rspData[1] = ((char)0x82);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
memcpy((ndefFile + offset), &cmdData[5], length);
|
||||||
|
|
||||||
|
rspData[0] = ((char)0x90);
|
||||||
|
rspData[1] = ((char)0x00);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*****************************************************************************
|
||||||
|
* @brief Manage the T4T Read answer to the reader
|
||||||
|
*
|
||||||
|
* @param[in] cmdData : pointer to the received command.
|
||||||
|
* @param[out] rspData : pointer to the answer to send.
|
||||||
|
*
|
||||||
|
* @return Answer size.
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
static uint16_t demoCeT3TCheck(uint8_t *cmdData, uint8_t *rspData)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Cmd: cmd | NFCID2 | NoS | Service code list | NoB | Block list
|
||||||
|
* Rsp: rsp | NFCID2 | Status Flag 1 | Status Flag 2 | NoB | Block Data
|
||||||
|
*/
|
||||||
|
uint8_t *block;
|
||||||
|
uint16_t blocknb[256];
|
||||||
|
uint32_t idx = 0;
|
||||||
|
uint32_t cnt = 0;
|
||||||
|
uint32_t nbmax = 0;
|
||||||
|
|
||||||
|
/* Command response */
|
||||||
|
rspData[idx++] = RFAL_NFCF_CMD_READ_WITHOUT_ENCRYPTION + 1;
|
||||||
|
|
||||||
|
/* NFCID 2 bytes */
|
||||||
|
if( ST_BYTECMP( gNfcfNfcid, &cmdData[ RFAL_NFCF_LENGTH_LEN + RFAL_NFCF_CMD_LEN ], RFAL_NFCF_NFCID2_LEN ) == 0 )
|
||||||
|
{
|
||||||
|
ST_MEMCPY( &rspData[idx], &gNfcfNfcid, RFAL_NFCF_NFCID2_LEN );
|
||||||
|
idx += RFAL_NFCF_NFCID2_LEN;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* If NFCID2 in command is different, no answer */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check for command errors */
|
||||||
|
if( (cmdData[10] != 1) || ((cmdData[11] != 0x09) && (cmdData[11] != 0x0B))
|
||||||
|
|| (cmdData[13] == 0) || (cmdData[13] > InformationBlock[1]) )
|
||||||
|
{
|
||||||
|
rspData[idx++] = 0xFF;
|
||||||
|
rspData[idx++] = 0xFF;
|
||||||
|
return idx;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rspData[idx++] = 0x00;
|
||||||
|
rspData[idx++] = 0x00;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Nob */
|
||||||
|
rspData[idx++] = cmdData[13];
|
||||||
|
|
||||||
|
/* Retrieving block to read */
|
||||||
|
block = &cmdData[14];
|
||||||
|
for( cnt = 0; cnt < cmdData[13]; cnt++ )
|
||||||
|
{
|
||||||
|
/* Check block list element size */
|
||||||
|
if( *block & 0x80 )
|
||||||
|
{
|
||||||
|
/* 2-byte Block List element */
|
||||||
|
blocknb[cnt] = *(block + 1);
|
||||||
|
block += 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* 3-byte Block List element */
|
||||||
|
blocknb[cnt] = *(block + 1);
|
||||||
|
blocknb[cnt] <<= 8;
|
||||||
|
blocknb[cnt] |= *(block + 2);
|
||||||
|
block += 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Return error if Blocknb > NmaxB */
|
||||||
|
nbmax = InformationBlock[3];
|
||||||
|
nbmax = (nbmax << 8) | InformationBlock[4];
|
||||||
|
if( blocknb[cnt] > nbmax )
|
||||||
|
{
|
||||||
|
rspData[idx - 3] = 0xFF;
|
||||||
|
rspData[idx - 2] = 0x70;
|
||||||
|
return (idx - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for( cnt = 0; cnt < cmdData[13]; cnt++ )
|
||||||
|
{
|
||||||
|
if( blocknb[cnt] == 0x0000 )
|
||||||
|
{
|
||||||
|
/* Read information block */
|
||||||
|
ST_MEMCPY( &rspData[idx], InformationBlock, sizeof(InformationBlock));
|
||||||
|
idx += sizeof(InformationBlock);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Read ndef block */
|
||||||
|
ST_MEMCPY( &rspData[idx], &ndefFile[2 + ((blocknb[cnt] - 1) * T3T_BLOCK_SIZE) ], T3T_BLOCK_SIZE);
|
||||||
|
idx += T3T_BLOCK_SIZE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*****************************************************************************
|
||||||
|
* @brief Manage the T3T Update answer to the reader
|
||||||
|
*
|
||||||
|
* @param[in] cmdData : pointer to the received command.
|
||||||
|
* @param[in] rspData : pointer to the answer to send.
|
||||||
|
*
|
||||||
|
* @return Answer size.
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
static uint16_t demoCeT3TUpdate(uint8_t *cmdData, uint8_t *rspData)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Cmd: cmd | NFCID2 | NoS | Service code list | NoB | Block list | Block Data
|
||||||
|
* Rsp: rsp | NFCID2 | Status Flag 1 | Status Flag 2
|
||||||
|
*/
|
||||||
|
uint8_t *block;
|
||||||
|
uint16_t blocknb[256];
|
||||||
|
uint32_t idx = 0;
|
||||||
|
uint32_t cnt = 0;
|
||||||
|
uint32_t nbmax = 0;
|
||||||
|
|
||||||
|
/* Command response */
|
||||||
|
rspData[idx++] = RFAL_NFCF_CMD_WRITE_WITHOUT_ENCRYPTION + 1;
|
||||||
|
|
||||||
|
/* NFCID 2 bytes */
|
||||||
|
if( ST_BYTECMP( gNfcfNfcid, &cmdData[ RFAL_NFCF_LENGTH_LEN + RFAL_NFCF_CMD_LEN ], RFAL_NFCF_NFCID2_LEN ) == 0 )
|
||||||
|
{
|
||||||
|
ST_MEMCPY( &rspData[idx], gNfcfNfcid, RFAL_NFCF_NFCID2_LEN );
|
||||||
|
idx += RFAL_NFCF_NFCID2_LEN;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* If NFCID2 in command is different, no answer */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check for command errors */
|
||||||
|
if( (cmdData[10] != 1) || (cmdData[11] != 0x09)
|
||||||
|
|| (cmdData[13] == 0) || (cmdData[13] > InformationBlock[2]) )
|
||||||
|
{
|
||||||
|
rspData[idx++] = 0xFF;
|
||||||
|
rspData[idx++] = 0xFF;
|
||||||
|
return idx;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rspData[idx++] = 0x00;
|
||||||
|
rspData[idx++] = 0x00;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Retrieving block to read */
|
||||||
|
block = &cmdData[14];
|
||||||
|
for( cnt = 0; cnt < cmdData[13]; cnt++ )
|
||||||
|
{
|
||||||
|
/* Check block list element size */
|
||||||
|
if( *block & 0x80 )
|
||||||
|
{
|
||||||
|
/* 2-byte Block List element */
|
||||||
|
blocknb[cnt] = *(block + 1);
|
||||||
|
block += 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* 3-byte Block List element */
|
||||||
|
blocknb[cnt] = *(block + 1);
|
||||||
|
blocknb[cnt] <<= 8;
|
||||||
|
blocknb[cnt] |= *(block + 2);
|
||||||
|
block += 3;
|
||||||
|
}
|
||||||
|
/* Return error if Blocknb > NmaxB */
|
||||||
|
nbmax = InformationBlock[3];
|
||||||
|
nbmax = (nbmax << 8) | InformationBlock[4];
|
||||||
|
if( blocknb[cnt] > nbmax )
|
||||||
|
{
|
||||||
|
rspData[idx - 2] = 0xFF;
|
||||||
|
rspData[idx - 1] = 0x70;
|
||||||
|
return idx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for( cnt = 0; cnt < cmdData[13]; cnt++ )
|
||||||
|
{
|
||||||
|
if( blocknb[cnt] == 0x0000 )
|
||||||
|
{
|
||||||
|
/* Write information block */
|
||||||
|
ST_MEMCPY( InformationBlock, block, T3T_BLOCK_SIZE);
|
||||||
|
block += T3T_BLOCK_SIZE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Read ndef block */
|
||||||
|
ST_MEMCPY( &ndefFile[2 + ((blocknb[cnt] - 1) * T3T_BLOCK_SIZE) ], block, T3T_BLOCK_SIZE);
|
||||||
|
block += T3T_BLOCK_SIZE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Status flag answer */
|
||||||
|
rspData[idx++] = 0x00;
|
||||||
|
rspData[idx++] = 0x00;
|
||||||
|
|
||||||
|
return idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*****************************************************************************
|
||||||
|
* @brief Demo CE Initialize
|
||||||
|
*
|
||||||
|
* Initializes the demo CE
|
||||||
|
*
|
||||||
|
* @param[in] nfcfNfcid : The NFCID to be used in T3T CE.
|
||||||
|
*
|
||||||
|
* @return None
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
void demoCeInit( uint8_t* nfcfNfcid )
|
||||||
|
{
|
||||||
|
ST_MEMCPY(gNfcfNfcid, nfcfNfcid, RFAL_NFCF_NFCID2_LEN );
|
||||||
|
ST_MEMCPY(ndefFile, (uint8_t *)ndef_uri, sizeof(ndef_uri) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*****************************************************************************
|
||||||
|
* @brief Demo CE T3T
|
||||||
|
*
|
||||||
|
* Parses the received command and computes the response to be sent back to
|
||||||
|
* the Reader
|
||||||
|
*
|
||||||
|
* @param[in] rxData : pointer to the received command.
|
||||||
|
* @param[in] rxDataLen : length of the received command.
|
||||||
|
* @param[in] txBuf : pointer to where the response will be placed.
|
||||||
|
* @param[in] txBufLen : size of txBuf.
|
||||||
|
*
|
||||||
|
* @return Response size.
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
uint16_t demoCeT4T(uint8_t *rxData, uint16_t rxDataLen, uint8_t *txBuf, uint16_t txBufLen )
|
||||||
|
{
|
||||||
|
if( (rxData == NULL) || (rxDataLen < 4) || (txBuf == NULL) || (txBufLen < 2) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(rxData[0] == T4T_CLA_00)
|
||||||
|
{
|
||||||
|
switch(rxData[1])
|
||||||
|
{
|
||||||
|
case T4T_INS_SELECT:
|
||||||
|
return demoCeT4TSelect(rxData, txBuf);
|
||||||
|
|
||||||
|
case T4T_INS_READ:
|
||||||
|
return demoCeT4TRead(rxData, txBuf);
|
||||||
|
|
||||||
|
case T4T_INS_UPDATE:
|
||||||
|
return demoCeT4TUpdate(rxData, txBuf);
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Function not supported ... */
|
||||||
|
txBuf[0] = ((char)0x68);
|
||||||
|
txBuf[1] = ((char)0x00);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*****************************************************************************
|
||||||
|
* @brief Demo CE T3T
|
||||||
|
*
|
||||||
|
* Parses the received command and computes the response to be sent back to
|
||||||
|
* the Reader
|
||||||
|
*
|
||||||
|
* @param[in] rxData : pointer to the received command.
|
||||||
|
* @param[in] rxDataLen : length of the received command.
|
||||||
|
* @param[in] txBuf : pointer to where the response will be placed.
|
||||||
|
* @param[in] txBufLen : size of txBuf.
|
||||||
|
*
|
||||||
|
* @return Response size.
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
uint16_t demoCeT3T(uint8_t *rxData, uint16_t rxDataLen, uint8_t *txBuf, uint16_t txBufLen )
|
||||||
|
{
|
||||||
|
if( (rxData == NULL) || (rxDataLen < 4) || (txBuf == NULL) || (txBufLen < 2) )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(rxData[1])
|
||||||
|
{
|
||||||
|
case RFAL_NFCF_CMD_READ_WITHOUT_ENCRYPTION:
|
||||||
|
return demoCeT3TCheck(rxData, txBuf);
|
||||||
|
|
||||||
|
case RFAL_NFCF_CMD_WRITE_WITHOUT_ENCRYPTION:
|
||||||
|
return demoCeT3TUpdate(rxData, txBuf);
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Function not supported ... */
|
||||||
|
txBuf[0] = ((char)0xFF);
|
||||||
|
txBuf[1] = ((char)0xFF);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
157
Software/Core/Src/logger.c
Normal file
157
Software/Core/Src/logger.c
Normal file
@ -0,0 +1,157 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* http://www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
/*
|
||||||
|
* PROJECT:
|
||||||
|
* $Revision: $
|
||||||
|
* LANGUAGE: ANSI C
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author
|
||||||
|
*
|
||||||
|
* \brief Debug log output utility implementation.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#include "usart.h"
|
||||||
|
#include "logger.h"
|
||||||
|
#include "st_errno.h"
|
||||||
|
#include "utils.h"
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#if (USE_LOGGER == LOGGER_ON)
|
||||||
|
|
||||||
|
#define MAX_HEX_STR 4
|
||||||
|
#define MAX_HEX_STR_LENGTH 128
|
||||||
|
char hexStr[MAX_HEX_STR][MAX_HEX_STR_LENGTH];
|
||||||
|
uint8_t hexStrIdx = 0;
|
||||||
|
#endif /* #if USE_LOGGER == LOGGER_ON */
|
||||||
|
|
||||||
|
#define USART_TIMEOUT 1000
|
||||||
|
|
||||||
|
UART_HandleTypeDef *pLogUsart = 0;
|
||||||
|
uint8_t logUsartTx(uint8_t *data, uint16_t dataLen);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function initalize the UART handle.
|
||||||
|
* @param husart : already initalized handle to USART HW
|
||||||
|
* @retval none :
|
||||||
|
*/
|
||||||
|
void logUsartInit(UART_HandleTypeDef *husart)
|
||||||
|
{
|
||||||
|
pLogUsart = husart;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function Transmit data via USART
|
||||||
|
* @param data : data to be transmitted
|
||||||
|
* @param dataLen : length of data to be transmitted
|
||||||
|
* @retval ERR_INVALID_HANDLE : in case the SPI HW is not initalized yet
|
||||||
|
* @retval others : HAL status
|
||||||
|
*/
|
||||||
|
uint8_t logUsartTx(uint8_t *data, uint16_t dataLen)
|
||||||
|
{
|
||||||
|
if(pLogUsart == 0)
|
||||||
|
return ERR_INVALID_HANDLE;
|
||||||
|
|
||||||
|
return HAL_UART_Transmit(pLogUsart, data, dataLen, USART_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
int logUsart(const char* format, ...)
|
||||||
|
{
|
||||||
|
#if (USE_LOGGER == LOGGER_ON)
|
||||||
|
{
|
||||||
|
#define LOG_BUFFER_SIZE 256
|
||||||
|
char buf[LOG_BUFFER_SIZE];
|
||||||
|
va_list argptr;
|
||||||
|
va_start(argptr, format);
|
||||||
|
int cnt = vsnprintf(buf, LOG_BUFFER_SIZE, format, argptr);
|
||||||
|
va_end(argptr);
|
||||||
|
|
||||||
|
/* */
|
||||||
|
logUsartTx((uint8_t*)buf, strlen(buf));
|
||||||
|
return cnt;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif /* #if USE_LOGGER == LOGGER_ON */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* */
|
||||||
|
|
||||||
|
char* hex2Str(unsigned char * data, size_t dataLen)
|
||||||
|
{
|
||||||
|
#if (USE_LOGGER == LOGGER_ON)
|
||||||
|
{
|
||||||
|
unsigned char * pin = data;
|
||||||
|
const char * hex = "0123456789ABCDEF";
|
||||||
|
char * pout = hexStr[hexStrIdx];
|
||||||
|
uint8_t i = 0;
|
||||||
|
uint8_t idx = hexStrIdx;
|
||||||
|
size_t len;
|
||||||
|
|
||||||
|
if(dataLen == 0)
|
||||||
|
{
|
||||||
|
pout[0] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Trim data that doesn't fit in buffer */
|
||||||
|
len = MIN( dataLen , (MAX_HEX_STR_LENGTH / 2) );
|
||||||
|
|
||||||
|
for(; i < (len - 1); ++i)
|
||||||
|
{
|
||||||
|
*pout++ = hex[(*pin>>4)&0xF];
|
||||||
|
*pout++ = hex[(*pin++)&0xF];
|
||||||
|
}
|
||||||
|
*pout++ = hex[(*pin>>4)&0xF];
|
||||||
|
*pout++ = hex[(*pin)&0xF];
|
||||||
|
*pout = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
hexStrIdx++;
|
||||||
|
hexStrIdx %= MAX_HEX_STR;
|
||||||
|
|
||||||
|
return hexStr[idx];
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#endif /* #if USE_LOGGER == LOGGER_ON */
|
||||||
|
}
|
269
Software/Core/Src/main.c
Normal file
269
Software/Core/Src/main.c
Normal file
@ -0,0 +1,269 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file : main.c
|
||||||
|
* @brief : Main program body
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
/* Private includes ----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PTD */
|
||||||
|
|
||||||
|
/* USER CODE END PTD */
|
||||||
|
|
||||||
|
/* Private define ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PD */
|
||||||
|
/* USER CODE END PD */
|
||||||
|
|
||||||
|
/* Private macro -------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PM */
|
||||||
|
|
||||||
|
/* USER CODE END PM */
|
||||||
|
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
SPI_HandleTypeDef hspi1;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN PV */
|
||||||
|
|
||||||
|
/* USER CODE END PV */
|
||||||
|
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
void SystemClock_Config(void);
|
||||||
|
static void MX_GPIO_Init(void);
|
||||||
|
static void MX_SPI1_Init(void);
|
||||||
|
/* USER CODE BEGIN PFP */
|
||||||
|
|
||||||
|
/* USER CODE END PFP */
|
||||||
|
|
||||||
|
/* Private user code ---------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN 0 */
|
||||||
|
|
||||||
|
/* USER CODE END 0 */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The application entry point.
|
||||||
|
* @retval int
|
||||||
|
*/
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN 1 */
|
||||||
|
|
||||||
|
/* USER CODE END 1 */
|
||||||
|
|
||||||
|
/* MCU Configuration--------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
|
||||||
|
HAL_Init();
|
||||||
|
|
||||||
|
/* USER CODE BEGIN Init */
|
||||||
|
|
||||||
|
/* USER CODE END Init */
|
||||||
|
|
||||||
|
/* Configure the system clock */
|
||||||
|
SystemClock_Config();
|
||||||
|
|
||||||
|
/* USER CODE BEGIN SysInit */
|
||||||
|
|
||||||
|
/* USER CODE END SysInit */
|
||||||
|
|
||||||
|
/* Initialize all configured peripherals */
|
||||||
|
MX_GPIO_Init();
|
||||||
|
MX_SPI1_Init();
|
||||||
|
/* USER CODE BEGIN 2 */
|
||||||
|
|
||||||
|
/* USER CODE END 2 */
|
||||||
|
|
||||||
|
/* Infinite loop */
|
||||||
|
/* USER CODE BEGIN WHILE */
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
/* USER CODE END WHILE */
|
||||||
|
|
||||||
|
/* USER CODE BEGIN 3 */
|
||||||
|
}
|
||||||
|
/* USER CODE END 3 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief System Clock Configuration
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void SystemClock_Config(void)
|
||||||
|
{
|
||||||
|
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||||
|
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||||
|
|
||||||
|
/** Initializes the RCC Oscillators according to the specified parameters
|
||||||
|
* in the RCC_OscInitTypeDef structure.
|
||||||
|
*/
|
||||||
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||||
|
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||||
|
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
|
||||||
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||||
|
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||||
|
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
|
||||||
|
RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1;
|
||||||
|
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||||
|
{
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Initializes the CPU, AHB and APB buses clocks
|
||||||
|
*/
|
||||||
|
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|
||||||
|
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
|
||||||
|
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
|
||||||
|
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||||
|
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
|
||||||
|
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
|
||||||
|
|
||||||
|
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
|
||||||
|
{
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief SPI1 Initialization Function
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
static void MX_SPI1_Init(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* USER CODE BEGIN SPI1_Init 0 */
|
||||||
|
|
||||||
|
/* USER CODE END SPI1_Init 0 */
|
||||||
|
|
||||||
|
/* USER CODE BEGIN SPI1_Init 1 */
|
||||||
|
|
||||||
|
/* USER CODE END SPI1_Init 1 */
|
||||||
|
/* SPI1 parameter configuration*/
|
||||||
|
hspi1.Instance = SPI1;
|
||||||
|
hspi1.Init.Mode = SPI_MODE_MASTER;
|
||||||
|
hspi1.Init.Direction = SPI_DIRECTION_2LINES;
|
||||||
|
hspi1.Init.DataSize = SPI_DATASIZE_4BIT;
|
||||||
|
hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||||
|
hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
|
||||||
|
hspi1.Init.NSS = SPI_NSS_SOFT;
|
||||||
|
hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4;
|
||||||
|
hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||||
|
hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||||
|
hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||||
|
hspi1.Init.CRCPolynomial = 7;
|
||||||
|
hspi1.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE;
|
||||||
|
hspi1.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;
|
||||||
|
if (HAL_SPI_Init(&hspi1) != HAL_OK)
|
||||||
|
{
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
/* USER CODE BEGIN SPI1_Init 2 */
|
||||||
|
|
||||||
|
/* USER CODE END SPI1_Init 2 */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief GPIO Initialization Function
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
static void MX_GPIO_Init(void)
|
||||||
|
{
|
||||||
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||||
|
|
||||||
|
/* GPIO Ports Clock Enable */
|
||||||
|
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||||
|
__HAL_RCC_GPIOF_CLK_ENABLE();
|
||||||
|
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||||
|
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||||
|
|
||||||
|
/*Configure GPIO pin Output Level */
|
||||||
|
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_8, GPIO_PIN_RESET);
|
||||||
|
|
||||||
|
/*Configure GPIO pin Output Level */
|
||||||
|
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6, GPIO_PIN_RESET);
|
||||||
|
|
||||||
|
/*Configure GPIO pin : B1_Pin */
|
||||||
|
GPIO_InitStruct.Pin = B1_Pin;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
HAL_GPIO_Init(B1_GPIO_Port, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
/*Configure GPIO pins : PA1 PA4 PA8 */
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_1|GPIO_PIN_4|GPIO_PIN_8;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||||
|
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
/*Configure GPIO pins : USART_TX_Pin USART_RX_Pin */
|
||||||
|
GPIO_InitStruct.Pin = USART_TX_Pin|USART_RX_Pin;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||||
|
GPIO_InitStruct.Alternate = GPIO_AF7_USART2;
|
||||||
|
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
/*Configure GPIO pins : PB0 PB4 PB5 PB6 */
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||||
|
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* USER CODE BEGIN 4 */
|
||||||
|
|
||||||
|
/* USER CODE END 4 */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is executed in case of error occurrence.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void Error_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN Error_Handler_Debug */
|
||||||
|
/* User can add his own implementation to report the HAL error return state */
|
||||||
|
__disable_irq();
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
/* USER CODE END Error_Handler_Debug */
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef USE_FULL_ASSERT
|
||||||
|
/**
|
||||||
|
* @brief Reports the name of the source file and the source line number
|
||||||
|
* where the assert_param error has occurred.
|
||||||
|
* @param file: pointer to the source file name
|
||||||
|
* @param line: assert_param error line source number
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void assert_failed(uint8_t *file, uint32_t line)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN 6 */
|
||||||
|
/* User can add his own implementation to report the file name and line number,
|
||||||
|
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
|
||||||
|
/* USER CODE END 6 */
|
||||||
|
}
|
||||||
|
#endif /* USE_FULL_ASSERT */
|
1103
Software/Core/Src/ndef_demo.c
Normal file
1103
Software/Core/Src/ndef_demo.c
Normal file
File diff suppressed because it is too large
Load Diff
721
Software/Core/Src/ndef_dump.c
Normal file
721
Software/Core/Src/ndef_dump.c
Normal file
@ -0,0 +1,721 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* \attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2019 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PROJECT: NDEF firmware
|
||||||
|
* Revision:
|
||||||
|
* LANGUAGE: ISO C99
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author
|
||||||
|
*
|
||||||
|
* \brief NDEF message dump utils
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "platform.h"
|
||||||
|
#include "st_errno.h"
|
||||||
|
#include "utils.h"
|
||||||
|
#include "ndef_record.h"
|
||||||
|
#include "ndef_message.h"
|
||||||
|
#include "ndef_types_rtd.h"
|
||||||
|
#include "ndef_types_mime.h"
|
||||||
|
#include "ndef_dump.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! Table to associate enums to pointer to function */
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ndefTypeId typeId; /*!< NDEF type Id */
|
||||||
|
ReturnCode (*dump)(const ndefType* type); /*!< Pointer to dump function */
|
||||||
|
} ndefTypeDumpTable;
|
||||||
|
|
||||||
|
|
||||||
|
static const ndefTypeDumpTable typeDumpTable[] =
|
||||||
|
{
|
||||||
|
{ NDEF_TYPE_EMPTY, ndefEmptyTypeDump },
|
||||||
|
{ NDEF_TYPE_RTD_DEVICE_INFO, ndefRtdDeviceInfoDump },
|
||||||
|
{ NDEF_TYPE_RTD_TEXT, ndefRtdTextDump },
|
||||||
|
{ NDEF_TYPE_RTD_URI, ndefRtdUriDump },
|
||||||
|
{ NDEF_TYPE_RTD_AAR, ndefRtdAarDump },
|
||||||
|
{ NDEF_TYPE_MEDIA_VCARD, ndefMediaVCardDump },
|
||||||
|
{ NDEF_TYPE_MEDIA_WIFI, ndefMediaWifiDump },
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL VARIABLES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL FUNCTION PROTOTYPES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL FUNCTIONS
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
static bool isPrintableASCII(const uint8_t* str, uint32_t strLen)
|
||||||
|
{
|
||||||
|
uint32_t i;
|
||||||
|
|
||||||
|
if ((str == NULL) || (strLen == 0))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < strLen; i++)
|
||||||
|
{
|
||||||
|
if ((str[i] < 0x20) || (str[i] > 0x7E))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
ReturnCode ndefRecordDump(const ndefRecord* record, bool verbose)
|
||||||
|
{
|
||||||
|
static uint32_t index;
|
||||||
|
const uint8_t *ndefTNFNames[] =
|
||||||
|
{
|
||||||
|
(uint8_t *)"Empty",
|
||||||
|
(uint8_t *)"NFC Forum well-known type [NFC RTD]",
|
||||||
|
(uint8_t *)"Media-type as defined in RFC 2046",
|
||||||
|
(uint8_t *)"Absolute URI as defined in RFC 3986",
|
||||||
|
(uint8_t *)"NFC Forum external type [NFC RTD]",
|
||||||
|
(uint8_t *)"Unknown",
|
||||||
|
(uint8_t *)"Unchanged",
|
||||||
|
(uint8_t *)"Reserved"
|
||||||
|
};
|
||||||
|
uint8_t* headerSR = (uint8_t*)"";
|
||||||
|
ReturnCode err;
|
||||||
|
|
||||||
|
if (record == NULL)
|
||||||
|
{
|
||||||
|
platformLog("No record\r\n");
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ndefHeaderIsSetMB(record))
|
||||||
|
{
|
||||||
|
index = 1U;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (verbose == true)
|
||||||
|
{
|
||||||
|
headerSR = (uint8_t*)(ndefHeaderIsSetSR(record) ? " - Short Record" : " - Standard Record");
|
||||||
|
}
|
||||||
|
|
||||||
|
platformLog("Record #%d%s\r\n", index, headerSR);
|
||||||
|
|
||||||
|
/* Well-known type dump */
|
||||||
|
err = ndefRecordDumpType(record);
|
||||||
|
if (verbose == true)
|
||||||
|
{
|
||||||
|
/* Raw dump */
|
||||||
|
//platformLog(" MB:%d ME:%d CF:%d SR:%d IL:%d TNF:%d\r\n", ndefHeaderMB(record), ndefHeaderME(record), ndefHeaderCF(record), ndefHeaderSR(record), ndefHeaderIL(record), ndefHeaderTNF(record));
|
||||||
|
platformLog(" MB ME CF SR IL TNF\r\n");
|
||||||
|
platformLog(" %d %d %d %d %d %d\r\n", ndefHeaderMB(record), ndefHeaderME(record), ndefHeaderCF(record), ndefHeaderSR(record), ndefHeaderIL(record), ndefHeaderTNF(record));
|
||||||
|
}
|
||||||
|
if ( (err != ERR_NONE) || (verbose == true) )
|
||||||
|
{
|
||||||
|
platformLog(" Type Name Format: %s\r\n", ndefTNFNames[ndefHeaderTNF(record)]);
|
||||||
|
|
||||||
|
uint8_t tnf;
|
||||||
|
ndefConstBuffer8 bufRecordType;
|
||||||
|
ndefRecordGetType(record, &tnf, &bufRecordType);
|
||||||
|
if ( (tnf == NDEF_TNF_EMPTY) && (bufRecordType.length == 0U) )
|
||||||
|
{
|
||||||
|
platformLog(" Empty NDEF record\r\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ndefBuffer8Print(" Type: \"", &bufRecordType, "\"\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ndefHeaderIsSetIL(record))
|
||||||
|
{
|
||||||
|
/* ID Length bit set */
|
||||||
|
ndefConstBuffer8 bufRecordId;
|
||||||
|
ndefRecordGetId(record, &bufRecordId);
|
||||||
|
ndefBuffer8Print(" ID: \"", &bufRecordId, "\"\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
ndefConstBuffer bufRecordPayload;
|
||||||
|
ndefRecordGetPayload(record, &bufRecordPayload);
|
||||||
|
ndefBufferDump(" Payload:", &bufRecordPayload, verbose);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
ReturnCode ndefMessageDump(const ndefMessage* message, bool verbose)
|
||||||
|
{
|
||||||
|
ReturnCode err;
|
||||||
|
ndefRecord* record;
|
||||||
|
|
||||||
|
if (message == NULL)
|
||||||
|
{
|
||||||
|
platformLog("Empty NDEF message\r\n");
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
platformLog("Decoding NDEF message\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
record = ndefMessageGetFirstRecord(message);
|
||||||
|
|
||||||
|
while (record != NULL)
|
||||||
|
{
|
||||||
|
err = ndefRecordDump(record, verbose);
|
||||||
|
if (err != ERR_NONE)
|
||||||
|
{
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
record = ndefMessageGetNextRecord(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
ReturnCode ndefEmptyTypeDump(const ndefType* empty)
|
||||||
|
{
|
||||||
|
if (empty == NULL)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty->id != NDEF_TYPE_EMPTY)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
platformLog(" Empty record\r\n");
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
ReturnCode ndefRtdDeviceInfoDump(const ndefType* devInfo)
|
||||||
|
{
|
||||||
|
ndefTypeRtdDeviceInfo devInfoData;
|
||||||
|
uint32_t type;
|
||||||
|
uint32_t i;
|
||||||
|
|
||||||
|
const uint8_t* ndefDeviceInfoName[] =
|
||||||
|
{
|
||||||
|
(uint8_t*)"Manufacturer",
|
||||||
|
(uint8_t*)"Model",
|
||||||
|
(uint8_t*)"Device",
|
||||||
|
(uint8_t*)"UUID",
|
||||||
|
(uint8_t*)"Firmware version",
|
||||||
|
};
|
||||||
|
|
||||||
|
if (devInfo == NULL)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (devInfo->id != NDEF_TYPE_RTD_DEVICE_INFO)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
ndefGetRtdDeviceInfo(devInfo, &devInfoData);
|
||||||
|
|
||||||
|
platformLog(" Device Information:\r\n");
|
||||||
|
|
||||||
|
for (type = 0; type < NDEF_DEVICE_INFO_TYPE_COUNT; type++)
|
||||||
|
{
|
||||||
|
if (devInfoData.devInfo[type].buffer != NULL)
|
||||||
|
{
|
||||||
|
platformLog(" - %s: ", ndefDeviceInfoName[devInfoData.devInfo[type].type]);
|
||||||
|
|
||||||
|
if (type != NDEF_DEVICE_INFO_UUID)
|
||||||
|
{
|
||||||
|
for (i = 0; i < devInfoData.devInfo[type].length; i++)
|
||||||
|
{
|
||||||
|
platformLog("%c", devInfoData.devInfo[type].buffer[i]); /* character */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i = 0; i < devInfoData.devInfo[type].length; i++)
|
||||||
|
{
|
||||||
|
platformLog("%.2X", devInfoData.devInfo[type].buffer[i]); /* hex number */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
platformLog("\r\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
ReturnCode ndefRtdTextDump(const ndefType* text)
|
||||||
|
{
|
||||||
|
uint8_t utfEncoding;
|
||||||
|
ndefConstBuffer8 bufLanguageCode;
|
||||||
|
ndefConstBuffer bufSentence;
|
||||||
|
|
||||||
|
if (text == NULL)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (text->id != NDEF_TYPE_RTD_TEXT)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
ndefGetRtdText(text, &utfEncoding, &bufLanguageCode, &bufSentence);
|
||||||
|
|
||||||
|
ndefBufferPrint(" Text: \"", &bufSentence, "");
|
||||||
|
|
||||||
|
platformLog("\" (%s,", utfEncoding == TEXT_ENCODING_UTF8 ? "UTF8" : "UTF16");
|
||||||
|
|
||||||
|
ndefBuffer8Print(" language code \"", &bufLanguageCode, "\")\r\n");
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
ReturnCode ndefRtdUriDump(const ndefType* uri)
|
||||||
|
{
|
||||||
|
ndefConstBuffer bufProtocol;
|
||||||
|
ndefConstBuffer bufUriString;
|
||||||
|
|
||||||
|
if (uri == NULL)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (uri->id != NDEF_TYPE_RTD_URI)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
ndefGetRtdUri(uri, &bufProtocol, &bufUriString);
|
||||||
|
|
||||||
|
ndefBufferPrint("URI: (", &bufProtocol, ")");
|
||||||
|
ndefBufferPrint("", &bufUriString, "\r\n");
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
ReturnCode ndefRtdAarDump(const ndefType* aar)
|
||||||
|
{
|
||||||
|
ndefConstBuffer bufAarString;
|
||||||
|
|
||||||
|
if (aar == NULL)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aar->id != NDEF_TYPE_RTD_AAR)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
ndefGetRtdAar(aar, &bufAarString);
|
||||||
|
|
||||||
|
ndefBufferPrint(" AAR Package: ", &bufAarString, "\r\n");
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
ReturnCode ndefMediaTypeDump(const ndefType* media)
|
||||||
|
{
|
||||||
|
ndefConstBuffer8 bufType;
|
||||||
|
ndefConstBuffer bufPayload;
|
||||||
|
|
||||||
|
if (media == NULL)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (media->id != NDEF_TYPE_MEDIA)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
ndefGetMedia(media, &bufType, &bufPayload);
|
||||||
|
|
||||||
|
ndefBuffer8Print(" Media Type: ", &bufType, "\r\n");
|
||||||
|
ndefBufferPrint(" Payload: ", &bufPayload, "\r\n");
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
static ReturnCode ndefMediaVCardTranslate(const ndefConstBuffer* bufText, ndefConstBuffer* bufTranslation)
|
||||||
|
{
|
||||||
|
typedef struct {
|
||||||
|
uint8_t* vCardString;
|
||||||
|
uint8_t* english;
|
||||||
|
} ndefTranslate;
|
||||||
|
|
||||||
|
const ndefTranslate translate[] =
|
||||||
|
{
|
||||||
|
{ (uint8_t*)"N" , (uint8_t*)"Name" },
|
||||||
|
{ (uint8_t*)"FN" , (uint8_t*)"Formatted Name" },
|
||||||
|
{ (uint8_t*)"ADR" , (uint8_t*)"Address" },
|
||||||
|
{ (uint8_t*)"TEL" , (uint8_t*)"Phone" },
|
||||||
|
{ (uint8_t*)"EMAIL" , (uint8_t*)"Email" },
|
||||||
|
{ (uint8_t*)"TITLE" , (uint8_t*)"Title" },
|
||||||
|
{ (uint8_t*)"ORG" , (uint8_t*)"Org" },
|
||||||
|
{ (uint8_t*)"URL" , (uint8_t*)"URL" },
|
||||||
|
{ (uint8_t*)"PHOTO" , (uint8_t*)"Photo" },
|
||||||
|
};
|
||||||
|
|
||||||
|
uint32_t i;
|
||||||
|
|
||||||
|
if ( (bufText == NULL) || (bufTranslation == NULL) )
|
||||||
|
{
|
||||||
|
return ERR_PROTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < SIZEOF_ARRAY(translate); i++)
|
||||||
|
{
|
||||||
|
if (ST_BYTECMP(bufText->buffer, translate[i].vCardString, strlen((char*)translate[i].vCardString)) == 0)
|
||||||
|
{
|
||||||
|
bufTranslation->buffer = translate[i].english;
|
||||||
|
bufTranslation->length = strlen((char*)translate[i].english);
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bufTranslation->buffer = bufText->buffer;
|
||||||
|
bufTranslation->length = bufText->length;
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
ReturnCode ndefMediaVCardDump(const ndefType* vCard)
|
||||||
|
{
|
||||||
|
ndefConstBuffer bufTypeN = { (uint8_t*)"N", strlen((char*)"N") };
|
||||||
|
ndefConstBuffer bufTypeFN = { (uint8_t*)"FN", strlen((char*)"FN") };
|
||||||
|
ndefConstBuffer bufTypeADR = { (uint8_t*)"ADR", strlen((char*)"ADR") };
|
||||||
|
ndefConstBuffer bufTypeTEL = { (uint8_t*)"TEL", strlen((char*)"TEL") };
|
||||||
|
ndefConstBuffer bufTypeEMAIL = { (uint8_t*)"EMAIL", strlen((char*)"EMAIL") };
|
||||||
|
ndefConstBuffer bufTypeTITLE = { (uint8_t*)"TITLE", strlen((char*)"TITLE") };
|
||||||
|
ndefConstBuffer bufTypeORG = { (uint8_t*)"ORG", strlen((char*)"ORG") };
|
||||||
|
ndefConstBuffer bufTypeURL = { (uint8_t*)"URL", strlen((char*)"URL") };
|
||||||
|
ndefConstBuffer bufTypePHOTO = { (uint8_t*)"PHOTO", strlen((char*)"PHOTO") };
|
||||||
|
|
||||||
|
const ndefConstBuffer* bufVCardField[] = {
|
||||||
|
&bufTypeN ,
|
||||||
|
&bufTypeFN ,
|
||||||
|
&bufTypeADR ,
|
||||||
|
&bufTypeTEL ,
|
||||||
|
&bufTypeEMAIL,
|
||||||
|
&bufTypeTITLE,
|
||||||
|
&bufTypeORG ,
|
||||||
|
&bufTypeURL ,
|
||||||
|
&bufTypePHOTO,
|
||||||
|
};
|
||||||
|
|
||||||
|
uint32_t i;
|
||||||
|
const ndefConstBuffer* bufType;
|
||||||
|
ndefConstBuffer bufSubType;
|
||||||
|
ndefConstBuffer bufValue;
|
||||||
|
|
||||||
|
if (vCard == NULL)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (vCard->id != NDEF_TYPE_MEDIA_VCARD)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
platformLog(" vCard decoded: \r\n");
|
||||||
|
|
||||||
|
for (i = 0; i < SIZEOF_ARRAY(bufVCardField); i++)
|
||||||
|
{
|
||||||
|
/* Requesting vCard field */
|
||||||
|
bufType = bufVCardField[i];
|
||||||
|
|
||||||
|
/* Get information from vCard */
|
||||||
|
ndefGetVCard(vCard, bufType, &bufSubType, &bufValue);
|
||||||
|
|
||||||
|
if (bufValue.buffer != NULL)
|
||||||
|
{
|
||||||
|
ndefConstBuffer bufTypeTranslate;
|
||||||
|
ndefMediaVCardTranslate(bufType, &bufTypeTranslate);
|
||||||
|
|
||||||
|
/* Type */
|
||||||
|
ndefBufferPrint(" ", &bufTypeTranslate, "");
|
||||||
|
|
||||||
|
/* Subtype, if any */
|
||||||
|
if (bufSubType.buffer != NULL)
|
||||||
|
{
|
||||||
|
ndefBufferPrint(" (", &bufSubType, ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Value */
|
||||||
|
if (ST_BYTECMP(bufType->buffer, bufTypePHOTO.buffer, bufTypePHOTO.length) != 0)
|
||||||
|
{
|
||||||
|
ndefBufferPrint(": ", &bufValue, "\r\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
platformLog("Photo: <Not displayed>\r\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
ReturnCode ndefMediaWifiDump(const ndefType* wifi)
|
||||||
|
{
|
||||||
|
ndefTypeWifi wifiConfig;
|
||||||
|
|
||||||
|
if (wifi == NULL)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wifi->id != NDEF_TYPE_MEDIA_WIFI)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
ndefGetWifi(wifi, &wifiConfig);
|
||||||
|
|
||||||
|
platformLog(" Wifi config: \r\n");
|
||||||
|
ndefBufferDump(" Network SSID:", &wifiConfig.bufNetworkSSID, false);
|
||||||
|
ndefBufferDump(" Network Key:", &wifiConfig.bufNetworkKey, false);
|
||||||
|
platformLog(" Authentication: %d\r\n", wifiConfig.authentication);
|
||||||
|
platformLog(" Encryption: %d\r\n", wifiConfig.encryption);
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
ReturnCode ndefRecordDumpType(const ndefRecord* record)
|
||||||
|
{
|
||||||
|
ReturnCode err;
|
||||||
|
ndefType type;
|
||||||
|
uint32_t i;
|
||||||
|
|
||||||
|
err = ndefRecordToType(record, &type);
|
||||||
|
if (err != ERR_NONE)
|
||||||
|
{
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < SIZEOF_ARRAY(typeDumpTable); i++)
|
||||||
|
{
|
||||||
|
if (type.id == typeDumpTable[i].typeId)
|
||||||
|
{
|
||||||
|
/* Call the appropriate function to the matching record type */
|
||||||
|
if (typeDumpTable[i].dump != NULL)
|
||||||
|
{
|
||||||
|
return typeDumpTable[i].dump(&type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ERR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
static ReturnCode ndefBufferDumpLine(const uint8_t* buffer, const uint32_t offset, uint32_t lineLength, uint32_t remaining)
|
||||||
|
{
|
||||||
|
uint32_t j;
|
||||||
|
|
||||||
|
if (buffer == NULL)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
platformLog(" [%.4X] ", offset);
|
||||||
|
|
||||||
|
/* Dump hex data */
|
||||||
|
for (j = 0; j < remaining; j++)
|
||||||
|
{
|
||||||
|
platformLog("%.2X ", buffer[offset + j]);
|
||||||
|
}
|
||||||
|
/* Fill hex section if needed */
|
||||||
|
for (j = 0; j < lineLength - remaining; j++)
|
||||||
|
{
|
||||||
|
platformLog(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Dump characters */
|
||||||
|
platformLog("|");
|
||||||
|
for (j = 0; j < remaining; j++)
|
||||||
|
{
|
||||||
|
/* Dump only ASCII characters, otherwise replace with a '.' */
|
||||||
|
platformLog("%2c", isPrintableASCII(&buffer[offset + j], 1) ? buffer[offset + j] : '.');
|
||||||
|
}
|
||||||
|
/* Fill ASCII section if needed */
|
||||||
|
for (j = 0; j < lineLength - remaining; j++)
|
||||||
|
{
|
||||||
|
platformLog(" ");
|
||||||
|
}
|
||||||
|
platformLog(" |\r\n");
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
ReturnCode ndefBufferDump(const char* string, const ndefConstBuffer* bufPayload, bool verbose)
|
||||||
|
{
|
||||||
|
uint32_t bufferLengthMax = 32;
|
||||||
|
const uint32_t lineLength = 8;
|
||||||
|
uint32_t displayed;
|
||||||
|
uint32_t remaining;
|
||||||
|
uint32_t offset;
|
||||||
|
|
||||||
|
if ( (string == NULL) || (bufPayload == NULL) )
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
displayed = bufPayload->length;
|
||||||
|
remaining = bufPayload->length;
|
||||||
|
|
||||||
|
platformLog("%s (length %d)\r\n", string, bufPayload->length);
|
||||||
|
if (bufPayload->buffer == NULL)
|
||||||
|
{
|
||||||
|
platformLog(" <No chunk payload buffer>\r\n");
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (verbose == true)
|
||||||
|
{
|
||||||
|
bufferLengthMax = 256;
|
||||||
|
}
|
||||||
|
if (bufPayload->length > bufferLengthMax)
|
||||||
|
{
|
||||||
|
/* Truncate output */
|
||||||
|
displayed = bufferLengthMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (offset = 0; offset < displayed; offset += lineLength)
|
||||||
|
{
|
||||||
|
ndefBufferDumpLine(bufPayload->buffer, offset, lineLength, remaining > lineLength ? lineLength : remaining);
|
||||||
|
remaining -= lineLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (displayed < bufPayload->length)
|
||||||
|
{
|
||||||
|
platformLog(" ... (truncated)\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
ReturnCode ndefBufferPrint(const char* prefix, const ndefConstBuffer* bufString, const char* suffix)
|
||||||
|
{
|
||||||
|
uint32_t i;
|
||||||
|
|
||||||
|
if ( (prefix == NULL) || (bufString == NULL) || (bufString->buffer == NULL) || (suffix == NULL))
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
platformLog("%s", prefix);
|
||||||
|
for (i = 0; i < bufString->length; i++)
|
||||||
|
{
|
||||||
|
platformLog("%c", bufString->buffer[i]);
|
||||||
|
}
|
||||||
|
platformLog("%s", suffix);
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
ReturnCode ndefBuffer8Print(const char* prefix, const ndefConstBuffer8* bufString, const char* suffix)
|
||||||
|
{
|
||||||
|
ndefConstBuffer buf;
|
||||||
|
|
||||||
|
if (bufString == NULL)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
buf.buffer = bufString->buffer;
|
||||||
|
buf.length = bufString->length;
|
||||||
|
|
||||||
|
return ndefBufferPrint(prefix, &buf, suffix);
|
||||||
|
}
|
105
Software/Core/Src/ndef_example_wrapper.c
Normal file
105
Software/Core/Src/ndef_example_wrapper.c
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* \attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2019 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author
|
||||||
|
*
|
||||||
|
* \brief Demo application
|
||||||
|
*
|
||||||
|
* This demo shows how to poll for several types of NFC cards/devices and how
|
||||||
|
* to exchange data with these devices, using the RFAL library.
|
||||||
|
*
|
||||||
|
* This demo does not fully implement the activities according to the standards,
|
||||||
|
* it performs the required to communicate with a card/device and retrieve
|
||||||
|
* its UID. Also blocking methods are used for data exchange which may lead to
|
||||||
|
* long periods of blocking CPU/MCU.
|
||||||
|
* For standard compliant example please refer to the Examples provided
|
||||||
|
* with the RFAL library.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#include "demo.h"
|
||||||
|
|
||||||
|
/*! NDEF read usage example */
|
||||||
|
extern void ndefExampleRead(void);
|
||||||
|
|
||||||
|
/*! NDEF write usage example */
|
||||||
|
extern void ndefExampleWrite(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL VARIABLES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
static bool bWrite = false;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Demo Ini
|
||||||
|
*
|
||||||
|
* \return true once initialized
|
||||||
|
*
|
||||||
|
* This function Initializes the required layers for the demo
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
bool demoIni( void )
|
||||||
|
{
|
||||||
|
if( platformGpioIsLow(PLATFORM_USER_BUTTON_PORT, PLATFORM_USER_BUTTON_PIN))
|
||||||
|
{
|
||||||
|
bWrite = !bWrite;
|
||||||
|
platformLog("Write: %s\r\n", bWrite ? "ON": "OFF");
|
||||||
|
/* Debounce button */
|
||||||
|
while( platformGpioIsLow(PLATFORM_USER_BUTTON_PORT, PLATFORM_USER_BUTTON_PIN) );
|
||||||
|
}
|
||||||
|
return (true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Demo Cycle
|
||||||
|
*
|
||||||
|
* This function executes the demo state machine.
|
||||||
|
* It must be called periodically
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
void demoCycle( void )
|
||||||
|
{
|
||||||
|
if( !bWrite )
|
||||||
|
{
|
||||||
|
ndefExampleRead();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ndefExampleWrite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
96
Software/Core/Src/spi.c
Normal file
96
Software/Core/Src/spi.c
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
*
|
||||||
|
* COPYRIGHT(c) 2016 STMicroelectronics
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author
|
||||||
|
*
|
||||||
|
* \brief SPI communication handling implementation.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "spi.h"
|
||||||
|
#include "st_errno.h"
|
||||||
|
#include "string.h"
|
||||||
|
|
||||||
|
#define SPI_TIMEOUT 1000
|
||||||
|
#define SPI_BUF_LEN 97
|
||||||
|
|
||||||
|
|
||||||
|
static uint8_t txBuf[SPI_BUF_LEN];
|
||||||
|
static uint8_t rxBuf[SPI_BUF_LEN];
|
||||||
|
|
||||||
|
SPI_HandleTypeDef *pSpi = 0;
|
||||||
|
|
||||||
|
|
||||||
|
void spiInit(SPI_HandleTypeDef *hspi)
|
||||||
|
{
|
||||||
|
pSpi = hspi;
|
||||||
|
|
||||||
|
/* enabling SPI block will put SCLK to output, guaranteeing proper state when spiSelect() gets called */
|
||||||
|
__HAL_SPI_ENABLE(hspi);
|
||||||
|
}
|
||||||
|
|
||||||
|
void spiSelect(GPIO_TypeDef *ssPort, uint16_t ssPin)
|
||||||
|
{
|
||||||
|
HAL_GPIO_WritePin(ssPort, ssPin, GPIO_PIN_RESET);
|
||||||
|
}
|
||||||
|
|
||||||
|
void spiDeselect(GPIO_TypeDef *ssPort, uint16_t ssPin)
|
||||||
|
{
|
||||||
|
HAL_GPIO_WritePin(ssPort, ssPin, GPIO_PIN_SET);
|
||||||
|
}
|
||||||
|
|
||||||
|
HAL_StatusTypeDef spiTxRx(const uint8_t *txData, uint8_t *rxData, uint16_t length)
|
||||||
|
{
|
||||||
|
if(pSpi == 0)
|
||||||
|
return HAL_ERROR;
|
||||||
|
|
||||||
|
if(length > SPI_BUF_LEN)
|
||||||
|
{
|
||||||
|
return HAL_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Initialize Tx data*/
|
||||||
|
if(txData != NULL)
|
||||||
|
{
|
||||||
|
memcpy(txBuf, txData, length );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
memset(txBuf, 0x00, length );
|
||||||
|
}
|
||||||
|
|
||||||
|
return HAL_SPI_TransmitReceive(pSpi, txBuf, (rxData != NULL) ? rxData : rxBuf, length, SPI_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
150
Software/Core/Src/stm32f3xx_hal_msp.c
Normal file
150
Software/Core/Src/stm32f3xx_hal_msp.c
Normal file
@ -0,0 +1,150 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32f3xx_hal_msp.c
|
||||||
|
* @brief This file provides code for the MSP Initialization
|
||||||
|
* and de-Initialization codes.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "main.h"
|
||||||
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN TD */
|
||||||
|
|
||||||
|
/* USER CODE END TD */
|
||||||
|
|
||||||
|
/* Private define ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Define */
|
||||||
|
|
||||||
|
/* USER CODE END Define */
|
||||||
|
|
||||||
|
/* Private macro -------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Macro */
|
||||||
|
|
||||||
|
/* USER CODE END Macro */
|
||||||
|
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PV */
|
||||||
|
|
||||||
|
/* USER CODE END PV */
|
||||||
|
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PFP */
|
||||||
|
|
||||||
|
/* USER CODE END PFP */
|
||||||
|
|
||||||
|
/* External functions --------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN ExternalFunctions */
|
||||||
|
|
||||||
|
/* USER CODE END ExternalFunctions */
|
||||||
|
|
||||||
|
/* USER CODE BEGIN 0 */
|
||||||
|
|
||||||
|
/* USER CODE END 0 */
|
||||||
|
/**
|
||||||
|
* Initializes the Global MSP.
|
||||||
|
*/
|
||||||
|
void HAL_MspInit(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN MspInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END MspInit 0 */
|
||||||
|
|
||||||
|
__HAL_RCC_SYSCFG_CLK_ENABLE();
|
||||||
|
__HAL_RCC_PWR_CLK_ENABLE();
|
||||||
|
|
||||||
|
HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_0);
|
||||||
|
|
||||||
|
/* System interrupt init*/
|
||||||
|
|
||||||
|
/* USER CODE BEGIN MspInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END MspInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief SPI MSP Initialization
|
||||||
|
* This function configures the hardware resources used in this example
|
||||||
|
* @param hspi: SPI handle pointer
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
|
||||||
|
{
|
||||||
|
GPIO_InitTypeDef GPIO_InitStruct = {0};
|
||||||
|
if(hspi->Instance==SPI1)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN SPI1_MspInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END SPI1_MspInit 0 */
|
||||||
|
/* Peripheral clock enable */
|
||||||
|
__HAL_RCC_SPI1_CLK_ENABLE();
|
||||||
|
|
||||||
|
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||||
|
/**SPI1 GPIO Configuration
|
||||||
|
PA5 ------> SPI1_SCK
|
||||||
|
PA6 ------> SPI1_MISO
|
||||||
|
PA7 ------> SPI1_MOSI
|
||||||
|
*/
|
||||||
|
GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||||
|
GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
|
||||||
|
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN SPI1_MspInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END SPI1_MspInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief SPI MSP De-Initialization
|
||||||
|
* This function freeze the hardware resources used in this example
|
||||||
|
* @param hspi: SPI handle pointer
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
|
||||||
|
{
|
||||||
|
if(hspi->Instance==SPI1)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN SPI1_MspDeInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END SPI1_MspDeInit 0 */
|
||||||
|
/* Peripheral clock disable */
|
||||||
|
__HAL_RCC_SPI1_CLK_DISABLE();
|
||||||
|
|
||||||
|
/**SPI1 GPIO Configuration
|
||||||
|
PA5 ------> SPI1_SCK
|
||||||
|
PA6 ------> SPI1_MISO
|
||||||
|
PA7 ------> SPI1_MOSI
|
||||||
|
*/
|
||||||
|
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN SPI1_MspDeInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END SPI1_MspDeInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* USER CODE BEGIN 1 */
|
||||||
|
|
||||||
|
/* USER CODE END 1 */
|
203
Software/Core/Src/stm32f3xx_it.c
Normal file
203
Software/Core/Src/stm32f3xx_it.c
Normal file
@ -0,0 +1,203 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32f3xx_it.c
|
||||||
|
* @brief Interrupt Service Routines.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "main.h"
|
||||||
|
#include "stm32f3xx_it.h"
|
||||||
|
/* Private includes ----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Includes */
|
||||||
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN TD */
|
||||||
|
|
||||||
|
/* USER CODE END TD */
|
||||||
|
|
||||||
|
/* Private define ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PD */
|
||||||
|
|
||||||
|
/* USER CODE END PD */
|
||||||
|
|
||||||
|
/* Private macro -------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PM */
|
||||||
|
|
||||||
|
/* USER CODE END PM */
|
||||||
|
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PV */
|
||||||
|
|
||||||
|
/* USER CODE END PV */
|
||||||
|
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PFP */
|
||||||
|
|
||||||
|
/* USER CODE END PFP */
|
||||||
|
|
||||||
|
/* Private user code ---------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN 0 */
|
||||||
|
|
||||||
|
/* USER CODE END 0 */
|
||||||
|
|
||||||
|
/* External variables --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* USER CODE BEGIN EV */
|
||||||
|
|
||||||
|
/* USER CODE END EV */
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* Cortex-M4 Processor Interruption and Exception Handlers */
|
||||||
|
/******************************************************************************/
|
||||||
|
/**
|
||||||
|
* @brief This function handles Non maskable interrupt.
|
||||||
|
*/
|
||||||
|
void NMI_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN NonMaskableInt_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END NonMaskableInt_IRQn 0 */
|
||||||
|
/* USER CODE BEGIN NonMaskableInt_IRQn 1 */
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
/* USER CODE END NonMaskableInt_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles Hard fault interrupt.
|
||||||
|
*/
|
||||||
|
void HardFault_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN HardFault_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END HardFault_IRQn 0 */
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN W1_HardFault_IRQn 0 */
|
||||||
|
/* USER CODE END W1_HardFault_IRQn 0 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles Memory management fault.
|
||||||
|
*/
|
||||||
|
void MemManage_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN MemoryManagement_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END MemoryManagement_IRQn 0 */
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
|
||||||
|
/* USER CODE END W1_MemoryManagement_IRQn 0 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles Pre-fetch fault, memory access fault.
|
||||||
|
*/
|
||||||
|
void BusFault_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN BusFault_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END BusFault_IRQn 0 */
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN W1_BusFault_IRQn 0 */
|
||||||
|
/* USER CODE END W1_BusFault_IRQn 0 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles Undefined instruction or illegal state.
|
||||||
|
*/
|
||||||
|
void UsageFault_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN UsageFault_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END UsageFault_IRQn 0 */
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN W1_UsageFault_IRQn 0 */
|
||||||
|
/* USER CODE END W1_UsageFault_IRQn 0 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles System service call via SWI instruction.
|
||||||
|
*/
|
||||||
|
void SVC_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN SVCall_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END SVCall_IRQn 0 */
|
||||||
|
/* USER CODE BEGIN SVCall_IRQn 1 */
|
||||||
|
|
||||||
|
/* USER CODE END SVCall_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles Debug monitor.
|
||||||
|
*/
|
||||||
|
void DebugMon_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN DebugMonitor_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END DebugMonitor_IRQn 0 */
|
||||||
|
/* USER CODE BEGIN DebugMonitor_IRQn 1 */
|
||||||
|
|
||||||
|
/* USER CODE END DebugMonitor_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles Pendable request for system service.
|
||||||
|
*/
|
||||||
|
void PendSV_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN PendSV_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END PendSV_IRQn 0 */
|
||||||
|
/* USER CODE BEGIN PendSV_IRQn 1 */
|
||||||
|
|
||||||
|
/* USER CODE END PendSV_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles System tick timer.
|
||||||
|
*/
|
||||||
|
void SysTick_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN SysTick_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END SysTick_IRQn 0 */
|
||||||
|
HAL_IncTick();
|
||||||
|
/* USER CODE BEGIN SysTick_IRQn 1 */
|
||||||
|
|
||||||
|
/* USER CODE END SysTick_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* STM32F3xx Peripheral Interrupt Handlers */
|
||||||
|
/* Add here the Interrupt Handlers for the used peripherals. */
|
||||||
|
/* For the available peripheral interrupt handler names, */
|
||||||
|
/* please refer to the startup file (startup_stm32f3xx.s). */
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/* USER CODE BEGIN 1 */
|
||||||
|
|
||||||
|
/* USER CODE END 1 */
|
155
Software/Core/Src/syscalls.c
Normal file
155
Software/Core/Src/syscalls.c
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file syscalls.c
|
||||||
|
* @author Auto-generated by STM32CubeIDE
|
||||||
|
* @brief STM32CubeIDE Minimal System calls file
|
||||||
|
*
|
||||||
|
* For more information about which c-functions
|
||||||
|
* need which of these lowlevel functions
|
||||||
|
* please consult the Newlib libc-manual
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes */
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/times.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* Variables */
|
||||||
|
extern int __io_putchar(int ch) __attribute__((weak));
|
||||||
|
extern int __io_getchar(void) __attribute__((weak));
|
||||||
|
|
||||||
|
|
||||||
|
char *__env[1] = { 0 };
|
||||||
|
char **environ = __env;
|
||||||
|
|
||||||
|
|
||||||
|
/* Functions */
|
||||||
|
void initialise_monitor_handles()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int _getpid(void)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _kill(int pid, int sig)
|
||||||
|
{
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void _exit (int status)
|
||||||
|
{
|
||||||
|
_kill(status, -1);
|
||||||
|
while (1) {} /* Make sure we hang here */
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak)) int _read(int file, char *ptr, int len)
|
||||||
|
{
|
||||||
|
int DataIdx;
|
||||||
|
|
||||||
|
for (DataIdx = 0; DataIdx < len; DataIdx++)
|
||||||
|
{
|
||||||
|
*ptr++ = __io_getchar();
|
||||||
|
}
|
||||||
|
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak)) int _write(int file, char *ptr, int len)
|
||||||
|
{
|
||||||
|
int DataIdx;
|
||||||
|
|
||||||
|
for (DataIdx = 0; DataIdx < len; DataIdx++)
|
||||||
|
{
|
||||||
|
__io_putchar(*ptr++);
|
||||||
|
}
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _close(int file)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int _fstat(int file, struct stat *st)
|
||||||
|
{
|
||||||
|
st->st_mode = S_IFCHR;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _isatty(int file)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _lseek(int file, int ptr, int dir)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _open(char *path, int flags, ...)
|
||||||
|
{
|
||||||
|
/* Pretend like we always fail */
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _wait(int *status)
|
||||||
|
{
|
||||||
|
errno = ECHILD;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _unlink(char *name)
|
||||||
|
{
|
||||||
|
errno = ENOENT;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _times(struct tms *buf)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _stat(char *file, struct stat *st)
|
||||||
|
{
|
||||||
|
st->st_mode = S_IFCHR;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _link(char *old, char *new)
|
||||||
|
{
|
||||||
|
errno = EMLINK;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _fork(void)
|
||||||
|
{
|
||||||
|
errno = EAGAIN;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _execve(char *name, char **argv, char **env)
|
||||||
|
{
|
||||||
|
errno = ENOMEM;
|
||||||
|
return -1;
|
||||||
|
}
|
79
Software/Core/Src/sysmem.c
Normal file
79
Software/Core/Src/sysmem.c
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file sysmem.c
|
||||||
|
* @author Generated by STM32CubeIDE
|
||||||
|
* @brief STM32CubeIDE System Memory calls file
|
||||||
|
*
|
||||||
|
* For more information about which C functions
|
||||||
|
* need which of these lowlevel functions
|
||||||
|
* please consult the newlib libc manual
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes */
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pointer to the current high watermark of the heap usage
|
||||||
|
*/
|
||||||
|
static uint8_t *__sbrk_heap_end = NULL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief _sbrk() allocates memory to the newlib heap and is used by malloc
|
||||||
|
* and others from the C library
|
||||||
|
*
|
||||||
|
* @verbatim
|
||||||
|
* ############################################################################
|
||||||
|
* # .data # .bss # newlib heap # MSP stack #
|
||||||
|
* # # # # Reserved by _Min_Stack_Size #
|
||||||
|
* ############################################################################
|
||||||
|
* ^-- RAM start ^-- _end _estack, RAM end --^
|
||||||
|
* @endverbatim
|
||||||
|
*
|
||||||
|
* This implementation starts allocating at the '_end' linker symbol
|
||||||
|
* The '_Min_Stack_Size' linker symbol reserves a memory for the MSP stack
|
||||||
|
* The implementation considers '_estack' linker symbol to be RAM end
|
||||||
|
* NOTE: If the MSP stack, at any point during execution, grows larger than the
|
||||||
|
* reserved size, please increase the '_Min_Stack_Size'.
|
||||||
|
*
|
||||||
|
* @param incr Memory size
|
||||||
|
* @return Pointer to allocated memory
|
||||||
|
*/
|
||||||
|
void *_sbrk(ptrdiff_t incr)
|
||||||
|
{
|
||||||
|
extern uint8_t _end; /* Symbol defined in the linker script */
|
||||||
|
extern uint8_t _estack; /* Symbol defined in the linker script */
|
||||||
|
extern uint32_t _Min_Stack_Size; /* Symbol defined in the linker script */
|
||||||
|
const uint32_t stack_limit = (uint32_t)&_estack - (uint32_t)&_Min_Stack_Size;
|
||||||
|
const uint8_t *max_heap = (uint8_t *)stack_limit;
|
||||||
|
uint8_t *prev_heap_end;
|
||||||
|
|
||||||
|
/* Initialize heap end at first call */
|
||||||
|
if (NULL == __sbrk_heap_end)
|
||||||
|
{
|
||||||
|
__sbrk_heap_end = &_end;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Protect heap from growing into the reserved MSP stack */
|
||||||
|
if (__sbrk_heap_end + incr > max_heap)
|
||||||
|
{
|
||||||
|
errno = ENOMEM;
|
||||||
|
return (void *)-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
prev_heap_end = __sbrk_heap_end;
|
||||||
|
__sbrk_heap_end += incr;
|
||||||
|
|
||||||
|
return (void *)prev_heap_end;
|
||||||
|
}
|
291
Software/Core/Src/system_stm32f3xx.c
Normal file
291
Software/Core/Src/system_stm32f3xx.c
Normal file
@ -0,0 +1,291 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file system_stm32f3xx.c
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File.
|
||||||
|
*
|
||||||
|
* 1. This file provides two functions and one global variable to be called from
|
||||||
|
* user application:
|
||||||
|
* - SystemInit(): This function is called at startup just after reset and
|
||||||
|
* before branch to main program. This call is made inside
|
||||||
|
* the "startup_stm32f3xx.s" file.
|
||||||
|
*
|
||||||
|
* - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
|
||||||
|
* by the user application to setup the SysTick
|
||||||
|
* timer or configure other parameters.
|
||||||
|
*
|
||||||
|
* - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
|
||||||
|
* be called whenever the core clock is changed
|
||||||
|
* during program execution.
|
||||||
|
*
|
||||||
|
* 2. After each device reset the HSI (8 MHz) is used as system clock source.
|
||||||
|
* Then SystemInit() function is called, in "startup_stm32f3xx.s" file, to
|
||||||
|
* configure the system clock before to branch to main program.
|
||||||
|
*
|
||||||
|
* 3. This file configures the system clock as follows:
|
||||||
|
*=============================================================================
|
||||||
|
* Supported STM32F3xx device
|
||||||
|
*-----------------------------------------------------------------------------
|
||||||
|
* System Clock source | HSI
|
||||||
|
*-----------------------------------------------------------------------------
|
||||||
|
* SYSCLK(Hz) | 8000000
|
||||||
|
*-----------------------------------------------------------------------------
|
||||||
|
* HCLK(Hz) | 8000000
|
||||||
|
*-----------------------------------------------------------------------------
|
||||||
|
* AHB Prescaler | 1
|
||||||
|
*-----------------------------------------------------------------------------
|
||||||
|
* APB2 Prescaler | 1
|
||||||
|
*-----------------------------------------------------------------------------
|
||||||
|
* APB1 Prescaler | 1
|
||||||
|
*-----------------------------------------------------------------------------
|
||||||
|
* USB Clock | DISABLE
|
||||||
|
*-----------------------------------------------------------------------------
|
||||||
|
*=============================================================================
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* <h2><center>© Copyright (c) 2016 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
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup CMSIS
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup stm32f3xx_system
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32F3xx_System_Private_Includes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "stm32f3xx.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32F3xx_System_Private_TypesDefinitions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32F3xx_System_Private_Defines
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#if !defined (HSE_VALUE)
|
||||||
|
#define HSE_VALUE ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz.
|
||||||
|
This value can be provided and adapted by the user application. */
|
||||||
|
#endif /* HSE_VALUE */
|
||||||
|
|
||||||
|
#if !defined (HSI_VALUE)
|
||||||
|
#define HSI_VALUE ((uint32_t)8000000) /*!< Default value of the Internal oscillator in Hz.
|
||||||
|
This value can be provided and adapted by the user application. */
|
||||||
|
#endif /* HSI_VALUE */
|
||||||
|
|
||||||
|
/* Note: Following vector table addresses must be defined in line with linker
|
||||||
|
configuration. */
|
||||||
|
/*!< Uncomment the following line if you need to relocate the vector table
|
||||||
|
anywhere in Flash or Sram, else the vector table is kept at the automatic
|
||||||
|
remap of boot address selected */
|
||||||
|
/* #define USER_VECT_TAB_ADDRESS */
|
||||||
|
|
||||||
|
#if defined(USER_VECT_TAB_ADDRESS)
|
||||||
|
/*!< Uncomment the following line if you need to relocate your vector Table
|
||||||
|
in Sram else user remap will be done in Flash. */
|
||||||
|
/* #define VECT_TAB_SRAM */
|
||||||
|
#if defined(VECT_TAB_SRAM)
|
||||||
|
#define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field.
|
||||||
|
This value must be a multiple of 0x200. */
|
||||||
|
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
|
||||||
|
This value must be a multiple of 0x200. */
|
||||||
|
#else
|
||||||
|
#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field.
|
||||||
|
This value must be a multiple of 0x200. */
|
||||||
|
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
|
||||||
|
This value must be a multiple of 0x200. */
|
||||||
|
#endif /* VECT_TAB_SRAM */
|
||||||
|
#endif /* USER_VECT_TAB_ADDRESS */
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32F3xx_System_Private_Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32F3xx_System_Private_Variables
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* This variable is updated in three ways:
|
||||||
|
1) by calling CMSIS function SystemCoreClockUpdate()
|
||||||
|
2) by calling HAL API function HAL_RCC_GetHCLKFreq()
|
||||||
|
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
|
||||||
|
Note: If you use this function to configure the system clock there is no need to
|
||||||
|
call the 2 first functions listed above, since SystemCoreClock variable is
|
||||||
|
updated automatically.
|
||||||
|
*/
|
||||||
|
uint32_t SystemCoreClock = 8000000;
|
||||||
|
|
||||||
|
const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
|
||||||
|
const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32F3xx_System_Private_FunctionPrototypes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32F3xx_System_Private_Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Setup the microcontroller system
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void SystemInit(void)
|
||||||
|
{
|
||||||
|
/* FPU settings --------------------------------------------------------------*/
|
||||||
|
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
|
||||||
|
SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Configure the Vector Table location -------------------------------------*/
|
||||||
|
#if defined(USER_VECT_TAB_ADDRESS)
|
||||||
|
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
|
||||||
|
#endif /* USER_VECT_TAB_ADDRESS */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Update SystemCoreClock variable according to Clock Register Values.
|
||||||
|
* The SystemCoreClock variable contains the core clock (HCLK), it can
|
||||||
|
* be used by the user application to setup the SysTick timer or configure
|
||||||
|
* other parameters.
|
||||||
|
*
|
||||||
|
* @note Each time the core clock (HCLK) changes, this function must be called
|
||||||
|
* to update SystemCoreClock variable value. Otherwise, any configuration
|
||||||
|
* based on this variable will be incorrect.
|
||||||
|
*
|
||||||
|
* @note - The system frequency computed by this function is not the real
|
||||||
|
* frequency in the chip. It is calculated based on the predefined
|
||||||
|
* constant and the selected clock source:
|
||||||
|
*
|
||||||
|
* - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*)
|
||||||
|
*
|
||||||
|
* - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**)
|
||||||
|
*
|
||||||
|
* - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**)
|
||||||
|
* or HSI_VALUE(*) multiplied/divided by the PLL factors.
|
||||||
|
*
|
||||||
|
* (*) HSI_VALUE is a constant defined in stm32f3xx_hal.h file (default value
|
||||||
|
* 8 MHz) but the real value may vary depending on the variations
|
||||||
|
* in voltage and temperature.
|
||||||
|
*
|
||||||
|
* (**) HSE_VALUE is a constant defined in stm32f3xx_hal.h file (default value
|
||||||
|
* 8 MHz), user has to ensure that HSE_VALUE is same as the real
|
||||||
|
* frequency of the crystal used. Otherwise, this function may
|
||||||
|
* have wrong result.
|
||||||
|
*
|
||||||
|
* - The result of this function could be not correct when using fractional
|
||||||
|
* value for HSE crystal.
|
||||||
|
*
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void SystemCoreClockUpdate (void)
|
||||||
|
{
|
||||||
|
uint32_t tmp = 0, pllmull = 0, pllsource = 0, predivfactor = 0;
|
||||||
|
|
||||||
|
/* Get SYSCLK source -------------------------------------------------------*/
|
||||||
|
tmp = RCC->CFGR & RCC_CFGR_SWS;
|
||||||
|
|
||||||
|
switch (tmp)
|
||||||
|
{
|
||||||
|
case RCC_CFGR_SWS_HSI: /* HSI used as system clock */
|
||||||
|
SystemCoreClock = HSI_VALUE;
|
||||||
|
break;
|
||||||
|
case RCC_CFGR_SWS_HSE: /* HSE used as system clock */
|
||||||
|
SystemCoreClock = HSE_VALUE;
|
||||||
|
break;
|
||||||
|
case RCC_CFGR_SWS_PLL: /* PLL used as system clock */
|
||||||
|
/* Get PLL clock source and multiplication factor ----------------------*/
|
||||||
|
pllmull = RCC->CFGR & RCC_CFGR_PLLMUL;
|
||||||
|
pllsource = RCC->CFGR & RCC_CFGR_PLLSRC;
|
||||||
|
pllmull = ( pllmull >> 18) + 2;
|
||||||
|
|
||||||
|
#if defined (STM32F302xE) || defined (STM32F303xE) || defined (STM32F398xx)
|
||||||
|
predivfactor = (RCC->CFGR2 & RCC_CFGR2_PREDIV) + 1;
|
||||||
|
if (pllsource == RCC_CFGR_PLLSRC_HSE_PREDIV)
|
||||||
|
{
|
||||||
|
/* HSE oscillator clock selected as PREDIV1 clock entry */
|
||||||
|
SystemCoreClock = (HSE_VALUE / predivfactor) * pllmull;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* HSI oscillator clock selected as PREDIV1 clock entry */
|
||||||
|
SystemCoreClock = (HSI_VALUE / predivfactor) * pllmull;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if (pllsource == RCC_CFGR_PLLSRC_HSI_DIV2)
|
||||||
|
{
|
||||||
|
/* HSI oscillator clock divided by 2 selected as PLL clock entry */
|
||||||
|
SystemCoreClock = (HSI_VALUE >> 1) * pllmull;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
predivfactor = (RCC->CFGR2 & RCC_CFGR2_PREDIV) + 1;
|
||||||
|
/* HSE oscillator clock selected as PREDIV1 clock entry */
|
||||||
|
SystemCoreClock = (HSE_VALUE / predivfactor) * pllmull;
|
||||||
|
}
|
||||||
|
#endif /* STM32F302xE || STM32F303xE || STM32F398xx */
|
||||||
|
break;
|
||||||
|
default: /* HSI used as system clock */
|
||||||
|
SystemCoreClock = HSI_VALUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* Compute HCLK clock frequency ----------------*/
|
||||||
|
/* Get HCLK prescaler */
|
||||||
|
tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)];
|
||||||
|
/* HCLK clock frequency */
|
||||||
|
SystemCoreClock >>= tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||||
|
|
109
Software/Core/Src/usart.c
Normal file
109
Software/Core/Src/usart.c
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* \attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2019 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author
|
||||||
|
*
|
||||||
|
* \brief UART communication handling implementation.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "usart.h"
|
||||||
|
#include "st_errno.h"
|
||||||
|
|
||||||
|
#define USART_TIMEOUT 1000
|
||||||
|
|
||||||
|
UART_HandleTypeDef *pUsart = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function initalize the UART handle.
|
||||||
|
* @param husart : already initalized handle to USART HW
|
||||||
|
* @retval none :
|
||||||
|
*/
|
||||||
|
void UsartInit(UART_HandleTypeDef *husart)
|
||||||
|
{
|
||||||
|
pUsart = husart;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function Transmit one data byte via USART
|
||||||
|
* @param data : data to be transmitted
|
||||||
|
* @retval ERR_INVALID_HANDLE : in case the SPI HW is not initalized yet
|
||||||
|
* @retval others : HAL status
|
||||||
|
*/
|
||||||
|
uint8_t UsartTxByte(uint8_t data)
|
||||||
|
{
|
||||||
|
if(pUsart == 0)
|
||||||
|
return ERR_INVALID_HANDLE;
|
||||||
|
|
||||||
|
return HAL_UART_Transmit(pUsart, &data, 1, USART_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function Transmit data via USART
|
||||||
|
* @param data : data to be transmitted
|
||||||
|
* @param dataLen : length of data to be transmitted
|
||||||
|
* @retval ERR_INVALID_HANDLE : in case the SPI HW is not initalized yet
|
||||||
|
* @retval others : HAL status
|
||||||
|
*/
|
||||||
|
uint8_t UsartTx(uint8_t *data, uint16_t dataLen)
|
||||||
|
{
|
||||||
|
if(pUsart == 0)
|
||||||
|
return ERR_INVALID_HANDLE;
|
||||||
|
|
||||||
|
return HAL_UART_Transmit(pUsart, data, dataLen, USART_TIMEOUT);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function Receive data via USART
|
||||||
|
* @param data : data where received data shall be stored
|
||||||
|
* @param dataLen : length of received data
|
||||||
|
* @retval ERR_INVALID_HANDLE : in case the SPI HW is not initalized yet
|
||||||
|
* @retval others : HAL status
|
||||||
|
*/
|
||||||
|
uint8_t UsartRx(uint8_t *data, uint16_t *dataLen)
|
||||||
|
{
|
||||||
|
uint8_t err = ERR_NONE;
|
||||||
|
|
||||||
|
if(pUsart == 0)
|
||||||
|
return ERR_INVALID_HANDLE;
|
||||||
|
|
||||||
|
for(uint8_t i = 0; i < *dataLen; i++) {
|
||||||
|
err |= HAL_UART_Receive(pUsart, &data[i], 1, USART_TIMEOUT);
|
||||||
|
if(data[i] == 0) {
|
||||||
|
*dataLen = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
492
Software/Core/Startup/startup_stm32f303retx.s
Normal file
492
Software/Core/Startup/startup_stm32f303retx.s
Normal file
@ -0,0 +1,492 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file startup_stm32f303xe.s
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief STM32F303xE devices vector table for GCC toolchain.
|
||||||
|
* This module performs:
|
||||||
|
* - Set the initial SP
|
||||||
|
* - Set the initial PC == Reset_Handler,
|
||||||
|
* - Set the vector table entries with the exceptions ISR address,
|
||||||
|
* - Configure the clock system
|
||||||
|
* - Branches to main in the C library (which eventually
|
||||||
|
* calls main()).
|
||||||
|
* After Reset the Cortex-M4 processor is in Thread mode,
|
||||||
|
* priority is Privileged, and the Stack is set to Main.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* <h2><center>© Copyright (c) 2016 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
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
.syntax unified
|
||||||
|
.cpu cortex-m4
|
||||||
|
.fpu softvfp
|
||||||
|
.thumb
|
||||||
|
|
||||||
|
.global g_pfnVectors
|
||||||
|
.global Default_Handler
|
||||||
|
|
||||||
|
/* start address for the initialization values of the .data section.
|
||||||
|
defined in linker script */
|
||||||
|
.word _sidata
|
||||||
|
/* start address for the .data section. defined in linker script */
|
||||||
|
.word _sdata
|
||||||
|
/* end address for the .data section. defined in linker script */
|
||||||
|
.word _edata
|
||||||
|
/* start address for the .bss section. defined in linker script */
|
||||||
|
.word _sbss
|
||||||
|
/* end address for the .bss section. defined in linker script */
|
||||||
|
.word _ebss
|
||||||
|
|
||||||
|
.equ BootRAM, 0xF1E0F85F
|
||||||
|
/**
|
||||||
|
* @brief This is the code that gets called when the processor first
|
||||||
|
* starts execution following a reset event. Only the absolutely
|
||||||
|
* necessary set is performed, after which the application
|
||||||
|
* supplied main() routine is called.
|
||||||
|
* @param None
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
|
||||||
|
.section .text.Reset_Handler
|
||||||
|
.weak Reset_Handler
|
||||||
|
.type Reset_Handler, %function
|
||||||
|
Reset_Handler:
|
||||||
|
ldr sp, =_estack /* Atollic update: set stack pointer */
|
||||||
|
|
||||||
|
/* Copy the data segment initializers from flash to SRAM */
|
||||||
|
ldr r0, =_sdata
|
||||||
|
ldr r1, =_edata
|
||||||
|
ldr r2, =_sidata
|
||||||
|
movs r3, #0
|
||||||
|
b LoopCopyDataInit
|
||||||
|
|
||||||
|
CopyDataInit:
|
||||||
|
ldr r4, [r2, r3]
|
||||||
|
str r4, [r0, r3]
|
||||||
|
adds r3, r3, #4
|
||||||
|
|
||||||
|
LoopCopyDataInit:
|
||||||
|
adds r4, r0, r3
|
||||||
|
cmp r4, r1
|
||||||
|
bcc CopyDataInit
|
||||||
|
|
||||||
|
/* Zero fill the bss segment. */
|
||||||
|
ldr r2, =_sbss
|
||||||
|
ldr r4, =_ebss
|
||||||
|
movs r3, #0
|
||||||
|
b LoopFillZerobss
|
||||||
|
|
||||||
|
FillZerobss:
|
||||||
|
str r3, [r2]
|
||||||
|
adds r2, r2, #4
|
||||||
|
|
||||||
|
LoopFillZerobss:
|
||||||
|
cmp r2, r4
|
||||||
|
bcc FillZerobss
|
||||||
|
|
||||||
|
/* Call the clock system intitialization function.*/
|
||||||
|
bl SystemInit
|
||||||
|
/* Call static constructors */
|
||||||
|
bl __libc_init_array
|
||||||
|
/* Call the application's entry point.*/
|
||||||
|
bl main
|
||||||
|
|
||||||
|
LoopForever:
|
||||||
|
b LoopForever
|
||||||
|
|
||||||
|
.size Reset_Handler, .-Reset_Handler
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This is the code that gets called when the processor receives an
|
||||||
|
* unexpected interrupt. This simply enters an infinite loop, preserving
|
||||||
|
* the system state for examination by a debugger.
|
||||||
|
*
|
||||||
|
* @param None
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
.section .text.Default_Handler,"ax",%progbits
|
||||||
|
Default_Handler:
|
||||||
|
Infinite_Loop:
|
||||||
|
b Infinite_Loop
|
||||||
|
.size Default_Handler, .-Default_Handler
|
||||||
|
/******************************************************************************
|
||||||
|
*
|
||||||
|
* The minimal vector table for a Cortex-M4. Note that the proper constructs
|
||||||
|
* must be placed on this to ensure that it ends up at physical address
|
||||||
|
* 0x0000.0000.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
.section .isr_vector,"a",%progbits
|
||||||
|
.type g_pfnVectors, %object
|
||||||
|
.size g_pfnVectors, .-g_pfnVectors
|
||||||
|
|
||||||
|
|
||||||
|
g_pfnVectors:
|
||||||
|
.word _estack
|
||||||
|
.word Reset_Handler
|
||||||
|
.word NMI_Handler
|
||||||
|
.word HardFault_Handler
|
||||||
|
.word MemManage_Handler
|
||||||
|
.word BusFault_Handler
|
||||||
|
.word UsageFault_Handler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word SVC_Handler
|
||||||
|
.word DebugMon_Handler
|
||||||
|
.word 0
|
||||||
|
.word PendSV_Handler
|
||||||
|
.word SysTick_Handler
|
||||||
|
.word WWDG_IRQHandler
|
||||||
|
.word PVD_IRQHandler
|
||||||
|
.word TAMP_STAMP_IRQHandler
|
||||||
|
.word RTC_WKUP_IRQHandler
|
||||||
|
.word FLASH_IRQHandler
|
||||||
|
.word RCC_IRQHandler
|
||||||
|
.word EXTI0_IRQHandler
|
||||||
|
.word EXTI1_IRQHandler
|
||||||
|
.word EXTI2_TSC_IRQHandler
|
||||||
|
.word EXTI3_IRQHandler
|
||||||
|
.word EXTI4_IRQHandler
|
||||||
|
.word DMA1_Channel1_IRQHandler
|
||||||
|
.word DMA1_Channel2_IRQHandler
|
||||||
|
.word DMA1_Channel3_IRQHandler
|
||||||
|
.word DMA1_Channel4_IRQHandler
|
||||||
|
.word DMA1_Channel5_IRQHandler
|
||||||
|
.word DMA1_Channel6_IRQHandler
|
||||||
|
.word DMA1_Channel7_IRQHandler
|
||||||
|
.word ADC1_2_IRQHandler
|
||||||
|
.word USB_HP_CAN_TX_IRQHandler
|
||||||
|
.word USB_LP_CAN_RX0_IRQHandler
|
||||||
|
.word CAN_RX1_IRQHandler
|
||||||
|
.word CAN_SCE_IRQHandler
|
||||||
|
.word EXTI9_5_IRQHandler
|
||||||
|
.word TIM1_BRK_TIM15_IRQHandler
|
||||||
|
.word TIM1_UP_TIM16_IRQHandler
|
||||||
|
.word TIM1_TRG_COM_TIM17_IRQHandler
|
||||||
|
.word TIM1_CC_IRQHandler
|
||||||
|
.word TIM2_IRQHandler
|
||||||
|
.word TIM3_IRQHandler
|
||||||
|
.word TIM4_IRQHandler
|
||||||
|
.word I2C1_EV_IRQHandler
|
||||||
|
.word I2C1_ER_IRQHandler
|
||||||
|
.word I2C2_EV_IRQHandler
|
||||||
|
.word I2C2_ER_IRQHandler
|
||||||
|
.word SPI1_IRQHandler
|
||||||
|
.word SPI2_IRQHandler
|
||||||
|
.word USART1_IRQHandler
|
||||||
|
.word USART2_IRQHandler
|
||||||
|
.word USART3_IRQHandler
|
||||||
|
.word EXTI15_10_IRQHandler
|
||||||
|
.word RTC_Alarm_IRQHandler
|
||||||
|
.word USBWakeUp_IRQHandler
|
||||||
|
.word TIM8_BRK_IRQHandler
|
||||||
|
.word TIM8_UP_IRQHandler
|
||||||
|
.word TIM8_TRG_COM_IRQHandler
|
||||||
|
.word TIM8_CC_IRQHandler
|
||||||
|
.word ADC3_IRQHandler
|
||||||
|
.word FMC_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word SPI3_IRQHandler
|
||||||
|
.word UART4_IRQHandler
|
||||||
|
.word UART5_IRQHandler
|
||||||
|
.word TIM6_DAC_IRQHandler
|
||||||
|
.word TIM7_IRQHandler
|
||||||
|
.word DMA2_Channel1_IRQHandler
|
||||||
|
.word DMA2_Channel2_IRQHandler
|
||||||
|
.word DMA2_Channel3_IRQHandler
|
||||||
|
.word DMA2_Channel4_IRQHandler
|
||||||
|
.word DMA2_Channel5_IRQHandler
|
||||||
|
.word ADC4_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word COMP1_2_3_IRQHandler
|
||||||
|
.word COMP4_5_6_IRQHandler
|
||||||
|
.word COMP7_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word I2C3_EV_IRQHandler
|
||||||
|
.word I2C3_ER_IRQHandler
|
||||||
|
.word USB_HP_IRQHandler
|
||||||
|
.word USB_LP_IRQHandler
|
||||||
|
.word USBWakeUp_RMP_IRQHandler
|
||||||
|
.word TIM20_BRK_IRQHandler
|
||||||
|
.word TIM20_UP_IRQHandler
|
||||||
|
.word TIM20_TRG_COM_IRQHandler
|
||||||
|
.word TIM20_CC_IRQHandler
|
||||||
|
.word FPU_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word SPI4_IRQHandler
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* Provide weak aliases for each Exception handler to the Default_Handler.
|
||||||
|
* As they are weak aliases, any function with the same name will override
|
||||||
|
* this definition.
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
.weak NMI_Handler
|
||||||
|
.thumb_set NMI_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak HardFault_Handler
|
||||||
|
.thumb_set HardFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak MemManage_Handler
|
||||||
|
.thumb_set MemManage_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak BusFault_Handler
|
||||||
|
.thumb_set BusFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak UsageFault_Handler
|
||||||
|
.thumb_set UsageFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak SVC_Handler
|
||||||
|
.thumb_set SVC_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak DebugMon_Handler
|
||||||
|
.thumb_set DebugMon_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak PendSV_Handler
|
||||||
|
.thumb_set PendSV_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak SysTick_Handler
|
||||||
|
.thumb_set SysTick_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak WWDG_IRQHandler
|
||||||
|
.thumb_set WWDG_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak PVD_IRQHandler
|
||||||
|
.thumb_set PVD_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TAMP_STAMP_IRQHandler
|
||||||
|
.thumb_set TAMP_STAMP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RTC_WKUP_IRQHandler
|
||||||
|
.thumb_set RTC_WKUP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FLASH_IRQHandler
|
||||||
|
.thumb_set FLASH_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RCC_IRQHandler
|
||||||
|
.thumb_set RCC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI0_IRQHandler
|
||||||
|
.thumb_set EXTI0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI1_IRQHandler
|
||||||
|
.thumb_set EXTI1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI2_TSC_IRQHandler
|
||||||
|
.thumb_set EXTI2_TSC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI3_IRQHandler
|
||||||
|
.thumb_set EXTI3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI4_IRQHandler
|
||||||
|
.thumb_set EXTI4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel1_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel2_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel3_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel4_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel5_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel6_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel7_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ADC1_2_IRQHandler
|
||||||
|
.thumb_set ADC1_2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USB_HP_CAN_TX_IRQHandler
|
||||||
|
.thumb_set USB_HP_CAN_TX_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USB_LP_CAN_RX0_IRQHandler
|
||||||
|
.thumb_set USB_LP_CAN_RX0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CAN_RX1_IRQHandler
|
||||||
|
.thumb_set CAN_RX1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CAN_SCE_IRQHandler
|
||||||
|
.thumb_set CAN_SCE_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI9_5_IRQHandler
|
||||||
|
.thumb_set EXTI9_5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_BRK_TIM15_IRQHandler
|
||||||
|
.thumb_set TIM1_BRK_TIM15_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_UP_TIM16_IRQHandler
|
||||||
|
.thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_TRG_COM_TIM17_IRQHandler
|
||||||
|
.thumb_set TIM1_TRG_COM_TIM17_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_CC_IRQHandler
|
||||||
|
.thumb_set TIM1_CC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM2_IRQHandler
|
||||||
|
.thumb_set TIM2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM3_IRQHandler
|
||||||
|
.thumb_set TIM3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM4_IRQHandler
|
||||||
|
.thumb_set TIM4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C1_EV_IRQHandler
|
||||||
|
.thumb_set I2C1_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C1_ER_IRQHandler
|
||||||
|
.thumb_set I2C1_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C2_EV_IRQHandler
|
||||||
|
.thumb_set I2C2_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C2_ER_IRQHandler
|
||||||
|
.thumb_set I2C2_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI1_IRQHandler
|
||||||
|
.thumb_set SPI1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI2_IRQHandler
|
||||||
|
.thumb_set SPI2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART1_IRQHandler
|
||||||
|
.thumb_set USART1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART2_IRQHandler
|
||||||
|
.thumb_set USART2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART3_IRQHandler
|
||||||
|
.thumb_set USART3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI15_10_IRQHandler
|
||||||
|
.thumb_set EXTI15_10_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RTC_Alarm_IRQHandler
|
||||||
|
.thumb_set RTC_Alarm_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USBWakeUp_IRQHandler
|
||||||
|
.thumb_set USBWakeUp_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_BRK_IRQHandler
|
||||||
|
.thumb_set TIM8_BRK_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_UP_IRQHandler
|
||||||
|
.thumb_set TIM8_UP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_TRG_COM_IRQHandler
|
||||||
|
.thumb_set TIM8_TRG_COM_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_CC_IRQHandler
|
||||||
|
.thumb_set TIM8_CC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ADC3_IRQHandler
|
||||||
|
.thumb_set ADC3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FMC_IRQHandler
|
||||||
|
.thumb_set FMC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI3_IRQHandler
|
||||||
|
.thumb_set SPI3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak UART4_IRQHandler
|
||||||
|
.thumb_set UART4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak UART5_IRQHandler
|
||||||
|
.thumb_set UART5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM6_DAC_IRQHandler
|
||||||
|
.thumb_set TIM6_DAC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM7_IRQHandler
|
||||||
|
.thumb_set TIM7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel1_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel2_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel3_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel4_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel5_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ADC4_IRQHandler
|
||||||
|
.thumb_set ADC4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak COMP1_2_3_IRQHandler
|
||||||
|
.thumb_set COMP1_2_3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak COMP4_5_6_IRQHandler
|
||||||
|
.thumb_set COMP4_5_6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak COMP7_IRQHandler
|
||||||
|
.thumb_set COMP7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C3_EV_IRQHandler
|
||||||
|
.thumb_set I2C3_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C3_ER_IRQHandler
|
||||||
|
.thumb_set I2C3_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USB_HP_IRQHandler
|
||||||
|
.thumb_set USB_HP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USB_LP_IRQHandler
|
||||||
|
.thumb_set USB_LP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USBWakeUp_RMP_IRQHandler
|
||||||
|
.thumb_set USBWakeUp_RMP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM20_BRK_IRQHandler
|
||||||
|
.thumb_set TIM20_BRK_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM20_UP_IRQHandler
|
||||||
|
.thumb_set TIM20_UP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM20_TRG_COM_IRQHandler
|
||||||
|
.thumb_set TIM20_TRG_COM_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM20_CC_IRQHandler
|
||||||
|
.thumb_set TIM20_CC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FPU_IRQHandler
|
||||||
|
.thumb_set FPU_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI4_IRQHandler
|
||||||
|
.thumb_set SPI4_IRQHandler,Default_Handler
|
||||||
|
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
177
Software/Drivers/BSP/Components/ST25R3911/Release_Notes.html
Normal file
177
Software/Drivers/BSP/Components/ST25R3911/Release_Notes.html
Normal file
@ -0,0 +1,177 @@
|
|||||||
|
<!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 ST25R3911 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 ST25R3911 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 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>
|
||||||
|
<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;">V1.0.0
|
||||||
|
/ 15-March-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;">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;"><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>
|
655
Software/Drivers/BSP/Components/ST25R3911/st25r3911.c
Normal file
655
Software/Drivers/BSP/Components/ST25R3911/st25r3911.c
Normal file
@ -0,0 +1,655 @@
|
|||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* \attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PROJECT: ST25R3911 firmware
|
||||||
|
* Revision:
|
||||||
|
* LANGUAGE: ISO C99
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author Ulrich Herrmann
|
||||||
|
*
|
||||||
|
* \brief ST25R3911 high level interface
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "st25r3911.h"
|
||||||
|
#include "st25r3911_com.h"
|
||||||
|
#include "st25r3911_interrupt.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define ST25R3911_OSC_STABLE_TIMEOUT 10U /*!< Timeout for Oscillator to get stable, datasheet: 700us, take 5 ms */
|
||||||
|
#define ST25R3911_CA_TIMEOUT 10U /*!< Timeout for Collision Avoidance command */
|
||||||
|
#define ST25R3911_TOUT_CALIBRATE_CAP_SENSOR 4U /*!< Max duration Calibrate Capacitive Sensor command Datasheet: 3ms */
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL CONSTANTS
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL VARIABLES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
static uint32_t st25r3911NoResponseTime_64fcs;
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL FUNCTION PROTOTYPES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
static ReturnCode st25r3911ExecuteCommandAndGetResult(uint8_t cmd, uint8_t resreg, uint8_t sleeptime, uint8_t* result);
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL FUNCTIONS
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
void st25r3911TxRxOn( void )
|
||||||
|
{
|
||||||
|
st25r3911SetRegisterBits(ST25R3911_REG_OP_CONTROL, (ST25R3911_REG_OP_CONTROL_rx_en | ST25R3911_REG_OP_CONTROL_tx_en) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911TxRxOff( void )
|
||||||
|
{
|
||||||
|
st25r3911ClrRegisterBits(ST25R3911_REG_OP_CONTROL, (ST25R3911_REG_OP_CONTROL_rx_en | ST25R3911_REG_OP_CONTROL_tx_en) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void st25r3911OscOn( void )
|
||||||
|
{
|
||||||
|
/* Check if oscillator is already turned on and stable */
|
||||||
|
/* Use ST25R3911_REG_OP_CONTROL_en instead of ST25R3911_REG_AUX_DISPLAY_osc_ok to be on the safe side */
|
||||||
|
if( !st25r3911CheckReg( ST25R3911_REG_OP_CONTROL, ST25R3911_REG_OP_CONTROL_en, ST25R3911_REG_OP_CONTROL_en ) )
|
||||||
|
{
|
||||||
|
/* Clear any eventual previous oscillator IRQ */
|
||||||
|
st25r3911GetInterrupt( ST25R3911_IRQ_MASK_OSC );
|
||||||
|
|
||||||
|
/* enable oscillator frequency stable interrupt */
|
||||||
|
st25r3911EnableInterrupts(ST25R3911_IRQ_MASK_OSC);
|
||||||
|
|
||||||
|
/* enable oscillator and regulator output */
|
||||||
|
st25r3911ModifyRegister(ST25R3911_REG_OP_CONTROL, 0x00, ST25R3911_REG_OP_CONTROL_en);
|
||||||
|
|
||||||
|
/* wait for the oscillator interrupt */
|
||||||
|
st25r3911WaitForInterruptsTimed(ST25R3911_IRQ_MASK_OSC, ST25R3911_OSC_STABLE_TIMEOUT);
|
||||||
|
st25r3911DisableInterrupts(ST25R3911_IRQ_MASK_OSC);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void st25r3911Initialize(void)
|
||||||
|
{
|
||||||
|
uint16_t vdd_mV;
|
||||||
|
|
||||||
|
/* first, reset the st25r3911 */
|
||||||
|
st25r3911ExecuteCommand(ST25R3911_CMD_SET_DEFAULT);
|
||||||
|
|
||||||
|
/* Set Operation Control Register to default value */
|
||||||
|
st25r3911WriteRegister(ST25R3911_REG_OP_CONTROL, 0x00);
|
||||||
|
|
||||||
|
/* enable pull downs on miso line */
|
||||||
|
st25r3911ModifyRegister(ST25R3911_REG_IO_CONF2, 0,
|
||||||
|
ST25R3911_REG_IO_CONF2_miso_pd1 |
|
||||||
|
ST25R3911_REG_IO_CONF2_miso_pd2);
|
||||||
|
|
||||||
|
/* after reset all interrupts are enabled. so disable them at first */
|
||||||
|
st25r3911DisableInterrupts(ST25R3911_IRQ_MASK_ALL);
|
||||||
|
/* and clear them, just to be sure... */
|
||||||
|
st25r3911ClearInterrupts();
|
||||||
|
|
||||||
|
st25r3911OscOn();
|
||||||
|
|
||||||
|
/* Measure vdd and set sup3V bit accordingly */
|
||||||
|
vdd_mV = st25r3911MeasureVoltage(ST25R3911_REG_REGULATOR_CONTROL_mpsv_vdd);
|
||||||
|
|
||||||
|
st25r3911ModifyRegister(ST25R3911_REG_IO_CONF2,
|
||||||
|
ST25R3911_REG_IO_CONF2_sup3V,
|
||||||
|
(uint8_t)((vdd_mV < 3600U)?ST25R3911_REG_IO_CONF2_sup3V:0U));
|
||||||
|
|
||||||
|
/* Make sure Transmitter and Receiver are disabled */
|
||||||
|
st25r3911TxRxOff();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911Deinitialize(void)
|
||||||
|
{
|
||||||
|
st25r3911DisableInterrupts(ST25R3911_IRQ_MASK_ALL);
|
||||||
|
|
||||||
|
/* Disabe Tx and Rx, Keep OSC */
|
||||||
|
st25r3911TxRxOff();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnCode st25r3911AdjustRegulators(uint16_t* result_mV)
|
||||||
|
{
|
||||||
|
uint8_t result;
|
||||||
|
uint8_t io_conf2;
|
||||||
|
ReturnCode err = ERR_NONE;
|
||||||
|
|
||||||
|
/* Reset logic and set regulated voltages to be defined by result of Adjust Regulators command */
|
||||||
|
st25r3911SetRegisterBits( ST25R3911_REG_REGULATOR_CONTROL, ST25R3911_REG_REGULATOR_CONTROL_reg_s );
|
||||||
|
st25r3911ClrRegisterBits( ST25R3911_REG_REGULATOR_CONTROL, ST25R3911_REG_REGULATOR_CONTROL_reg_s );
|
||||||
|
|
||||||
|
st25r3911ExecuteCommandAndGetResult(ST25R3911_CMD_ADJUST_REGULATORS,
|
||||||
|
ST25R3911_REG_REGULATOR_RESULT,
|
||||||
|
5,
|
||||||
|
&result);
|
||||||
|
|
||||||
|
st25r3911ReadRegister(ST25R3911_REG_IO_CONF2, &io_conf2);
|
||||||
|
|
||||||
|
result >>= ST25R3911_REG_REGULATOR_RESULT_shift_reg;
|
||||||
|
result -= 5U;
|
||||||
|
if (result_mV != NULL)
|
||||||
|
{
|
||||||
|
if((io_conf2 & ST25R3911_REG_IO_CONF2_sup3V) != 0U)
|
||||||
|
{
|
||||||
|
*result_mV = 2400;
|
||||||
|
*result_mV += (uint16_t)result * 100U;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*result_mV = 3900;
|
||||||
|
*result_mV += (uint16_t)result * 120U;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911MeasureAmplitude(uint8_t* result)
|
||||||
|
{
|
||||||
|
st25r3911ExecuteCommandAndGetResult(ST25R3911_CMD_MEASURE_AMPLITUDE,
|
||||||
|
ST25R3911_REG_AD_RESULT,
|
||||||
|
10,
|
||||||
|
result);
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911MeasurePhase(uint8_t* result)
|
||||||
|
{
|
||||||
|
st25r3911ExecuteCommandAndGetResult(ST25R3911_CMD_MEASURE_PHASE,
|
||||||
|
ST25R3911_REG_AD_RESULT,
|
||||||
|
10,
|
||||||
|
result);
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911MeasureCapacitance(uint8_t* result)
|
||||||
|
{
|
||||||
|
st25r3911ExecuteCommandAndGetResult(ST25R3911_CMD_MEASURE_CAPACITANCE,
|
||||||
|
ST25R3911_REG_AD_RESULT,
|
||||||
|
10,
|
||||||
|
result);
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911CalibrateAntenna(uint8_t* result)
|
||||||
|
{
|
||||||
|
st25r3911ExecuteCommandAndGetResult(ST25R3911_CMD_CALIBRATE_ANTENNA,
|
||||||
|
ST25R3911_REG_ANT_CAL_RESULT,
|
||||||
|
10,
|
||||||
|
result);
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911CalibrateModulationDepth(uint8_t* result)
|
||||||
|
{
|
||||||
|
st25r3911ExecuteCommandAndGetResult(ST25R3911_CMD_CALIBRATE_MODULATION,
|
||||||
|
ST25R3911_REG_AM_MOD_DEPTH_RESULT,
|
||||||
|
10,
|
||||||
|
result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ReturnCode st25r3911CalibrateCapacitiveSensor(uint8_t* result)
|
||||||
|
{
|
||||||
|
ReturnCode ret;
|
||||||
|
uint8_t res;
|
||||||
|
|
||||||
|
/* Clear Manual calibration values to enable automatic calibration mode */
|
||||||
|
st25r3911ClrRegisterBits( ST25R3911_REG_CAP_SENSOR_CONTROL, ST25R3916_REG_CAP_SENSOR_CONTROL_mask_cs_mcal );
|
||||||
|
|
||||||
|
/* Execute automatic calibration */
|
||||||
|
ret = st25r3911ExecuteCommandAndGetResult( ST25R3911_CMD_CALIBRATE_C_SENSOR, ST25R3911_REG_CAP_SENSOR_RESULT, ST25R3911_TOUT_CALIBRATE_CAP_SENSOR, &res );
|
||||||
|
|
||||||
|
/* Check wether the calibration was successull */
|
||||||
|
if( ((res & ST25R3911_REG_CAP_SENSOR_RESULT_cs_cal_end) != ST25R3911_REG_CAP_SENSOR_RESULT_cs_cal_end) ||
|
||||||
|
((res & ST25R3911_REG_CAP_SENSOR_RESULT_cs_cal_err) == ST25R3911_REG_CAP_SENSOR_RESULT_cs_cal_err) || (ret != ERR_NONE) )
|
||||||
|
{
|
||||||
|
return ERR_IO;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( result != NULL )
|
||||||
|
{
|
||||||
|
(*result) = (uint8_t)(res >> ST25R3911_REG_CAP_SENSOR_CONTROL_shift_cs_mcal);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ReturnCode st25r3911SetBitrate(uint8_t txRate, uint8_t rxRate)
|
||||||
|
{
|
||||||
|
uint8_t reg;
|
||||||
|
|
||||||
|
st25r3911ReadRegister(ST25R3911_REG_BIT_RATE, ®);
|
||||||
|
if (rxRate != ST25R3911_BR_DO_NOT_SET)
|
||||||
|
{
|
||||||
|
if(rxRate > ST25R3911_BR_3390)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reg = (uint8_t)(reg & ~ST25R3911_REG_BIT_RATE_mask_rxrate); /* MISRA 10.3 */
|
||||||
|
reg |= rxRate << ST25R3911_REG_BIT_RATE_shift_rxrate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (txRate != ST25R3911_BR_DO_NOT_SET)
|
||||||
|
{
|
||||||
|
if(txRate > ST25R3911_BR_6780)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reg = (uint8_t)(reg & ~ST25R3911_REG_BIT_RATE_mask_txrate); /* MISRA 10.3 */
|
||||||
|
reg |= txRate<<ST25R3911_REG_BIT_RATE_shift_txrate;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
st25r3911WriteRegister(ST25R3911_REG_BIT_RATE, reg);
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t st25r3911MeasurePowerSupply( uint8_t mpsv )
|
||||||
|
{
|
||||||
|
uint8_t result;
|
||||||
|
|
||||||
|
/* Set the source of direct command: Measure Power Supply Voltage */
|
||||||
|
st25r3911ChangeRegisterBits( ST25R3911_REG_REGULATOR_CONTROL, ST25R3911_REG_REGULATOR_CONTROL_mask_mpsv, mpsv );
|
||||||
|
|
||||||
|
/* Execute command: Measure Power Supply Voltage */
|
||||||
|
st25r3911ExecuteCommandAndGetResult( ST25R3911_CMD_MEASURE_VDD, ST25R3911_REG_AD_RESULT, 10, &result);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t st25r3911MeasureVoltage(uint8_t mpsv)
|
||||||
|
{
|
||||||
|
uint8_t result;
|
||||||
|
uint16_t mV;
|
||||||
|
|
||||||
|
result = st25r3911MeasurePowerSupply( mpsv );
|
||||||
|
|
||||||
|
mV = ((uint16_t)result) * 23U;
|
||||||
|
mV += ((((uint16_t)result) * 438U) + 500U) / 1000U;
|
||||||
|
|
||||||
|
return mV;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint8_t st25r3911GetNumFIFOLastBits(void)
|
||||||
|
{
|
||||||
|
uint8_t reg;
|
||||||
|
|
||||||
|
st25r3911ReadRegister( ST25R3911_REG_FIFO_RX_STATUS2, ® );
|
||||||
|
|
||||||
|
return ((reg & ST25R3911_REG_FIFO_RX_STATUS2_mask_fifo_lb) >> ST25R3911_REG_FIFO_RX_STATUS2_shift_fifo_lb);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t st25r3911GetNoResponseTime_64fcs(void)
|
||||||
|
{
|
||||||
|
return st25r3911NoResponseTime_64fcs;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911StartGPTimer_8fcs(uint16_t gpt_8fcs, uint8_t trigger_source)
|
||||||
|
{
|
||||||
|
st25r3911SetGPTime_8fcs(gpt_8fcs);
|
||||||
|
|
||||||
|
st25r3911ModifyRegister(ST25R3911_REG_GPT_CONTROL,
|
||||||
|
ST25R3911_REG_GPT_CONTROL_gptc_mask,
|
||||||
|
trigger_source);
|
||||||
|
if (trigger_source == 0U)
|
||||||
|
{
|
||||||
|
st25r3911ExecuteCommand(ST25R3911_CMD_START_GP_TIMER);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911SetGPTime_8fcs(uint16_t gpt_8fcs)
|
||||||
|
{
|
||||||
|
st25r3911WriteRegister(ST25R3911_REG_GPT1, (uint8_t)(gpt_8fcs >> 8));
|
||||||
|
st25r3911WriteRegister(ST25R3911_REG_GPT2, (uint8_t)(gpt_8fcs & 0xffU));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool st25r3911CheckReg( uint8_t reg, uint8_t mask, uint8_t value )
|
||||||
|
{
|
||||||
|
uint8_t regVal;
|
||||||
|
|
||||||
|
regVal = 0;
|
||||||
|
st25r3911ReadRegister( reg, ®Val );
|
||||||
|
|
||||||
|
return ((regVal & mask) == value );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool st25r3911CheckChipID( uint8_t *rev )
|
||||||
|
{
|
||||||
|
uint8_t ID;
|
||||||
|
|
||||||
|
ID = 0;
|
||||||
|
st25r3911ReadRegister( ST25R3911_REG_IC_IDENTITY, &ID );
|
||||||
|
|
||||||
|
/* Check if IC Identity Register contains ST25R3911's IC type code */
|
||||||
|
if( (ID & ST25R3911_REG_IC_IDENTITY_mask_ic_type) != ST25R3911_REG_IC_IDENTITY_ic_type )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(rev != NULL)
|
||||||
|
{
|
||||||
|
*rev = (ID & ST25R3911_REG_IC_IDENTITY_mask_ic_rev);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnCode st25r3911SetNoResponseTime_64fcs(uint32_t nrt_64fcs)
|
||||||
|
{
|
||||||
|
ReturnCode err = ERR_NONE;
|
||||||
|
uint8_t nrt_step = 0;
|
||||||
|
uint32_t noResponseTime_64fcs = nrt_64fcs; /* MISRA 17.8: Use intermediate variable */
|
||||||
|
|
||||||
|
st25r3911NoResponseTime_64fcs = noResponseTime_64fcs;
|
||||||
|
if (noResponseTime_64fcs > (uint32_t)0xFFFFU)
|
||||||
|
{
|
||||||
|
nrt_step = ST25R3911_REG_GPT_CONTROL_nrt_step;
|
||||||
|
noResponseTime_64fcs = (noResponseTime_64fcs + 63U) / 64U;
|
||||||
|
if (noResponseTime_64fcs > (uint32_t)0xFFFFU)
|
||||||
|
{
|
||||||
|
noResponseTime_64fcs = 0xFFFFU;
|
||||||
|
err = ERR_PARAM;
|
||||||
|
}
|
||||||
|
st25r3911NoResponseTime_64fcs = 64U * noResponseTime_64fcs;
|
||||||
|
}
|
||||||
|
|
||||||
|
st25r3911ModifyRegister(ST25R3911_REG_GPT_CONTROL, ST25R3911_REG_GPT_CONTROL_nrt_step, nrt_step);
|
||||||
|
st25r3911WriteRegister(ST25R3911_REG_NO_RESPONSE_TIMER1, (uint8_t)(noResponseTime_64fcs >> 8));
|
||||||
|
st25r3911WriteRegister(ST25R3911_REG_NO_RESPONSE_TIMER2, (uint8_t)(noResponseTime_64fcs & 0xffU));
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnCode st25r3911SetStartNoResponseTime_64fcs(uint32_t nrt_64fcs)
|
||||||
|
{
|
||||||
|
ReturnCode err;
|
||||||
|
|
||||||
|
err = st25r3911SetNoResponseTime_64fcs( nrt_64fcs );
|
||||||
|
if(err == ERR_NONE)
|
||||||
|
{
|
||||||
|
st25r3911ExecuteCommand(ST25R3911_CMD_START_NO_RESPONSE_TIMER);
|
||||||
|
}
|
||||||
|
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnCode st25r3911PerformCollisionAvoidance( uint8_t FieldONCmd, uint8_t pdThreshold, uint8_t caThreshold, uint8_t nTRFW )
|
||||||
|
{
|
||||||
|
uint8_t treMask;
|
||||||
|
uint32_t irqs;
|
||||||
|
|
||||||
|
if( (FieldONCmd != ST25R3911_CMD_INITIAL_RF_COLLISION) &&
|
||||||
|
(FieldONCmd != ST25R3911_CMD_RESPONSE_RF_COLLISION_0) &&
|
||||||
|
(FieldONCmd != ST25R3911_CMD_RESPONSE_RF_COLLISION_N) )
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check if new thresholds are to be applied */
|
||||||
|
if( (pdThreshold != ST25R3911_THRESHOLD_DO_NOT_SET) || (caThreshold != ST25R3911_THRESHOLD_DO_NOT_SET) )
|
||||||
|
{
|
||||||
|
treMask = 0;
|
||||||
|
|
||||||
|
if(pdThreshold != ST25R3911_THRESHOLD_DO_NOT_SET)
|
||||||
|
{
|
||||||
|
treMask |= ST25R3911_REG_FIELD_THRESHOLD_mask_trg;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(caThreshold != ST25R3911_THRESHOLD_DO_NOT_SET)
|
||||||
|
{
|
||||||
|
treMask |= ST25R3911_REG_FIELD_THRESHOLD_mask_rfe;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set Detection Threshold and|or Collision Avoidance Threshold */
|
||||||
|
st25r3911ChangeRegisterBits( ST25R3911_REG_FIELD_THRESHOLD, treMask, (pdThreshold & ST25R3911_REG_FIELD_THRESHOLD_mask_trg) | (caThreshold & ST25R3911_REG_FIELD_THRESHOLD_mask_rfe ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set n x TRFW */
|
||||||
|
st25r3911ModifyRegister(ST25R3911_REG_AUX, ST25R3911_REG_AUX_mask_nfc_n, (nTRFW & ST25R3911_REG_AUX_mask_nfc_n) );
|
||||||
|
|
||||||
|
/* Enable and clear CA specific interrupts and execute command */
|
||||||
|
st25r3911EnableInterrupts( (ST25R3911_IRQ_MASK_CAC | ST25R3911_IRQ_MASK_CAT) );
|
||||||
|
st25r3911GetInterrupt( (ST25R3911_IRQ_MASK_CAC | ST25R3911_IRQ_MASK_CAT) );
|
||||||
|
|
||||||
|
st25r3911ExecuteCommand(FieldONCmd);
|
||||||
|
|
||||||
|
irqs = st25r3911WaitForInterruptsTimed(ST25R3911_IRQ_MASK_CAC | ST25R3911_IRQ_MASK_CAT, ST25R3911_CA_TIMEOUT );
|
||||||
|
|
||||||
|
/* Clear any previous External Field events and disable CA specific interrupts */
|
||||||
|
st25r3911GetInterrupt( (ST25R3911_IRQ_MASK_EOF | ST25R3911_IRQ_MASK_EON) );
|
||||||
|
st25r3911DisableInterrupts(ST25R3911_IRQ_MASK_CAC | ST25R3911_IRQ_MASK_CAT);
|
||||||
|
|
||||||
|
|
||||||
|
if((ST25R3911_IRQ_MASK_CAC & irqs) != 0U) /* Collision occurred */
|
||||||
|
{
|
||||||
|
return ERR_RF_COLLISION;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((ST25R3911_IRQ_MASK_CAT & irqs) != 0U) /* No Collision detected, Field On */
|
||||||
|
{
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* No interrupt detected */
|
||||||
|
return ERR_INTERNAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnCode st25r3911GetRegsDump(uint8_t* resRegDump, uint8_t* sizeRegDump)
|
||||||
|
{
|
||||||
|
uint8_t regIt;
|
||||||
|
uint8_t regDump[ST25R3911_REG_IC_IDENTITY+1U];
|
||||||
|
|
||||||
|
if(!sizeRegDump || !resRegDump)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
for( regIt = ST25R3911_REG_IO_CONF1; regIt < SIZEOF_ARRAY(regDump); regIt++ )
|
||||||
|
{
|
||||||
|
st25r3911ReadRegister(regIt, ®Dump[regIt] );
|
||||||
|
}
|
||||||
|
|
||||||
|
*sizeRegDump = MIN(*sizeRegDump, regIt);
|
||||||
|
if( *sizeRegDump > 0U ) /* MISRA 21.18 */
|
||||||
|
{
|
||||||
|
ST_MEMCPY(resRegDump, regDump, *sizeRegDump );
|
||||||
|
}
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void st25r3911SetNumTxBits( uint32_t nBits )
|
||||||
|
{
|
||||||
|
st25r3911WriteRegister(ST25R3911_REG_NUM_TX_BYTES2, (uint8_t)((nBits >> 0) & 0xffU));
|
||||||
|
st25r3911WriteRegister(ST25R3911_REG_NUM_TX_BYTES1, (uint8_t)((nBits >> 8) & 0xffU));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool st25r3911IsCmdValid( uint8_t cmd )
|
||||||
|
{
|
||||||
|
if( !((cmd >= ST25R3911_CMD_SET_DEFAULT) && (cmd <= ST25R3911_CMD_ANALOG_PRESET)) &&
|
||||||
|
!((cmd >= ST25R3911_CMD_MASK_RECEIVE_DATA) && (cmd <= ST25R3911_CMD_CLEAR_RSSI)) &&
|
||||||
|
!((cmd >= ST25R3911_CMD_TRANSPARENT_MODE) && (cmd <= ST25R3911_CMD_START_NO_RESPONSE_TIMER)) &&
|
||||||
|
!((cmd >= ST25R3911_CMD_TEST_CLEARA) && (cmd <= ST25R3911_CMD_FUSE_PPROM)) )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ReturnCode st25r3911StreamConfigure(const struct st25r3911StreamConfig *config)
|
||||||
|
{
|
||||||
|
uint8_t smd = 0;
|
||||||
|
uint8_t mode;
|
||||||
|
|
||||||
|
if (config->useBPSK != 0U)
|
||||||
|
{
|
||||||
|
mode = ST25R3911_REG_MODE_om_bpsk_stream;
|
||||||
|
if ((config->din<2U) || (config->din>4U)) /* not in fc/4 .. fc/16 */
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
smd |= (4U - config->din) << ST25R3911_REG_STREAM_MODE_shift_scf;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mode = ST25R3911_REG_MODE_om_subcarrier_stream;
|
||||||
|
if ((config->din<3U) || (config->din>6U)) /* not in fc/8 .. fc/64 */
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
smd |= (6U - config->din) << ST25R3911_REG_STREAM_MODE_shift_scf;
|
||||||
|
if (config->report_period_length == 0U)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((config->dout<1U) || (config->dout>7U)) /* not in fc/2 .. fc/128 */
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
smd |= (7U - config->dout) << ST25R3911_REG_STREAM_MODE_shift_stx;
|
||||||
|
|
||||||
|
if (config->report_period_length > 3U)
|
||||||
|
{
|
||||||
|
return ERR_PARAM;
|
||||||
|
}
|
||||||
|
smd |= config->report_period_length << ST25R3911_REG_STREAM_MODE_shift_scp;
|
||||||
|
|
||||||
|
st25r3911WriteRegister(ST25R3911_REG_STREAM_MODE, smd);
|
||||||
|
st25r3911ChangeRegisterBits(ST25R3911_REG_MODE, ST25R3911_REG_MODE_mask_om, mode);
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
ReturnCode st25r3911GetRSSI( uint16_t *amRssi, uint16_t *pmRssi )
|
||||||
|
{
|
||||||
|
/*******************************************************************************/
|
||||||
|
/* MISRA 8.9 An object should be defined at block scope if its identifier only appears in a single function */
|
||||||
|
/*< ST25R3911 RSSI Display Reg values:0 1 2 3 4 5 6 7 8 9 a b c d e f */
|
||||||
|
const uint16_t st25r3911Rssi2mV[] = { 0 ,20 ,27 ,37 ,52 ,72 ,99 ,136 ,190 ,262 ,357 ,500 ,686 ,950, 0, 0 };
|
||||||
|
|
||||||
|
/* ST25R3911 2/3 stage gain reduction [dB] 0 0 0 0 0 3 6 9 12 15 18 na na na na na */
|
||||||
|
const uint16_t st25r3911Gain2Percent[] = { 100, 100, 100, 100, 100, 141, 200, 281, 398, 562, 794, 1, 1, 1, 1, 1 };
|
||||||
|
/*******************************************************************************/
|
||||||
|
|
||||||
|
uint8_t rssi;
|
||||||
|
uint8_t gainRed;
|
||||||
|
|
||||||
|
st25r3911ReadRegister( ST25R3911_REG_RSSI_RESULT, &rssi );
|
||||||
|
st25r3911ReadRegister( ST25R3911_REG_GAIN_RED_STATE, &gainRed );
|
||||||
|
|
||||||
|
if( amRssi != NULL )
|
||||||
|
{
|
||||||
|
*amRssi = (uint16_t) ( ( (uint32_t)st25r3911Rssi2mV[ (rssi >> ST25R3911_REG_RSSI_RESULT_shift_rssi_am) ] * (uint32_t)st25r3911Gain2Percent[ (gainRed >> ST25R3911_REG_GAIN_RED_STATE_shift_gs_am) ] ) / 100U );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( pmRssi != NULL )
|
||||||
|
{
|
||||||
|
*pmRssi = (uint16_t) ( ( (uint32_t)st25r3911Rssi2mV[ (rssi & ST25R3911_REG_RSSI_RESULT_mask_rssi_pm) ] * (uint32_t)st25r3911Gain2Percent[ (gainRed & ST25R3911_REG_GAIN_RED_STATE_mask_gs_pm) ] ) / 100U );
|
||||||
|
}
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL FUNCTIONS
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Executes a direct command and returns the result
|
||||||
|
*
|
||||||
|
* This function executes the direct command given by \a cmd waits for
|
||||||
|
* \a sleeptime for I_dct and returns the result read from register \a resreg.
|
||||||
|
* No checking of the validity of the cmd is performed.
|
||||||
|
*
|
||||||
|
* \param[in] cmd: direct command to execute.
|
||||||
|
* \param[in] resreg: Address of the register containing the result.
|
||||||
|
* \param[in] sleeptime: time in milliseconds to wait before reading the result.
|
||||||
|
* \param[out] result: 8 bit long result
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
static ReturnCode st25r3911ExecuteCommandAndGetResult(uint8_t cmd, uint8_t resreg, uint8_t sleeptime, uint8_t* result)
|
||||||
|
{
|
||||||
|
|
||||||
|
st25r3911EnableInterrupts(ST25R3911_IRQ_MASK_DCT);
|
||||||
|
st25r3911GetInterrupt(ST25R3911_IRQ_MASK_DCT);
|
||||||
|
st25r3911ExecuteCommand(cmd);
|
||||||
|
st25r3911WaitForInterruptsTimed(ST25R3911_IRQ_MASK_DCT, sleeptime);
|
||||||
|
st25r3911DisableInterrupts(ST25R3911_IRQ_MASK_DCT);
|
||||||
|
|
||||||
|
/* read out the result if the pointer is not NULL */
|
||||||
|
if (result != NULL)
|
||||||
|
{
|
||||||
|
st25r3911ReadRegister(resreg, result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ERR_NONE;
|
||||||
|
}
|
601
Software/Drivers/BSP/Components/ST25R3911/st25r3911.h
Normal file
601
Software/Drivers/BSP/Components/ST25R3911/st25r3911.h
Normal file
@ -0,0 +1,601 @@
|
|||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* \attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PROJECT: ST25R3911 firmware
|
||||||
|
* Revision:
|
||||||
|
* LANGUAGE: ISO C99
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author Ulrich Herrmann
|
||||||
|
*
|
||||||
|
* \brief ST25R3911 declaration file
|
||||||
|
*
|
||||||
|
* API:
|
||||||
|
* - Initialize ST25R3911 driver: #st25r3911Initialize
|
||||||
|
* - Deinitialize ST25R3911 driver: #st25r3911Deinitialize
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* \addtogroup RFAL
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* \addtogroup RFAL-HAL
|
||||||
|
* \brief RFAL Hardware Abstraction Layer
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* \addtogroup ST25R3911
|
||||||
|
* \brief RFAL ST25R3911 Driver
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* \addtogroup ST25R3911_Driver
|
||||||
|
* \brief RFAL ST25R3911 Driver
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ST25R3911_H
|
||||||
|
#define ST25R3911_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#include "platform.h"
|
||||||
|
#include "st_errno.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL DATATYPES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! Parameters how the stream mode should work */
|
||||||
|
struct st25r3911StreamConfig {
|
||||||
|
uint8_t useBPSK; /*!< 0: subcarrier, 1:BPSK */
|
||||||
|
uint8_t din; /*!< the divider for the in subcarrier frequency: fc/2^din */
|
||||||
|
uint8_t dout; /*!< the divider for the in subcarrier frequency fc/2^dout */
|
||||||
|
uint8_t report_period_length; /*!< the length of the reporting period 2^report_period_length */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#define ST25R3911_FDT_NONE 0x00U /*!< Value indicating not to perform FDT */
|
||||||
|
|
||||||
|
#define MS_TO_64FCS(A) ((A) * 212U) /*!< Converts from ms to 64/fc steps */
|
||||||
|
#define MS_FROM_64FCS(A) ((A) / 212U) /*!< Converts from 64/fc steps to ms */
|
||||||
|
|
||||||
|
/* ST25R3911 direct commands */
|
||||||
|
#define ST25R3911_CMD_SET_DEFAULT 0xC1U /*!< Puts the chip in default state (same as after power-up) */
|
||||||
|
#define ST25R3911_CMD_CLEAR_FIFO 0xC2U /*!< Stops all activities and clears FIFO */
|
||||||
|
#define ST25R3911_CMD_TRANSMIT_WITH_CRC 0xC4U /*!< Transmit with CRC */
|
||||||
|
#define ST25R3911_CMD_TRANSMIT_WITHOUT_CRC 0xC5U /*!< Transmit without CRC */
|
||||||
|
#define ST25R3911_CMD_TRANSMIT_REQA 0xC6U /*!< Transmit REQA */
|
||||||
|
#define ST25R3911_CMD_TRANSMIT_WUPA 0xC7U /*!< Transmit WUPA */
|
||||||
|
#define ST25R3911_CMD_INITIAL_RF_COLLISION 0xC8U /*!< NFC transmit with Initial RF Collision Avoidance */
|
||||||
|
#define ST25R3911_CMD_RESPONSE_RF_COLLISION_N 0xC9U /*!< NFC transmit with Response RF Collision Avoidance */
|
||||||
|
#define ST25R3911_CMD_RESPONSE_RF_COLLISION_0 0xCAU /*!< NFC transmit with Response RF Collision Avoidance with n=0 */
|
||||||
|
#define ST25R3911_CMD_NORMAL_NFC_MODE 0xCBU /*!< NFC switch to normal NFC mode */
|
||||||
|
#define ST25R3911_CMD_ANALOG_PRESET 0xCCU /*!< Analog Preset */
|
||||||
|
#define ST25R3911_CMD_MASK_RECEIVE_DATA 0xD0U /*!< Mask recive data */
|
||||||
|
#define ST25R3911_CMD_UNMASK_RECEIVE_DATA 0xD1U /*!< Unmask recive data */
|
||||||
|
#define ST25R3911_CMD_MEASURE_AMPLITUDE 0xD3U /*!< Measure singal amplitude on RFI inputs */
|
||||||
|
#define ST25R3911_CMD_SQUELCH 0xD4U /*!< Squelch */
|
||||||
|
#define ST25R3911_CMD_CLEAR_SQUELCH 0xD5U /*!< Clear Squelch */
|
||||||
|
#define ST25R3911_CMD_ADJUST_REGULATORS 0xD6U /*!< Adjust regulators */
|
||||||
|
#define ST25R3911_CMD_CALIBRATE_MODULATION 0xD7U /*!< Calibrate modulation depth */
|
||||||
|
#define ST25R3911_CMD_CALIBRATE_ANTENNA 0xD8U /*!< Calibrate antenna */
|
||||||
|
#define ST25R3911_CMD_MEASURE_PHASE 0xD9U /*!< Measure phase between RFO and RFI signal */
|
||||||
|
#define ST25R3911_CMD_CLEAR_RSSI 0xDAU /*!< clear RSSI bits and restart the measurement */
|
||||||
|
#define ST25R3911_CMD_TRANSPARENT_MODE 0xDCU /*!< Transparent mode */
|
||||||
|
#define ST25R3911_CMD_CALIBRATE_C_SENSOR 0xDDU /*!< Calibrate the capacitive sensor */
|
||||||
|
#define ST25R3911_CMD_MEASURE_CAPACITANCE 0xDEU /*!< Measure capacitance */
|
||||||
|
#define ST25R3911_CMD_MEASURE_VDD 0xDFU /*!< Measure power supply voltage */
|
||||||
|
#define ST25R3911_CMD_START_GP_TIMER 0xE0U /*!< Start the general purpose timer */
|
||||||
|
#define ST25R3911_CMD_START_WUP_TIMER 0xE1U /*!< Start the wake-up timer */
|
||||||
|
#define ST25R3911_CMD_START_MASK_RECEIVE_TIMER 0xE2U /*!< Start the mask-receive timer */
|
||||||
|
#define ST25R3911_CMD_START_NO_RESPONSE_TIMER 0xE3U /*!< Start the no-repsonse timer */
|
||||||
|
#define ST25R3911_CMD_TEST_CLEARA 0xFAU /*!< Clear Test register */
|
||||||
|
#define ST25R3911_CMD_TEST_CLEARB 0xFBU /*!< Clear Test register */
|
||||||
|
#define ST25R3911_CMD_TEST_ACCESS 0xFCU /*!< Enable R/W access to the test registers */
|
||||||
|
#define ST25R3911_CMD_LOAD_PPROM 0xFDU /*!< Load data from the poly fuses to RAM */
|
||||||
|
#define ST25R3911_CMD_FUSE_PPROM 0xFEU /*!< Fuse poly fuses with data from the RAM */
|
||||||
|
|
||||||
|
|
||||||
|
#define ST25R3911_FIFO_DEPTH 96U /*!< Depth of FIFO */
|
||||||
|
|
||||||
|
#define ST25R3911_THRESHOLD_DO_NOT_SET 0xFFU /*!< Indicates not to change this Threshold */
|
||||||
|
|
||||||
|
#define ST25R3911_BR_DO_NOT_SET 0xFFU /*!< Indicates not to change this Bit Rate */
|
||||||
|
#define ST25R3911_BR_106 0x00U /*!< ST25R3911 Bit Rate 106 kbit/s (fc/128) */
|
||||||
|
#define ST25R3911_BR_212 0x01U /*!< ST25R3911 Bit Rate 212 kbit/s (fc/64) */
|
||||||
|
#define ST25R3911_BR_424 0x02U /*!< ST25R3911 Bit Rate 424 kbit/s (fc/32) */
|
||||||
|
#define ST25R3911_BR_848 0x03U /*!< ST25R3911 Bit Rate 848 kbit/s (fc/16) */
|
||||||
|
#define ST25R3911_BR_1695 0x04U /*!< ST25R3911 Bit Rate 1696 kbit/s (fc/8) */
|
||||||
|
#define ST25R3911_BR_3390 0x05U /*!< ST25R3911 Bit Rate 3390 kbit/s (fc/4) */
|
||||||
|
#define ST25R3911_BR_6780 0x06U /*!< ST25R3911 Bit Rate 6780 kbit/s (fc/2) */
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL MACROS
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! Checks if General Purpose Timer is still running by reading gpt_on flag */
|
||||||
|
#define st25r3911IsGPTRunning( ) ( st25r3911CheckReg(ST25R3911_REG_REGULATOR_RESULT, ST25R3911_REG_REGULATOR_RESULT_gpt_on, ST25R3911_REG_REGULATOR_RESULT_gpt_on) )
|
||||||
|
|
||||||
|
/*! Checks if CRC is configured to be in FIFO */
|
||||||
|
#define st25r3911IsCRCinFIFO( ) ( st25r3911CheckReg(ST25R3911_REG_AUX, ST25R3911_REG_AUX_crc_2_fifo, ST25R3911_REG_AUX_crc_2_fifo) )
|
||||||
|
|
||||||
|
/*! Checks if External Filed is detected by reading ST25R3911 External Field
|
||||||
|
* Detector output */
|
||||||
|
#define st25r3911IsExtFieldOn() ( st25r3911CheckReg(ST25R3911_REG_AUX_DISPLAY, ST25R3911_REG_AUX_DISPLAY_efd_o, ST25R3911_REG_AUX_DISPLAY_efd_o ) )
|
||||||
|
|
||||||
|
/*! Checks if Transmitter is enabled (Field On) */
|
||||||
|
#define st25r3911IsTxEnabled() ( st25r3911CheckReg(ST25R3911_REG_OP_CONTROL, ST25R3911_REG_OP_CONTROL_tx_en, ST25R3911_REG_OP_CONTROL_tx_en ) )
|
||||||
|
|
||||||
|
/*! Turn Off Tx (Field Off) */
|
||||||
|
#define st25r3911TxOff() st25r3911ClrRegisterBits(ST25R3911_REG_OP_CONTROL, ST25R3911_REG_OP_CONTROL_tx_en );
|
||||||
|
|
||||||
|
/*! Checks if last FIFO byte is complete */
|
||||||
|
#define st25r3911IsLastFIFOComplete() st25r3911CheckReg( ST25R3911_REG_FIFO_RX_STATUS2, ST25R3911_REG_FIFO_RX_STATUS2_mask_fifo_lb, 0 )
|
||||||
|
|
||||||
|
/*! Checks if the Oscillator is enabled */
|
||||||
|
#define st25r3911IsOscOn() st25r3911CheckReg( ST25R3911_REG_OP_CONTROL, ST25R3911_REG_OP_CONTROL_en, ST25R3911_REG_OP_CONTROL_en )
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL FUNCTION PROTOTYPES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Turn on Oscillator and Regulator
|
||||||
|
*
|
||||||
|
* This function turn on oscillator and regulator and wait for the oscillator to
|
||||||
|
* become stable.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911OscOn( void );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Turn On Tx and Rx
|
||||||
|
*
|
||||||
|
* This function turns On Tx and Rx (Field On)
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911TxRxOn( void );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Turn Off Tx and Rx
|
||||||
|
*
|
||||||
|
* This function turns Off Tx and Rx (Field Off)
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911TxRxOff( void );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Initialise ST25R3911 driver
|
||||||
|
*
|
||||||
|
* This function initialises the ST25R3911 driver.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911Initialize( void );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Deinitialize ST25R3911 driver
|
||||||
|
*
|
||||||
|
* Calling this function deinitializes the ST25R3911 driver.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911Deinitialize( void );
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Sets the bitrate registers
|
||||||
|
*
|
||||||
|
* This function sets the bitrate register for rx and tx
|
||||||
|
*
|
||||||
|
* \param txRate : speed is 2^txrate * 106 kb/s
|
||||||
|
* 0xff : don't set txrate
|
||||||
|
* \param rxRate : speed is 2^rxrate * 106 kb/s
|
||||||
|
* 0xff : don't set rxrate
|
||||||
|
*
|
||||||
|
* \return ERR_NONE : No error, both bit rates were set
|
||||||
|
* \return ERR_PARAM: At least one bit rate was invalid
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern ReturnCode st25r3911SetBitrate( uint8_t txRate, uint8_t rxRate );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Adjusts supply regulators according to the current supply voltage
|
||||||
|
*
|
||||||
|
* On this function the power level is measured in maximum load conditions and
|
||||||
|
* the regulated voltage reference is set to 250mV below this level.
|
||||||
|
* Execution of this function lasts arround 5ms.
|
||||||
|
*
|
||||||
|
* The regulated voltages will be set to the result of Adjust Regulators
|
||||||
|
*
|
||||||
|
* \param [out] result_mV : Result of calibration in milliVolts.
|
||||||
|
*
|
||||||
|
* \return ERR_IO : Error during communication with ST25R3911.
|
||||||
|
* \return ERR_NONE : No error.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern ReturnCode st25r3911AdjustRegulators( uint16_t* result_mV );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Measure Amplitude
|
||||||
|
*
|
||||||
|
* This function measured the amplitude on the RFI inputs and stores the
|
||||||
|
* result in parameter \a result.
|
||||||
|
*
|
||||||
|
* \param[out] result: 8 bit long result of RF measurement.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911MeasureAmplitude( uint8_t* result );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Measure Capacitance
|
||||||
|
*
|
||||||
|
* This function performs the capacitance measurement and stores the
|
||||||
|
* result in parameter \a result.
|
||||||
|
*
|
||||||
|
* \param[out] result: 8 bit long result of RF measurement.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911MeasureCapacitance( uint8_t* result );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Measure Voltage
|
||||||
|
*
|
||||||
|
* This function measures the voltage on one of VDD and VSP_*
|
||||||
|
* result in parameter \a result.
|
||||||
|
*
|
||||||
|
* \param[in] mpsv : one of ST25R3911_REG_REGULATOR_CONTROL_mpsv_vdd
|
||||||
|
* ST25R3911_REG_REGULATOR_CONTROL_mpsv_vsp_rf
|
||||||
|
* ST25R3911_REG_REGULATOR_CONTROL_mpsv_vsp_a
|
||||||
|
* or ST25R3911_REG_REGULATOR_CONTROL_mpsv_vsp_d
|
||||||
|
*
|
||||||
|
* \return the measured voltage raw values
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern uint8_t st25r3911MeasurePowerSupply( uint8_t mpsv );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Measure Voltage
|
||||||
|
*
|
||||||
|
* This function measures the voltage on one of VDD and VSP_*
|
||||||
|
* result in parameter \a result.
|
||||||
|
*
|
||||||
|
* \param[in] mpsv : one of ST25R3911_REG_REGULATOR_CONTROL_mpsv_vdd
|
||||||
|
* ST25R3911_REG_REGULATOR_CONTROL_mpsv_vsp_rf
|
||||||
|
* ST25R3911_REG_REGULATOR_CONTROL_mpsv_vsp_a
|
||||||
|
* or ST25R3911_REG_REGULATOR_CONTROL_mpsv_vsp_d
|
||||||
|
*
|
||||||
|
* \return the measured voltage in mV
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern uint16_t st25r3911MeasureVoltage( uint8_t mpsv );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Calibrate antenna
|
||||||
|
*
|
||||||
|
* This function is used to calibrate the antenna using a special sequence.
|
||||||
|
* The result is stored in the \a result parameter.
|
||||||
|
*
|
||||||
|
* \param[out] result: 8 bit long result of antenna calibration algorithm.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911CalibrateAntenna( uint8_t* result );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Measure Phase
|
||||||
|
*
|
||||||
|
* This function performs a Phase measurement.
|
||||||
|
* The result is stored in the \a result parameter.
|
||||||
|
*
|
||||||
|
* \param[out] result: 8 bit long result of the measurement.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911MeasurePhase( uint8_t* result );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Calibrate modulation depth
|
||||||
|
*
|
||||||
|
* This function is used to calibrate the modulation depth using a special sequence.
|
||||||
|
* The result is stored in the \a result parameter.
|
||||||
|
*
|
||||||
|
* \param[out] result: 8 bit long result of antenna calibration algorithm.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911CalibrateModulationDepth( uint8_t* result );
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Calibrate Capacitive Sensor
|
||||||
|
*
|
||||||
|
* This function performs automatic calibration of the capacitive sensor
|
||||||
|
* and stores the result in parameter \a result.
|
||||||
|
*
|
||||||
|
* \warning To avoid interference with Xtal oscillator and reader magnetic
|
||||||
|
* field, it is strongly recommended to perform calibration
|
||||||
|
* in Power-down mode only.
|
||||||
|
* This method does not modify the Oscillator nor transmitter state,
|
||||||
|
* these should be configured before by user.
|
||||||
|
*
|
||||||
|
* \param[out] result: 5 bit long result of the calibration.
|
||||||
|
* Binary weighted, step 0.1 pF, max 3.1 pF
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* \return ERR_PARAM : Invalid parameter
|
||||||
|
* \return ERR_IO : The calibration was not successful
|
||||||
|
* \return ERR_NONE : No error
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern ReturnCode st25r3911CalibrateCapacitiveSensor( uint8_t* result );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief set no response time
|
||||||
|
*
|
||||||
|
* This function executes sets the no response time to the defines value
|
||||||
|
*
|
||||||
|
* \param nrt_64fcs : no response time in 64/fc = 4.72us
|
||||||
|
* completion interrupt
|
||||||
|
*
|
||||||
|
* \return ERR_PARAM : if time is too large
|
||||||
|
*/
|
||||||
|
extern ReturnCode st25r3911SetNoResponseTime_64fcs( uint32_t nrt_64fcs );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief set no response time
|
||||||
|
*
|
||||||
|
* This function executes sets and immediately start the no response timer
|
||||||
|
* to the defines value
|
||||||
|
* This is used when needs to add more time before timeout whitout Tx
|
||||||
|
*
|
||||||
|
* \param nrt_64fcs : no response time in 64/fc = 4.72us
|
||||||
|
* completion interrupt
|
||||||
|
*
|
||||||
|
* \return ERR_PARAM : if time is too large
|
||||||
|
*/
|
||||||
|
extern ReturnCode st25r3911SetStartNoResponseTime_64fcs( uint32_t nrt_64fcs );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Perform Collision Avoidance
|
||||||
|
*
|
||||||
|
* Performs Collision Avoidance with the given threshold and with the
|
||||||
|
* n number of TRFW
|
||||||
|
*
|
||||||
|
* \param[in] FieldONCmd : Field ON command to be executed ST25R3911_CMD_INITIAL_RF_COLLISION
|
||||||
|
* or ST25R3911_CMD_RESPONSE_RF_COLLISION_0/N
|
||||||
|
* \param[in] pdThreshold : Peer Detection Threshold (ST25R3916_REG_FIELD_THRESHOLD_trg_xx)
|
||||||
|
* 0xff : don't set Threshold (ST25R3916_THRESHOLD_DO_NOT_SET)
|
||||||
|
* \param[in] caThreshold : Collision Avoidance Threshold (ST25R3916_REG_FIELD_THRESHOLD_rfe_xx)
|
||||||
|
* 0xff : don't set Threshold (ST25R3916_THRESHOLD_DO_NOT_SET)
|
||||||
|
* \param[in] nTRFW : Number of TRFW
|
||||||
|
*
|
||||||
|
* \return ERR_NONE : no collision detected
|
||||||
|
* \return ERR_RF_COLLISION : collision detected
|
||||||
|
*/
|
||||||
|
extern ReturnCode st25r3911PerformCollisionAvoidance( uint8_t FieldONCmd, uint8_t pdThreshold, uint8_t caThreshold, uint8_t nTRFW );
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Get amount of bits of the last FIFO byte if incomplete
|
||||||
|
*
|
||||||
|
* Gets the number of bits of the last FIFO byte if incomplete
|
||||||
|
*
|
||||||
|
* \return the number of bits of the last FIFO byte if incomplete, 0 if
|
||||||
|
* the last byte is complete
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern uint8_t st25r3911GetNumFIFOLastBits( void );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Get NRT time
|
||||||
|
*
|
||||||
|
* This returns the last value set on the NRT
|
||||||
|
*
|
||||||
|
* \warning it does not reads chip register, just the sw var that contains the
|
||||||
|
* last value set before
|
||||||
|
*
|
||||||
|
* \return the value of the NRT
|
||||||
|
*/
|
||||||
|
extern uint32_t st25r3911GetNoResponseTime_64fcs( void );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief set general purpose timer timeout
|
||||||
|
*
|
||||||
|
* This function sets the proper registers but does not start the timer actually
|
||||||
|
*
|
||||||
|
* \param gpt_8fcs : general purpose timer timeout in 8/fc = 590ns
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
extern void st25r3911SetGPTime_8fcs( uint16_t gpt_8fcs );
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Starts GPT with given timeout
|
||||||
|
*
|
||||||
|
* This function starts the general purpose timer with the given timeout
|
||||||
|
*
|
||||||
|
* \param gpt_8fcs : general purpose timer timeout in 8/fc = 590ns
|
||||||
|
* \param trigger_source : no trigger, start of Rx, end of Rx, end of Tx in NFC mode
|
||||||
|
*/
|
||||||
|
extern void st25r3911StartGPTimer_8fcs( uint16_t gpt_8fcs, uint8_t trigger_source );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Checks if register contains a expected value
|
||||||
|
*
|
||||||
|
* This function checks if the given reg contains a value that once masked
|
||||||
|
* equals the expected value
|
||||||
|
*
|
||||||
|
* \param reg : the register to check the value
|
||||||
|
* \param mask : the mask apply on register value
|
||||||
|
* \param value : expected value to be compared to
|
||||||
|
*
|
||||||
|
* \return true when reg contains the expected value | false otherwise
|
||||||
|
*/
|
||||||
|
bool st25r3911CheckReg( uint8_t reg, uint8_t mask, uint8_t value );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Sets the number Tx Bits
|
||||||
|
*
|
||||||
|
* Sets ST25R3911 internal registers with correct number of complete bytes and
|
||||||
|
* bits to be sent
|
||||||
|
*
|
||||||
|
* \param nBits : the number bits to be transmitted
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
void st25r3911SetNumTxBits( uint32_t nBits );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Check Identity
|
||||||
|
*
|
||||||
|
* Checks if the chip ID is as expected.
|
||||||
|
*
|
||||||
|
* 5 bit IC type code for ST25R3911: 00001
|
||||||
|
* The 3 lsb contain the IC revision code
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* \param[out] rev : the IC revision code
|
||||||
|
*
|
||||||
|
* \return true when IC type is as expected
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
bool st25r3911CheckChipID( uint8_t *rev );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Check if command is valid
|
||||||
|
*
|
||||||
|
* Checks if the given command is a valid ST25R3911 command
|
||||||
|
*
|
||||||
|
* \param[in] cmd: Command to check
|
||||||
|
*
|
||||||
|
* \return true if is a valid command
|
||||||
|
* \return false otherwise
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
bool st25r3911IsCmdValid( uint8_t cmd );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Configure the stream mode of ST25R3911
|
||||||
|
*
|
||||||
|
* This function initializes the stream with the given parameters
|
||||||
|
*
|
||||||
|
* \param[in] config : all settings for bitrates, type, etc.
|
||||||
|
|
||||||
|
* \return ERR_NONE : No error, stream mode driver initialized.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern ReturnCode st25r3911StreamConfigure( const struct st25r3911StreamConfig *config );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Retrieves all internal registers from st25r3911
|
||||||
|
*/
|
||||||
|
extern ReturnCode st25r3911GetRegsDump( uint8_t* resRegDump, uint8_t* sizeRegDump );
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Gets the RSSI values
|
||||||
|
*
|
||||||
|
* This function gets the RSSI value of the previous reception taking into
|
||||||
|
* account the gain reductions that were used.
|
||||||
|
* RSSI value for both AM and PM channel can be retrieved.
|
||||||
|
*
|
||||||
|
* \param[out] amRssi: the RSSI on the AM channel expressed in mV
|
||||||
|
* \param[out] pmRssi: the RSSI on the PM channel expressed in mV
|
||||||
|
*
|
||||||
|
* \return ERR_PARAM : Invalid parameter
|
||||||
|
* \return ERR_NONE : No error
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
ReturnCode st25r3911GetRSSI( uint16_t *amRssi, uint16_t *pmRssi );
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* ST25R3911_H */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
457
Software/Drivers/BSP/Components/ST25R3911/st25r3911_com.c
Normal file
457
Software/Drivers/BSP/Components/ST25R3911/st25r3911_com.c
Normal file
@ -0,0 +1,457 @@
|
|||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* \attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PROJECT: ST25R3911 firmware
|
||||||
|
* Revision:
|
||||||
|
* LANGUAGE: ISO C99
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author Ulrich Herrmann
|
||||||
|
*
|
||||||
|
* \brief Implementation of ST25R3911 communication.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#include "st25r3911_com.h"
|
||||||
|
#include "st25r3911.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define ST25R3911_WRITE_MODE (0U) /*!< ST25R3911 SPI Operation Mode: Write */
|
||||||
|
#define ST25R3911_READ_MODE (1U << 6) /*!< ST25R3911 SPI Operation Mode: Read */
|
||||||
|
#define ST25R3911_FIFO_LOAD (2U << 6) /*!< ST25R3911 SPI Operation Mode: FIFO Load */
|
||||||
|
#define ST25R3911_FIFO_READ (0xBFU) /*!< ST25R3911 SPI Operation Mode: FIFO Read */
|
||||||
|
#define ST25R3911_CMD_MODE (3U << 6) /*!< ST25R3911 SPI Operation Mode: Direct Command */
|
||||||
|
|
||||||
|
#define ST25R3911_CMD_LEN (1U) /*!< ST25R3911 CMD length */
|
||||||
|
#define ST25R3911_BUF_LEN (ST25R3911_CMD_LEN+ST25R3911_FIFO_DEPTH) /*!< ST25R3911 communication buffer: CMD + FIFO length */
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL VARIABLES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef ST25R391X_COM_SINGLETXRX
|
||||||
|
static uint8_t comBuf[ST25R3911_BUF_LEN]; /*!< ST25R3911 communication buffer */
|
||||||
|
#endif /* ST25R391X_COM_SINGLETXRX */
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL FUNCTION PROTOTYPES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
static inline void st25r3911CheckFieldSetLED(uint8_t value)
|
||||||
|
{
|
||||||
|
if ((ST25R3911_REG_OP_CONTROL_tx_en & value) != 0U)
|
||||||
|
{
|
||||||
|
#ifdef PLATFORM_LED_FIELD_PIN
|
||||||
|
platformLedOn( PLATFORM_LED_FIELD_PORT, PLATFORM_LED_FIELD_PIN );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
platformLedOff( PLATFORM_LED_FIELD_PORT, PLATFORM_LED_FIELD_PIN );
|
||||||
|
#endif /* PLATFORM_LED_FIELD_PIN */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL FUNCTIONS
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
void st25r3911ReadRegister(uint8_t reg, uint8_t* value)
|
||||||
|
{
|
||||||
|
#ifdef ST25R391X_COM_SINGLETXRX
|
||||||
|
uint8_t* buf = comBuf;
|
||||||
|
#else /* ST25R391X_COM_SINGLETXRX */
|
||||||
|
uint8_t buf[2];
|
||||||
|
#endif /* ST25R391X_COM_SINGLETXRX */
|
||||||
|
|
||||||
|
platformProtectST25R391xComm();
|
||||||
|
platformSpiSelect();
|
||||||
|
|
||||||
|
buf[0] = (reg | ST25R3911_READ_MODE);
|
||||||
|
buf[1] = 0;
|
||||||
|
|
||||||
|
platformSpiTxRx(buf, buf, 2);
|
||||||
|
|
||||||
|
if(value != NULL)
|
||||||
|
{
|
||||||
|
*value = buf[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
platformSpiDeselect();
|
||||||
|
platformUnprotectST25R391xComm();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void st25r3911ReadMultipleRegisters(uint8_t reg, uint8_t* values, uint8_t length)
|
||||||
|
{
|
||||||
|
#if !defined(ST25R391X_COM_SINGLETXRX)
|
||||||
|
uint8_t cmd = (reg | ST25R3911_READ_MODE);
|
||||||
|
#endif /* !ST25R391X_COM_SINGLETXRX */
|
||||||
|
|
||||||
|
if (length > 0U)
|
||||||
|
{
|
||||||
|
platformProtectST25R391xComm();
|
||||||
|
platformSpiSelect();
|
||||||
|
|
||||||
|
#ifdef ST25R391X_COM_SINGLETXRX
|
||||||
|
|
||||||
|
ST_MEMSET( comBuf, 0x00, MIN( (ST25R3911_CMD_LEN + (uint32_t)length), ST25R3911_BUF_LEN ) );
|
||||||
|
comBuf[0] = (reg | ST25R3911_READ_MODE);
|
||||||
|
|
||||||
|
platformSpiTxRx(comBuf, comBuf, MIN( (ST25R3911_CMD_LEN + length), ST25R3911_BUF_LEN ) ); /* Transceive as a single SPI call */
|
||||||
|
ST_MEMCPY( values, &comBuf[ST25R3911_CMD_LEN], MIN( length, ST25R3911_BUF_LEN - ST25R3911_CMD_LEN ) ); /* Copy from local buf to output buffer and skip cmd byte */
|
||||||
|
|
||||||
|
#else /* ST25R391X_COM_SINGLETXRX */
|
||||||
|
|
||||||
|
/* Since the result comes one byte later, let's first transmit the adddress with discarding the result */
|
||||||
|
platformSpiTxRx(&cmd, NULL, ST25R3911_CMD_LEN);
|
||||||
|
platformSpiTxRx(NULL, values, length);
|
||||||
|
|
||||||
|
#endif /* ST25R391X_COM_SINGLETXRX */
|
||||||
|
|
||||||
|
platformSpiDeselect();
|
||||||
|
platformUnprotectST25R391xComm();
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911ReadTestRegister(uint8_t reg, uint8_t* value)
|
||||||
|
{
|
||||||
|
|
||||||
|
#ifdef ST25R391X_COM_SINGLETXRX
|
||||||
|
uint8_t* buf = comBuf;
|
||||||
|
#else /* ST25R391X_COM_SINGLETXRX */
|
||||||
|
uint8_t buf[3];
|
||||||
|
#endif /* ST25R391X_COM_SINGLETXRX */
|
||||||
|
|
||||||
|
platformProtectST25R391xComm();
|
||||||
|
platformSpiSelect();
|
||||||
|
|
||||||
|
buf[0] = ST25R3911_CMD_TEST_ACCESS;
|
||||||
|
buf[1] = (reg | ST25R3911_READ_MODE);
|
||||||
|
buf[2] = 0x00;
|
||||||
|
|
||||||
|
platformSpiTxRx(buf, buf, 3);
|
||||||
|
|
||||||
|
if(value != NULL)
|
||||||
|
{
|
||||||
|
*value = buf[2];
|
||||||
|
}
|
||||||
|
|
||||||
|
platformSpiDeselect();
|
||||||
|
platformUnprotectST25R391xComm();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911WriteTestRegister(uint8_t reg, uint8_t value)
|
||||||
|
{
|
||||||
|
#ifdef ST25R391X_COM_SINGLETXRX
|
||||||
|
uint8_t* buf = comBuf;
|
||||||
|
#else /* ST25R391X_COM_SINGLETXRX */
|
||||||
|
uint8_t buf[3];
|
||||||
|
#endif /* ST25R391X_COM_SINGLETXRX */
|
||||||
|
|
||||||
|
platformProtectST25R391xComm();
|
||||||
|
platformSpiSelect();
|
||||||
|
|
||||||
|
buf[0] = ST25R3911_CMD_TEST_ACCESS;
|
||||||
|
buf[1] = (reg | ST25R3911_WRITE_MODE);
|
||||||
|
buf[2] = value;
|
||||||
|
|
||||||
|
platformSpiTxRx(buf, NULL, 3);
|
||||||
|
|
||||||
|
platformSpiDeselect();
|
||||||
|
platformUnprotectST25R391xComm();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911WriteRegister(uint8_t reg, uint8_t value)
|
||||||
|
{
|
||||||
|
#ifdef ST25R391X_COM_SINGLETXRX
|
||||||
|
uint8_t* buf = comBuf;
|
||||||
|
#else /* ST25R391X_COM_SINGLETXRX */
|
||||||
|
uint8_t buf[2];
|
||||||
|
#endif /* ST25R391X_COM_SINGLETXRX */
|
||||||
|
|
||||||
|
if (ST25R3911_REG_OP_CONTROL == reg)
|
||||||
|
{
|
||||||
|
st25r3911CheckFieldSetLED(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
platformProtectST25R391xComm();
|
||||||
|
platformSpiSelect();
|
||||||
|
|
||||||
|
buf[0] = reg | ST25R3911_WRITE_MODE;
|
||||||
|
buf[1] = value;
|
||||||
|
|
||||||
|
platformSpiTxRx(buf, NULL, 2);
|
||||||
|
|
||||||
|
platformSpiDeselect();
|
||||||
|
platformUnprotectST25R391xComm();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911ClrRegisterBits( uint8_t reg, uint8_t clr_mask )
|
||||||
|
{
|
||||||
|
uint8_t tmp;
|
||||||
|
|
||||||
|
st25r3911ReadRegister(reg, &tmp);
|
||||||
|
tmp &= ~clr_mask;
|
||||||
|
st25r3911WriteRegister(reg, tmp);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void st25r3911SetRegisterBits( uint8_t reg, uint8_t set_mask )
|
||||||
|
{
|
||||||
|
uint8_t tmp;
|
||||||
|
|
||||||
|
st25r3911ReadRegister(reg, &tmp);
|
||||||
|
tmp |= set_mask;
|
||||||
|
st25r3911WriteRegister(reg, tmp);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911ChangeRegisterBits(uint8_t reg, uint8_t valueMask, uint8_t value)
|
||||||
|
{
|
||||||
|
st25r3911ModifyRegister(reg, valueMask, (valueMask & value) );
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911ModifyRegister(uint8_t reg, uint8_t clr_mask, uint8_t set_mask)
|
||||||
|
{
|
||||||
|
uint8_t tmp;
|
||||||
|
|
||||||
|
st25r3911ReadRegister(reg, &tmp);
|
||||||
|
|
||||||
|
/* mask out the bits we don't want to change */
|
||||||
|
tmp &= ~clr_mask;
|
||||||
|
/* set the new value */
|
||||||
|
tmp |= set_mask;
|
||||||
|
st25r3911WriteRegister(reg, tmp);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911ChangeTestRegisterBits( uint8_t reg, uint8_t valueMask, uint8_t value )
|
||||||
|
{
|
||||||
|
uint8_t rdVal;
|
||||||
|
uint8_t wrVal;
|
||||||
|
|
||||||
|
/* Read current reg value */
|
||||||
|
st25r3911ReadTestRegister(reg, &rdVal);
|
||||||
|
|
||||||
|
/* Compute new value */
|
||||||
|
wrVal = (rdVal & ~valueMask);
|
||||||
|
wrVal |= (value & valueMask);
|
||||||
|
|
||||||
|
/* Write new reg value */
|
||||||
|
st25r3911WriteTestRegister(reg, wrVal );
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911WriteMultipleRegisters(uint8_t reg, const uint8_t* values, uint8_t length)
|
||||||
|
{
|
||||||
|
#if !defined(ST25R391X_COM_SINGLETXRX)
|
||||||
|
uint8_t cmd = (reg | ST25R3911_WRITE_MODE);
|
||||||
|
#endif /* !ST25R391X_COM_SINGLETXRX */
|
||||||
|
|
||||||
|
if ((reg <= ST25R3911_REG_OP_CONTROL) && ((reg+length) >= ST25R3911_REG_OP_CONTROL))
|
||||||
|
{
|
||||||
|
st25r3911CheckFieldSetLED(values[ST25R3911_REG_OP_CONTROL-reg]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (length > 0U)
|
||||||
|
{
|
||||||
|
/* make this operation atomic */
|
||||||
|
platformProtectST25R391xComm();
|
||||||
|
platformSpiSelect();
|
||||||
|
|
||||||
|
#ifdef ST25R391X_COM_SINGLETXRX
|
||||||
|
|
||||||
|
comBuf[0] = (reg | ST25R3911_WRITE_MODE);
|
||||||
|
ST_MEMCPY( &comBuf[ST25R3911_CMD_LEN], values, MIN( length, ST25R3911_BUF_LEN - ST25R3911_CMD_LEN ) );
|
||||||
|
|
||||||
|
platformSpiTxRx( comBuf, NULL, MIN( (ST25R3911_CMD_LEN + length), ST25R3911_BUF_LEN ) );
|
||||||
|
|
||||||
|
#else /*ST25R391X_COM_SINGLETXRX*/
|
||||||
|
|
||||||
|
platformSpiTxRx( &cmd, NULL, ST25R3911_CMD_LEN );
|
||||||
|
platformSpiTxRx( values, NULL, length );
|
||||||
|
|
||||||
|
#endif /*ST25R391X_COM_SINGLETXRX*/
|
||||||
|
|
||||||
|
platformSpiDeselect();
|
||||||
|
platformUnprotectST25R391xComm();
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void st25r3911WriteFifo(const uint8_t* values, uint8_t length)
|
||||||
|
{
|
||||||
|
#if !defined(ST25R391X_COM_SINGLETXRX)
|
||||||
|
uint8_t cmd = ST25R3911_FIFO_LOAD;
|
||||||
|
#endif /* !ST25R391X_COM_SINGLETXRX */
|
||||||
|
|
||||||
|
if (length > 0U)
|
||||||
|
{
|
||||||
|
platformProtectST25R391xComm();
|
||||||
|
platformSpiSelect();
|
||||||
|
|
||||||
|
#ifdef ST25R391X_COM_SINGLETXRX
|
||||||
|
|
||||||
|
comBuf[0] = ST25R3911_FIFO_LOAD;
|
||||||
|
ST_MEMCPY( &comBuf[ST25R3911_CMD_LEN], values, MIN( length, ST25R3911_BUF_LEN - ST25R3911_CMD_LEN ) );
|
||||||
|
|
||||||
|
platformSpiTxRx( comBuf, NULL, MIN( (ST25R3911_CMD_LEN + length), ST25R3911_BUF_LEN ) );
|
||||||
|
|
||||||
|
#else /*ST25R391X_COM_SINGLETXRX*/
|
||||||
|
|
||||||
|
platformSpiTxRx( &cmd, NULL, ST25R3911_CMD_LEN );
|
||||||
|
platformSpiTxRx( values, NULL, length );
|
||||||
|
|
||||||
|
#endif /*ST25R391X_COM_SINGLETXRX*/
|
||||||
|
|
||||||
|
platformSpiDeselect();
|
||||||
|
platformUnprotectST25R391xComm();
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911ReadFifo(uint8_t* buf, uint8_t length)
|
||||||
|
{
|
||||||
|
#if !defined(ST25R391X_COM_SINGLETXRX)
|
||||||
|
uint8_t cmd = ST25R3911_FIFO_READ;
|
||||||
|
#endif /* !ST25R391X_COM_SINGLETXRX */
|
||||||
|
|
||||||
|
if(length > 0U)
|
||||||
|
{
|
||||||
|
platformProtectST25R391xComm();
|
||||||
|
platformSpiSelect();
|
||||||
|
|
||||||
|
#ifdef ST25R391X_COM_SINGLETXRX
|
||||||
|
|
||||||
|
ST_MEMSET( comBuf, 0x00, MIN( (ST25R3911_CMD_LEN + (uint32_t)length), ST25R3911_BUF_LEN ) );
|
||||||
|
comBuf[0] = ST25R3911_FIFO_READ;
|
||||||
|
|
||||||
|
platformSpiTxRx( comBuf, comBuf, MIN( (ST25R3911_CMD_LEN + length), ST25R3911_BUF_LEN ) ); /* Transceive as a single SPI call */
|
||||||
|
ST_MEMCPY( buf, &comBuf[ST25R3911_CMD_LEN], MIN( length, ST25R3911_BUF_LEN - ST25R3911_CMD_LEN ) ); /* Copy from local buf to output buffer and skip cmd byte */
|
||||||
|
|
||||||
|
#else /*ST25R391X_COM_SINGLETXRX*/
|
||||||
|
|
||||||
|
platformSpiTxRx( &cmd, NULL, ST25R3911_CMD_LEN );
|
||||||
|
platformSpiTxRx( NULL, buf, length );
|
||||||
|
|
||||||
|
#endif /*ST25R391X_COM_SINGLETXRX*/
|
||||||
|
|
||||||
|
platformSpiDeselect();
|
||||||
|
platformUnprotectST25R391xComm();
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911ExecuteCommand( uint8_t cmd )
|
||||||
|
{
|
||||||
|
uint8_t tmpCmd; /* MISRA 17.8 */
|
||||||
|
|
||||||
|
#ifdef PLATFORM_LED_FIELD_PIN
|
||||||
|
if ( (cmd >= ST25R3911_CMD_TRANSMIT_WITH_CRC) && (cmd <= ST25R3911_CMD_RESPONSE_RF_COLLISION_0))
|
||||||
|
{
|
||||||
|
platformLedOff(PLATFORM_LED_FIELD_PORT, PLATFORM_LED_FIELD_PIN);
|
||||||
|
}
|
||||||
|
#endif /* PLATFORM_LED_FIELD_PIN */
|
||||||
|
|
||||||
|
tmpCmd = (cmd | ST25R3911_CMD_MODE);
|
||||||
|
|
||||||
|
platformProtectST25R391xComm();
|
||||||
|
platformSpiSelect();
|
||||||
|
|
||||||
|
platformSpiTxRx( &tmpCmd, NULL, ST25R3911_CMD_LEN );
|
||||||
|
|
||||||
|
platformSpiDeselect();
|
||||||
|
platformUnprotectST25R391xComm();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void st25r3911ExecuteCommands(const uint8_t *cmds, uint8_t length)
|
||||||
|
{
|
||||||
|
platformProtectST25R391xComm();
|
||||||
|
platformSpiSelect();
|
||||||
|
|
||||||
|
platformSpiTxRx( cmds, NULL, length );
|
||||||
|
|
||||||
|
platformSpiDeselect();
|
||||||
|
platformUnprotectST25R391xComm();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool st25r3911IsRegValid( uint8_t reg )
|
||||||
|
{
|
||||||
|
if( !(( (int16_t)reg >= (int16_t)ST25R3911_REG_IO_CONF1) && (reg <= ST25R3911_REG_CAPACITANCE_MEASURE_RESULT)) && (reg != ST25R3911_REG_IC_IDENTITY) )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL FUNCTIONS
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
816
Software/Drivers/BSP/Components/ST25R3911/st25r3911_com.h
Normal file
816
Software/Drivers/BSP/Components/ST25R3911/st25r3911_com.h
Normal file
@ -0,0 +1,816 @@
|
|||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* \attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PROJECT: ST25R3911 firmware
|
||||||
|
* Revision:
|
||||||
|
* LANGUAGE: ISO C99
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author Ulrich Herrmann
|
||||||
|
*
|
||||||
|
* \brief ST25R3911 communication declaration file
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
* This driver provides basic abstraction for communication with the ST25R3911.
|
||||||
|
* It uses the SPI driver for interfacing with the ST25R3911.
|
||||||
|
*
|
||||||
|
* API:
|
||||||
|
* - Read Register: #st25r3911ReadRegister
|
||||||
|
* - Modify Register: #st25r3911ModifyRegister
|
||||||
|
* - Write Register: #st25r3911WriteRegister
|
||||||
|
* - Write Multiple Registers: #st25r3911WriteMultipleRegisters
|
||||||
|
* - Load ST25R3911 FIFO with data: #st25r3911WriteFifo
|
||||||
|
* - Read from ST25R3911 FIFO: #st25r3911ReadFifo
|
||||||
|
* - Execute direct command: #st25r3911ExecuteCommand
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* \addtogroup RFAL
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* \addtogroup RFAL-HAL
|
||||||
|
* \brief RFAL Hardware Abstraction Layer
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* \addtogroup ST25R3911
|
||||||
|
* \brief RFAL ST25R3911 Driver
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* \addtogroup ST25R3911_Com
|
||||||
|
* \brief RFAL ST25R3911 Communication
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ST25R3911_COM_H
|
||||||
|
#define ST25R3911_COM_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#include "platform.h"
|
||||||
|
#include "st_errno.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define ST25R3911_FIFO_STATUS_LEN 2 /*!< Number of FIFO Status Register */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#define ST25R3911_REG_IO_CONF1 0x00U /*!< RW IO Configuration Register 1 */
|
||||||
|
#define ST25R3911_REG_IO_CONF2 0x01U /*!< RW IO Configuration Register 2 */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_OP_CONTROL 0x02U /*!< RW Operation Control Register */
|
||||||
|
#define ST25R3911_REG_MODE 0x03U /*!< RW Mode Definition Register */
|
||||||
|
#define ST25R3911_REG_BIT_RATE 0x04U /*!< RW Bit Rate Definition Register */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_ISO14443A_NFC 0x05U /*!< RW ISO14443A and NFC 106 kBit/s Settings Register */
|
||||||
|
#define ST25R3911_REG_ISO14443B_1 0x06U /*!< RW ISO14443B Settings Register 1 */
|
||||||
|
#define ST25R3911_REG_ISO14443B_2 0x07U /*!< RW ISO14443B Settings Register 2 */
|
||||||
|
#define ST25R3911_REG_STREAM_MODE 0x08U /*!< RW Stream Mode Definition Register */
|
||||||
|
#define ST25R3911_REG_AUX 0x09U /*!< RW Auxiliary Definition Register */
|
||||||
|
#define ST25R3911_REG_RX_CONF1 0x0AU /*!< RW Receiver Configuration Register 1 */
|
||||||
|
#define ST25R3911_REG_RX_CONF2 0x0BU /*!< RW Receiver Configuration Register 2 */
|
||||||
|
#define ST25R3911_REG_RX_CONF3 0x0CU /*!< RW Receiver Configuration Register 3 */
|
||||||
|
#define ST25R3911_REG_RX_CONF4 0x0DU /*!< RW Receiver Configuration Register 4 */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_MASK_RX_TIMER 0x0EU /*!< RW Mask Receive Timer Register */
|
||||||
|
#define ST25R3911_REG_NO_RESPONSE_TIMER1 0x0FU /*!< RW No-response Timer Register 1 */
|
||||||
|
#define ST25R3911_REG_NO_RESPONSE_TIMER2 0x10U /*!< RW No-response Timer Register 2 */
|
||||||
|
#define ST25R3911_REG_GPT_CONTROL 0x11U /*!< RW General Purpose Timer Control Register */
|
||||||
|
#define ST25R3911_REG_GPT1 0x12U /*!< RW General Purpose Timer Register 1 */
|
||||||
|
#define ST25R3911_REG_GPT2 0x13U /*!< RW General Purpose Timer Register 2 */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_IRQ_MASK_MAIN 0x14U /*!< RW Mask Main Interrupt Register */
|
||||||
|
#define ST25R3911_REG_IRQ_MASK_TIMER_NFC 0x15U /*!< RW Mask Timer and NFC Interrupt Register */
|
||||||
|
#define ST25R3911_REG_IRQ_MASK_ERROR_WUP 0x16U /*!< RW Mask Error and Wake-up Interrupt Register */
|
||||||
|
#define ST25R3911_REG_IRQ_MAIN 0x17U /*!< R Main Interrupt Register */
|
||||||
|
#define ST25R3911_REG_IRQ_TIMER_NFC 0x18U /*!< R Timer and NFC Interrupt Register */
|
||||||
|
#define ST25R3911_REG_IRQ_ERROR_WUP 0x19U /*!< R Error and Wake-up Interrupt Register */
|
||||||
|
#define ST25R3911_REG_FIFO_RX_STATUS1 0x1AU /*!< R FIFO RX Status Register 1 */
|
||||||
|
#define ST25R3911_REG_FIFO_RX_STATUS2 0x1BU /*!< R FIFO RX Status Register 2 */
|
||||||
|
#define ST25R3911_REG_COLLISION_STATUS 0x1CU /*!< R Collision Display Register */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_NUM_TX_BYTES1 0x1DU /*!< RW Number of Transmitted Bytes Register 1 */
|
||||||
|
#define ST25R3911_REG_NUM_TX_BYTES2 0x1EU /*!< RW Number of Transmitted Bytes Register 2 */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_NFCIP1_BIT_RATE 0x1FU /*!< R NFCIP Bit Rate Detection Display Register */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_AD_RESULT 0x20U /*!< R A/D Converter Output Register */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_ANT_CAL_CONTROL 0x21U /*!< RW Antenna Calibration Control Register */
|
||||||
|
#define ST25R3911_REG_ANT_CAL_TARGET 0x22U /*!< RW Antenna Calibration Target Register */
|
||||||
|
#define ST25R3911_REG_ANT_CAL_RESULT 0x23U /*!< R Antenna Calibration Display Register */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_AM_MOD_DEPTH_CONTROL 0x24U /*!< RW AM Modulation Depth Control Register */
|
||||||
|
#define ST25R3911_REG_AM_MOD_DEPTH_RESULT 0x25U /*!< R AM Modulation Depth Display Register */
|
||||||
|
#define ST25R3911_REG_RFO_AM_ON_LEVEL 0x26U /*!< RW RFO AM Modulation (On) Level Definition Register */
|
||||||
|
#define ST25R3911_REG_RFO_AM_OFF_LEVEL 0x27U /*!< RW RFO Normal (AM Off) Level Definition Register */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD 0x29U /*!< RW External Field Detector Threshold Register */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_REGULATOR_CONTROL 0x2AU /*!< RW Regulated Voltage Control Register */
|
||||||
|
#define ST25R3911_REG_REGULATOR_RESULT 0x2BU /*!< R Regulator Display Register */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_RSSI_RESULT 0x2CU /*!< R RSSI Display Register*/
|
||||||
|
#define ST25R3911_REG_GAIN_RED_STATE 0x2DU /*!< R Gain Reduction State Register*/
|
||||||
|
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_CONTROL 0x2EU /*!< RW Capacitive Sensor Control Register */
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_RESULT 0x2FU /*!< R Capacitive Sensor Display Register */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_AUX_DISPLAY 0x30U /*!< R Auxiliary Display Register */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_WUP_TIMER_CONTROL 0x31U /*!< RW Wake-up Timer Control Register */
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_CONF 0x32U /*!< RW Amplitude Measurement Configuration Register */
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_REF 0x33U /*!< RW Amplitude Measurement Reference Register */
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_AA_RESULT 0x34U /*!< R Amplitude Measurement Auto Averaging Display Register */
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_RESULT 0x35U /*!< R Amplitude Measurement Display Register */
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_CONF 0x36U /*!< RW Phase Measurement Configuration Register */
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_REF 0x37U /*!< RW Phase Measurement Reference Register */
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_AA_RESULT 0x38U /*!< R Phase Measurement Auto Averaging Display Register */
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_RESULT 0x39U /*!< R Phase Measurement Display Register */
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_CONF 0x3AU /*!< RW Capacitance Measurement Configuration Register */
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_REF 0x3BU /*!< RW Capacitance Measurement Reference Register */
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_AA_RESULT 0x3CU /*!< R Capacitance Measurement Auto Averaging Display Register */
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_RESULT 0x3DU /*!< R Capacitance Measurement Display Register */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_IC_IDENTITY 0x3FU /*!< R Chip Id: 0 for old silicon, v2 silicon: 0x09 */
|
||||||
|
|
||||||
|
|
||||||
|
/*! Register bit definitions \cond DOXYGEN_SUPRESS */
|
||||||
|
|
||||||
|
#define ST25R3911_REG_IO_CONF1_lf_clk_off (1U<<0)
|
||||||
|
#define ST25R3911_REG_IO_CONF1_out_cl0 (1U<<1)
|
||||||
|
#define ST25R3911_REG_IO_CONF1_out_cl1 (1U<<2)
|
||||||
|
#define ST25R3911_REG_IO_CONF1_mask_out_cl (3U<<1)
|
||||||
|
#define ST25R3911_REG_IO_CONF1_osc (1U<<3)
|
||||||
|
#define ST25R3911_REG_IO_CONF1_fifo_lt (1U<<4)
|
||||||
|
#define ST25R3911_REG_IO_CONF1_fifo_lt_32bytes (0U<<4)
|
||||||
|
#define ST25R3911_REG_IO_CONF1_fifo_lt_16bytes (1U<<4)
|
||||||
|
#define ST25R3911_REG_IO_CONF1_fifo_lr (1U<<5)
|
||||||
|
#define ST25R3911_REG_IO_CONF1_fifo_lr_64bytes (0U<<5)
|
||||||
|
#define ST25R3911_REG_IO_CONF1_fifo_lr_80bytes (1U<<5)
|
||||||
|
#define ST25R3911_REG_IO_CONF1_rfo2 (1U<<6)
|
||||||
|
#define ST25R3911_REG_IO_CONF1_single (1U<<7)
|
||||||
|
#define ST25R3911_REG_IO_CONF2_slow_up (1U<<0)
|
||||||
|
#define ST25R3911_REG_IO_CONF2_io_18 (1U<<2)
|
||||||
|
#define ST25R3911_REG_IO_CONF2_miso_pd1 (1U<<3)
|
||||||
|
#define ST25R3911_REG_IO_CONF2_miso_pd2 (1U<<4)
|
||||||
|
#define ST25R3911_REG_IO_CONF2_vspd_off (1U<<6)
|
||||||
|
#define ST25R3911_REG_IO_CONF2_sup3V (1U<<7)
|
||||||
|
#define ST25R3911_REG_OP_CONTROL_wu (1U<<2)
|
||||||
|
#define ST25R3911_REG_OP_CONTROL_tx_en (1U<<3)
|
||||||
|
#define ST25R3911_REG_OP_CONTROL_rx_man (1U<<4)
|
||||||
|
#define ST25R3911_REG_OP_CONTROL_rx_chn (1U<<5)
|
||||||
|
#define ST25R3911_REG_OP_CONTROL_rx_en (1U<<6)
|
||||||
|
#define ST25R3911_REG_OP_CONTROL_en (1U<<7)
|
||||||
|
#define ST25R3911_REG_MODE_nfc_ar (1U<<0)
|
||||||
|
#define ST25R3911_REG_MODE_nfc_ar_on (1U<<0)
|
||||||
|
#define ST25R3911_REG_MODE_nfc_ar_off (0U<<0)
|
||||||
|
#define ST25R3911_REG_MODE_mask_om (0xfU<<3)
|
||||||
|
#define ST25R3911_REG_MODE_om_nfc (0x0U<<3)
|
||||||
|
#define ST25R3911_REG_MODE_om_iso14443a (0x1U<<3)
|
||||||
|
#define ST25R3911_REG_MODE_om_iso14443b (0x2U<<3)
|
||||||
|
#define ST25R3911_REG_MODE_om_felica (0x3U<<3)
|
||||||
|
#define ST25R3911_REG_MODE_om_topaz (0x4U<<3)
|
||||||
|
#define ST25R3911_REG_MODE_om_subcarrier_stream (0xeU<<3)
|
||||||
|
#define ST25R3911_REG_MODE_om_bpsk_stream (0xfU<<3)
|
||||||
|
#define ST25R3911_REG_MODE_om_bit_rate_detection (0x0U<<3)
|
||||||
|
#define ST25R3911_REG_MODE_om_nfcip1_normal_mode (0x1U<<3)
|
||||||
|
#define ST25R3911_REG_MODE_targ (1U<<7)
|
||||||
|
#define ST25R3911_REG_MODE_targ_targ (1U<<7)
|
||||||
|
#define ST25R3911_REG_MODE_targ_init (0U<<7)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_mask_txrate (0xfU<<4)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_shift_txrate (4U)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_txrate_106 (0x0U<<4)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_txrate_212 (0x1U<<4)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_txrate_424 (0x2U<<4)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_txrate_848 (0x3U<<4)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_txrate_1695 (0x4U<<4)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_txrate_3390 (0x5U<<4)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_txrate_6780 (0x6U<<4)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_mask_rxrate (0xfU<<0)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_shift_rxrate (0U)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_rxrate_106 (0x0U<<0)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_rxrate_212 (0x1U<<0)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_rxrate_424 (0x2U<<0)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_rxrate_848 (0x3U<<0)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_rxrate_1695 (0x4U<<0)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_rxrate_3390 (0x5U<<0)
|
||||||
|
#define ST25R3911_REG_BIT_RATE_rxrate_6780 (0x6U<<0)
|
||||||
|
#define ST25R3911_REG_ISO14443A_NFC_antcl (1U<<0)
|
||||||
|
#define ST25R3911_REG_ISO14443A_NFC_mask_p_len (0xfU<<1)
|
||||||
|
#define ST25R3911_REG_ISO14443A_NFC_shift_p_len (1U)
|
||||||
|
#define ST25R3911_REG_ISO14443A_NFC_nfc_f0 (1U<<5)
|
||||||
|
#define ST25R3911_REG_ISO14443A_NFC_nfc_f0_off (0U<<5)
|
||||||
|
#define ST25R3911_REG_ISO14443A_NFC_no_rx_par (1U<<6)
|
||||||
|
#define ST25R3911_REG_ISO14443A_NFC_no_rx_par_off (0U<<6)
|
||||||
|
#define ST25R3911_REG_ISO14443A_NFC_no_tx_par (1U<<7)
|
||||||
|
#define ST25R3911_REG_ISO14443A_NFC_no_tx_par_off (0U<<7)
|
||||||
|
#define ST25R3911_REG_ISO14443B_1_mask_eof (1U<<2)
|
||||||
|
#define ST25R3911_REG_ISO14443B_1_eof_10etu (0U<<2)
|
||||||
|
#define ST25R3911_REG_ISO14443B_1_eof_11etu (1U<<2)
|
||||||
|
#define ST25R3911_REG_ISO14443B_1_mask_sof (3U<<3)
|
||||||
|
#define ST25R3911_REG_ISO14443B_1_mask_sof_0 (1U<<4)
|
||||||
|
#define ST25R3911_REG_ISO14443B_1_sof_0_10etu (0U<<4)
|
||||||
|
#define ST25R3911_REG_ISO14443B_1_sof_0_11etu (1U<<4)
|
||||||
|
#define ST25R3911_REG_ISO14443B_1_mask_sof_1 (1U<<3)
|
||||||
|
#define ST25R3911_REG_ISO14443B_1_sof_1_2etu (0U<<3)
|
||||||
|
#define ST25R3911_REG_ISO14443B_1_sof_2_3etu (1U<<3)
|
||||||
|
#define ST25R3911_REG_ISO14443B_1_mask_egt (7U<<5)
|
||||||
|
#define ST25R3911_REG_ISO14443B_1_shift_egt (5U)
|
||||||
|
#define ST25R3911_REG_ISO14443B_2_eof_12 (1U<<3)
|
||||||
|
#define ST25R3911_REG_ISO14443B_2_eof_12_10to11etu (0U<<3)
|
||||||
|
#define ST25R3911_REG_ISO14443B_2_eof_12_10to12etu (1U<<3)
|
||||||
|
#define ST25R3911_REG_ISO14443B_2_no_eof (1U<<4)
|
||||||
|
#define ST25R3911_REG_ISO14443B_2_no_sof (1U<<5)
|
||||||
|
#define ST25R3911_REG_ISO14443B_2_mask_tr1 (3U<<6)
|
||||||
|
#define ST25R3911_REG_ISO14443B_2_shift_tr1 (6U)
|
||||||
|
#define ST25R3911_REG_ISO14443B_2_tr1_0 (1U<<6)
|
||||||
|
#define ST25R3911_REG_ISO14443B_2_tr1_1 (1U<<7)
|
||||||
|
#define ST25R3911_REG_ISO14443B_2_tr1_80fs80fs (0U<<6)
|
||||||
|
#define ST25R3911_REG_ISO14443B_2_tr1_64fs32fs (1U<<6)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_mask_stx (7U<<0)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_shift_stx (0U)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_stx_106 (0U<<0)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_stx_212 (1U<<0)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_stx_424 (2U<<0)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_stx_848 (3U<<0)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_stx_1695 (4U<<0)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_stx_3390 (5U<<0)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_stx_6780 (6U<<0)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_mask_scp (3U<<3)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_shift_scp (3U)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_scp_1pulse (0U<<3)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_scp_2pulses (1U<<3)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_scp_4pulses (2U<<3)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_scp_8pulses (3U<<3)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_mask_scf (3U<<5)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_shift_scf (5U)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_scf_bpsk848 (0U<<5)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_scf_bpsk1695 (1U<<5)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_scf_bpsk3390 (2U<<5)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_scf_bpsk106 (3U<<5)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_scf_sc212 (0U<<5)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_scf_sc424 (1U<<5)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_scf_sc848 (2U<<5)
|
||||||
|
#define ST25R3911_REG_STREAM_MODE_scf_sc1695 (3U<<5)
|
||||||
|
#define ST25R3911_REG_AUX_mask_nfc_n (3U<<0)
|
||||||
|
#define ST25R3911_REG_AUX_nfc_n0 (1U<<0)
|
||||||
|
#define ST25R3911_REG_AUX_nfc_n1 (1U<<1)
|
||||||
|
#define ST25R3911_REG_AUX_rx_tol (1U<<2)
|
||||||
|
#define ST25R3911_REG_AUX_ook_hr (1U<<3)
|
||||||
|
#define ST25R3911_REG_AUX_en_fd (1U<<4)
|
||||||
|
#define ST25R3911_REG_AUX_tr_am (1U<<5)
|
||||||
|
#define ST25R3911_REG_AUX_crc_2_fifo (1U<<6)
|
||||||
|
#define ST25R3911_REG_AUX_no_crc_rx (1U<<7)
|
||||||
|
#define ST25R3911_REG_RX_CONF1_z12k (1U<<0)
|
||||||
|
#define ST25R3911_REG_RX_CONF1_h80 (1U<<1)
|
||||||
|
#define ST25R3911_REG_RX_CONF1_h200 (1U<<2)
|
||||||
|
#define ST25R3911_REG_RX_CONF1_mask_lp (7U<<3)
|
||||||
|
#define ST25R3911_REG_RX_CONF1_lp_1200khz (0U<<3)
|
||||||
|
#define ST25R3911_REG_RX_CONF1_lp_600khz (1U<<3)
|
||||||
|
#define ST25R3911_REG_RX_CONF1_lp_300khz (2U<<3)
|
||||||
|
#define ST25R3911_REG_RX_CONF1_lp_2000khz (4U<<3)
|
||||||
|
#define ST25R3911_REG_RX_CONF1_lp_7000khz (5U<<3)
|
||||||
|
#define ST25R3911_REG_RX_CONF1_amd_sel (1U<<6)
|
||||||
|
#define ST25R3911_REG_RX_CONF1_ch_sel (1U<<7)
|
||||||
|
#define ST25R3911_REG_RX_CONF2_sqm_dyn (1U<<1)
|
||||||
|
#define ST25R3911_REG_RX_CONF2_agc_alg (1U<<2)
|
||||||
|
#define ST25R3911_REG_RX_CONF2_agc_m (1U<<3)
|
||||||
|
#define ST25R3911_REG_RX_CONF2_agc_en (1U<<4)
|
||||||
|
#define ST25R3911_REG_RX_CONF2_lf_en (1U<<5)
|
||||||
|
#define ST25R3911_REG_RX_CONF2_lf_op (1U<<6)
|
||||||
|
#define ST25R3911_REG_RX_CONF2_rx_lp (1U<<7)
|
||||||
|
#define ST25R3911_REG_RX_CONF3_rg_nfc (1U<<0)
|
||||||
|
#define ST25R3911_REG_RX_CONF3_lim (1U<<1)
|
||||||
|
#define ST25R3911_REG_RX_CONF3_shift_rg1_pm (2U)
|
||||||
|
#define ST25R3911_REG_RX_CONF3_mask_rg1_pm (0x7U<<2)
|
||||||
|
#define ST25R3911_REG_RX_CONF3_rg1_pm0 (1U<<2)
|
||||||
|
#define ST25R3911_REG_RX_CONF3_rg1_pm1 (1U<<3)
|
||||||
|
#define ST25R3911_REG_RX_CONF3_rg1_pm2 (1U<<4)
|
||||||
|
#define ST25R3911_REG_RX_CONF3_shift_rg1_am (5U)
|
||||||
|
#define ST25R3911_REG_RX_CONF3_mask_rg1_am (0x7U<<5)
|
||||||
|
#define ST25R3911_REG_RX_CONF3_rg1_am0 (1U<<5)
|
||||||
|
#define ST25R3911_REG_RX_CONF3_rg1_am1 (1U<<6)
|
||||||
|
#define ST25R3911_REG_RX_CONF3_rg1_am2 (1U<<7)
|
||||||
|
#define ST25R3911_REG_RX_CONF4_shift_rg2_pm (0U)
|
||||||
|
#define ST25R3911_REG_RX_CONF4_mask_rg2_pm (0xfU<<0)
|
||||||
|
#define ST25R3911_REG_RX_CONF4_rg2_pm0 (1U<<0)
|
||||||
|
#define ST25R3911_REG_RX_CONF4_rg2_pm1 (1U<<1)
|
||||||
|
#define ST25R3911_REG_RX_CONF4_rg2_pm2 (1U<<2)
|
||||||
|
#define ST25R3911_REG_RX_CONF4_rg2_pm3 (1U<<3)
|
||||||
|
#define ST25R3911_REG_RX_CONF4_shift_rg2_am (4U)
|
||||||
|
#define ST25R3911_REG_RX_CONF4_mask_rg2_am (0xfU<<4)
|
||||||
|
#define ST25R3911_REG_RX_CONF4_rg2_am0 (1U<<4)
|
||||||
|
#define ST25R3911_REG_RX_CONF4_rg2_am1 (1U<<5)
|
||||||
|
#define ST25R3911_REG_RX_CONF4_rg2_am2 (1U<<6)
|
||||||
|
#define ST25R3911_REG_RX_CONF4_rg2_am3 (1U<<7)
|
||||||
|
#define ST25R3911_REG_GPT_CONTROL_nrt_step (1U<<0)
|
||||||
|
#define ST25R3911_REG_GPT_CONTROL_nrt_emv (1U<<1)
|
||||||
|
#define ST25R3911_REG_GPT_CONTROL_gptc0 (1U<<5)
|
||||||
|
#define ST25R3911_REG_GPT_CONTROL_gptc1 (1U<<6)
|
||||||
|
#define ST25R3911_REG_GPT_CONTROL_gptc2 (1U<<7)
|
||||||
|
#define ST25R3911_REG_GPT_CONTROL_gptc_mask (0x7U<<5)
|
||||||
|
#define ST25R3911_REG_GPT_CONTROL_gptc_no_trigger (0x0U<<5)
|
||||||
|
#define ST25R3911_REG_GPT_CONTROL_gptc_erx (0x1U<<5)
|
||||||
|
#define ST25R3911_REG_GPT_CONTROL_gptc_srx (0x2U<<5)
|
||||||
|
#define ST25R3911_REG_GPT_CONTROL_gptc_etx_nfc (0x3U<<5)
|
||||||
|
#define ST25R3911_REG_FIFO_RX_STATUS2_np_lb (1U<<0)
|
||||||
|
#define ST25R3911_REG_FIFO_RX_STATUS2_mask_fifo_lb (7U<<1)
|
||||||
|
#define ST25R3911_REG_FIFO_RX_STATUS2_shift_fifo_lb (1U)
|
||||||
|
#define ST25R3911_REG_FIFO_RX_STATUS2_fifo_lb0 (1U<<1)
|
||||||
|
#define ST25R3911_REG_FIFO_RX_STATUS2_fifo_lb1 (1U<<2)
|
||||||
|
#define ST25R3911_REG_FIFO_RX_STATUS2_fifo_lb2 (1U<<3)
|
||||||
|
#define ST25R3911_REG_FIFO_RX_STATUS2_fifo_ncp (1U<<4)
|
||||||
|
#define ST25R3911_REG_FIFO_RX_STATUS2_fifo_ovr (1U<<5)
|
||||||
|
#define ST25R3911_REG_FIFO_RX_STATUS2_fifo_unf (1U<<6)
|
||||||
|
#define ST25R3911_REG_COLLISION_STATUS_c_pb (1U<<0)
|
||||||
|
#define ST25R3911_REG_COLLISION_STATUS_mask_c_bit (3U<<1)
|
||||||
|
#define ST25R3911_REG_COLLISION_STATUS_shift_c_bit (1U)
|
||||||
|
#define ST25R3911_REG_COLLISION_STATUS_mask_c_byte (0xfU<<4)
|
||||||
|
#define ST25R3911_REG_COLLISION_STATUS_shift_c_byte (4U)
|
||||||
|
#define ST25R3911_ST25R3911_REG_NFCIP1_BIT_RATE_nfc_rate0 (1U<<4)
|
||||||
|
#define ST25R3911_ST25R3911_REG_NFCIP1_BIT_RATE_nfc_rate1 (1U<<5)
|
||||||
|
#define ST25R3911_ST25R3911_REG_NFCIP1_BIT_RATE_nfc_rate2 (1U<<6)
|
||||||
|
#define ST25R3911_ST25R3911_REG_NFCIP1_BIT_RATE_nfc_rate3 (1U<<7)
|
||||||
|
#define ST25R3911_REG_NFCIP1_BIT_RATE_nfc_rate_mask (0xfU<<4)
|
||||||
|
#define ST25R3911_REG_NFCIP1_BIT_RATE_nfc_rate_shift (4U)
|
||||||
|
#define ST25R3911_REG_ANT_CAL_CONTROL_mask_tre (0xfU<<3)
|
||||||
|
#define ST25R3911_REG_ANT_CAL_CONTROL_shift_tre (3U)
|
||||||
|
#define ST25R3911_REG_ANT_CAL_CONTROL_tre_0 (1U<<3)
|
||||||
|
#define ST25R3911_REG_ANT_CAL_CONTROL_tre_1 (1U<<4)
|
||||||
|
#define ST25R3911_REG_ANT_CAL_CONTROL_tre_2 (1U<<5)
|
||||||
|
#define ST25R3911_REG_ANT_CAL_CONTROL_tre_3 (1U<<6)
|
||||||
|
#define ST25R3911_REG_ANT_CAL_CONTROL_trim_s (1U<<7)
|
||||||
|
#define ST25R3911_REG_ANT_CAL_RESULT_tri_err (1U<<3)
|
||||||
|
#define ST25R3911_REG_ANT_CAL_RESULT_tri_0 (1U<<4)
|
||||||
|
#define ST25R3911_REG_ANT_CAL_RESULT_tri_1 (1U<<5)
|
||||||
|
#define ST25R3911_REG_ANT_CAL_RESULT_tri_2 (1U<<6)
|
||||||
|
#define ST25R3911_REG_ANT_CAL_RESULT_tri_3 (1U<<7)
|
||||||
|
#define ST25R3911_REG_AM_MOD_DEPTH_CONTROL_mask_mod (0x3fU<<1)
|
||||||
|
#define ST25R3911_REG_AM_MOD_DEPTH_CONTROL_shift_mod (1U)
|
||||||
|
#define ST25R3911_REG_AM_MOD_DEPTH_CONTROL_mod_8percent (0xbU<<1)
|
||||||
|
#define ST25R3911_REG_AM_MOD_DEPTH_CONTROL_mod_10percent (0xeU<<1)
|
||||||
|
#define ST25R3911_REG_AM_MOD_DEPTH_CONTROL_mod_14percent (0x14U<<1)
|
||||||
|
#define ST25R3911_REG_AM_MOD_DEPTH_CONTROL_mod_20percent (0x20U<<1)
|
||||||
|
#define ST25R3911_REG_AM_MOD_DEPTH_CONTROL_mod_25percent (0x2aU<<1)
|
||||||
|
#define ST25R3911_REG_AM_MOD_DEPTH_CONTROL_mod_30percent (0x37U<<1)
|
||||||
|
#define ST25R3911_REG_AM_MOD_DEPTH_CONTROL_mod_33percent (0x3fU<<1)
|
||||||
|
#define ST25R3911_REG_AM_MOD_DEPTH_CONTROL_am_s (1U<<7)
|
||||||
|
#define ST25R3911_REG_RFO_AM_MOD_LEVEL_dram0 (1U<<0)
|
||||||
|
#define ST25R3911_REG_RFO_AM_MOD_LEVEL_dram1 (1U<<1)
|
||||||
|
#define ST25R3911_REG_RFO_AM_MOD_LEVEL_dram2 (1U<<2)
|
||||||
|
#define ST25R3911_REG_RFO_AM_MOD_LEVEL_dram3 (1U<<3)
|
||||||
|
#define ST25R3911_REG_RFO_AM_MOD_LEVEL_dram4 (1U<<4)
|
||||||
|
#define ST25R3911_REG_RFO_AM_MOD_LEVEL_dram5 (1U<<5)
|
||||||
|
#define ST25R3911_REG_RFO_AM_MOD_LEVEL_dram6 (1U<<6)
|
||||||
|
#define ST25R3911_REG_RFO_AM_MOD_LEVEL_dram7 (1U<<7)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_t0 (1U<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_t1 (1U<<1)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_t2 (1U<<2)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_t3 (1U<<3)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_trg_l0 (1U<<4)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_trg_l1 (1U<<5)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_trg_l2 (1U<<6)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_mask_trg (0x07U<<4)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_trg_75mV (0x00U<<4)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_trg_105mV (0x01U<<4)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_trg_150mV (0x02U<<4)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_trg_205mV (0x03U<<4)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_trg_290mV (0x04U<<4)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_trg_400mV (0x05U<<4)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_trg_560mV (0x06U<<4)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_trg_800mV (0x07U<<4)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_mask_rfe (0x0FU<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_75mV (0x00U<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_105mV (0x01U<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_150mV (0x02U<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_205mV (0x03U<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_290mV (0x04U<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_400mV (0x05U<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_560mV (0x06U<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_800mV (0x07U<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_25mV (0x08U<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_33mV (0x09U<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_47mV (0x0AU<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_64mV (0x0BU<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_90mV (0x0CU<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_125mV (0x0DU<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_175mV (0x0EU<<0)
|
||||||
|
#define ST25R3911_REG_FIELD_THRESHOLD_rfe_250mV (0x0FU<<0)
|
||||||
|
#define ST25R3911_REG_REGULATOR_CONTROL_shift_mpsv (1U)
|
||||||
|
#define ST25R3911_REG_REGULATOR_CONTROL_mask_mpsv (3U<<1)
|
||||||
|
#define ST25R3911_REG_REGULATOR_CONTROL_mpsv_vdd (0U<<1)
|
||||||
|
#define ST25R3911_REG_REGULATOR_CONTROL_mpsv_vsp_a (1U<<1)
|
||||||
|
#define ST25R3911_REG_REGULATOR_CONTROL_mpsv_vsp_d (2U<<1)
|
||||||
|
#define ST25R3911_REG_REGULATOR_CONTROL_mpsv_vsp_rf (3U<<1)
|
||||||
|
#define ST25R3911_REG_REGULATOR_CONTROL_mask_rege (0xfU<<3)
|
||||||
|
#define ST25R3911_REG_REGULATOR_CONTROL_shift_rege (3U)
|
||||||
|
#define ST25R3911_REG_REGULATOR_CONTROL_reg_s (1U<<7)
|
||||||
|
#define ST25R3911_REG_REGULATOR_RESULT_mrt_on (1U<<0)
|
||||||
|
#define ST25R3911_REG_REGULATOR_RESULT_nrt_on (1U<<1)
|
||||||
|
#define ST25R3911_REG_REGULATOR_RESULT_gpt_on (1U<<2)
|
||||||
|
#define ST25R3911_REG_REGULATOR_RESULT_mask_reg (0xfU<<4)
|
||||||
|
#define ST25R3911_REG_REGULATOR_RESULT_shift_reg (4U)
|
||||||
|
#define ST25R3911_REG_REGULATOR_RESULT_reg_0 (1U<<4)
|
||||||
|
#define ST25R3911_REG_REGULATOR_RESULT_reg_1 (1U<<5)
|
||||||
|
#define ST25R3911_REG_REGULATOR_RESULT_reg_2 (1U<<6)
|
||||||
|
#define ST25R3911_REG_REGULATOR_RESULT_reg_3 (1U<<7)
|
||||||
|
#define ST25R3911_REG_RSSI_RESULT_mask_rssi_pm (0xfU)
|
||||||
|
#define ST25R3911_REG_RSSI_RESULT_shift_rssi_pm (0U)
|
||||||
|
#define ST25R3911_REG_RSSI_RESULT_rssi_pm0 (1U<<0)
|
||||||
|
#define ST25R3911_REG_RSSI_RESULT_rssi_pm1 (1U<<1)
|
||||||
|
#define ST25R3911_REG_RSSI_RESULT_rssi_pm2 (1U<<2)
|
||||||
|
#define ST25R3911_REG_RSSI_RESULT_rssi_pm3 (1U<<3)
|
||||||
|
#define ST25R3911_REG_RSSI_RESULT_mask_rssi_am (0xfU<<4)
|
||||||
|
#define ST25R3911_REG_RSSI_RESULT_shift_rssi_am (4U)
|
||||||
|
#define ST25R3911_REG_RSSI_RESULT_rssi_am_0 (1U<<4)
|
||||||
|
#define ST25R3911_REG_RSSI_RESULT_rssi_am_1 (1U<<5)
|
||||||
|
#define ST25R3911_REG_RSSI_RESULT_rssi_am_2 (1U<<6)
|
||||||
|
#define ST25R3911_REG_RSSI_RESULT_rssi_am_3 (1U<<7)
|
||||||
|
#define ST25R3911_REG_GAIN_RED_STATE_mask_gs_pm (0xfU)
|
||||||
|
#define ST25R3911_REG_GAIN_RED_STATE_shift_gs_pm (0U)
|
||||||
|
#define ST25R3911_REG_GAIN_RED_STATE_gs_pm_0 (1U<<0)
|
||||||
|
#define ST25R3911_REG_GAIN_RED_STATE_gs_pm_1 (1U<<1)
|
||||||
|
#define ST25R3911_REG_GAIN_RED_STATE_gs_pm_2 (1U<<2)
|
||||||
|
#define ST25R3911_REG_GAIN_RED_STATE_gs_pm_3 (1U<<3)
|
||||||
|
#define ST25R3911_REG_GAIN_RED_STATE_mask_gs_am (0xfU<<4)
|
||||||
|
#define ST25R3911_REG_GAIN_RED_STATE_shift_gs_am (4U)
|
||||||
|
#define ST25R3911_REG_GAIN_RED_STATE_gs_am_0 (1U<<4)
|
||||||
|
#define ST25R3911_REG_GAIN_RED_STATE_gs_am_1 (1U<<5)
|
||||||
|
#define ST25R3911_REG_GAIN_RED_STATE_gs_am_2 (1U<<6)
|
||||||
|
#define ST25R3911_REG_GAIN_RED_STATE_gs_am_3 (1U<<7)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_CONTROL_cs_g0 (1U<<0)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_CONTROL_cs_g1 (1U<<1)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_CONTROL_cs_g2 (1U<<2)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_CONTROL_mask_cs_g (7U<<0)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_CONTROL_cs_mcal0 (1U<<3)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_CONTROL_cs_mcal1 (1U<<4)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_CONTROL_cs_mcal2 (1U<<5)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_CONTROL_cs_mcal3 (1U<<6)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_CONTROL_cs_mcal4 (1U<<7)
|
||||||
|
#define ST25R3916_REG_CAP_SENSOR_CONTROL_mask_cs_mcal (0x1fU<<3)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_CONTROL_shift_cs_mcal (3U)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_RESULT_cs_cal_err (1U<<1)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_RESULT_cs_cal_end (1U<<2)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_RESULT_cs_cal0 (1U<<3)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_RESULT_cs_cal1 (1U<<4)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_RESULT_cs_cal2 (1U<<5)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_RESULT_cs_cal3 (1U<<6)
|
||||||
|
#define ST25R3911_REG_CAP_SENSOR_RESULT_cs_cal4 (1U<<7)
|
||||||
|
#define ST25R3911_REG_AUX_DISPLAY_mrt_on (1U<<0)
|
||||||
|
#define ST25R3911_REG_AUX_DISPLAY_nrt_on (1U<<1)
|
||||||
|
#define ST25R3911_REG_AUX_DISPLAY_gpt_on (1U<<2)
|
||||||
|
#define ST25R3911_REG_AUX_DISPLAY_rx_on (1U<<3)
|
||||||
|
#define ST25R3911_REG_AUX_DISPLAY_osc_ok (1U<<4)
|
||||||
|
#define ST25R3911_REG_AUX_DISPLAY_tx_on (1U<<5)
|
||||||
|
#define ST25R3911_REG_AUX_DISPLAY_efd_o (1U<<6)
|
||||||
|
#define ST25R3911_REG_AUX_DISPLAY_a_cha (1U<<7)
|
||||||
|
#define ST25R3911_REG_WUP_TIMER_CONTROL_wcap (1U<<0)
|
||||||
|
#define ST25R3911_REG_WUP_TIMER_CONTROL_wph (1U<<1)
|
||||||
|
#define ST25R3911_REG_WUP_TIMER_CONTROL_wam (1U<<2)
|
||||||
|
#define ST25R3911_REG_WUP_TIMER_CONTROL_wto (1U<<3)
|
||||||
|
#define ST25R3911_REG_WUP_TIMER_CONTROL_wut0 (1U<<4)
|
||||||
|
#define ST25R3911_REG_WUP_TIMER_CONTROL_wut1 (1U<<5)
|
||||||
|
#define ST25R3911_REG_WUP_TIMER_CONTROL_wut2 (1U<<6)
|
||||||
|
#define ST25R3911_REG_WUP_TIMER_CONTROL_shift_wut (4U)
|
||||||
|
#define ST25R3911_REG_WUP_TIMER_CONTROL_wur (1U<<7)
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_CONF_am_ae (1U<<0)
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_CONF_am_aew0 (1U<<1)
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_CONF_am_aew1 (1U<<2)
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_CONF_shift_am_aew (1U)
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_CONF_mask_am_aew (3U<<1)
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_CONF_am_aam (1U<<3)
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_CONF_am_d0 (1U<<4)
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_CONF_am_d1 (1U<<5)
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_CONF_am_d2 (1U<<6)
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_CONF_am_d3 (1U<<7)
|
||||||
|
#define ST25R3911_REG_AMPLITUDE_MEASURE_CONF_shift_am_d (4U)
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_CONF_pm_ae (1U<<0)
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_CONF_pm_aew0 (1U<<1)
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_CONF_pm_aew1 (1U<<2)
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_CONF_shift_pm_aew (1U)
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_CONF_mask_pm_aew (3U<<1)
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_CONF_pm_aam (1U<<3)
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_CONF_pm_d0 (1U<<4)
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_CONF_pm_d1 (1U<<5)
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_CONF_pm_d2 (1U<<6)
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_CONF_pm_d3 (1U<<7)
|
||||||
|
#define ST25R3911_REG_PHASE_MEASURE_CONF_shift_pm_d (4U)
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_CONF_cm_ae (1U<<0)
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_CONF_cm_aew0 (1U<<1)
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_CONF_cm_aew1 (1U<<2)
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_CONF_shift_cm_aew (1U)
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_CONF_mask_cm_aew (3U<<1)
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_CONF_cm_aam (1U<<3)
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_CONF_cm_d0 (1U<<4)
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_CONF_cm_d1 (1U<<5)
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_CONF_cm_d2 (1U<<6)
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_CONF_cm_d3 (1U<<7)
|
||||||
|
#define ST25R3911_REG_CAPACITANCE_MEASURE_CONF_shift_cm_d (4U)
|
||||||
|
#define ST25R3911_REG_IC_IDENTITY_v2 (0x09U)
|
||||||
|
#define ST25R3911_REG_IC_IDENTITY_ic_type (1U<<3)
|
||||||
|
#define ST25R3911_REG_IC_IDENTITY_mask_ic_type (0x1FU<<3)
|
||||||
|
#define ST25R3911_REG_IC_IDENTITY_shift_ic_type (3U)
|
||||||
|
#define ST25R3911_REG_IC_IDENTITY_mask_ic_rev (7U)
|
||||||
|
|
||||||
|
/*! \endcond DOXYGEN_SUPRESS */
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL FUNCTION PROTOTYPES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Returns the content of a register within the ST25R3911
|
||||||
|
*
|
||||||
|
* This function is used to read out the content of ST25R3911 registers.
|
||||||
|
*
|
||||||
|
* \param[in] reg: Address of register to read.
|
||||||
|
* \param[out] value: Returned value.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911ReadRegister(uint8_t reg, uint8_t* value);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Writes a given value to a register within the ST25R3911
|
||||||
|
*
|
||||||
|
* This function is used to write \a value to address \a reg within the ST25R3911.
|
||||||
|
*
|
||||||
|
* \param[in] reg: Address of the register to write.
|
||||||
|
* \param[in] value: Value to be written.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911WriteRegister(uint8_t reg, uint8_t value);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Cleart bits on Register
|
||||||
|
*
|
||||||
|
* This function clears the given bitmask on the register
|
||||||
|
*
|
||||||
|
* \warning This method does not guarantee consistency of register content
|
||||||
|
* when called from multiple contexts (task, ISR, thread)
|
||||||
|
*
|
||||||
|
* \param[in] reg: Address of the register clear
|
||||||
|
* \param[in] clr_mask: Bitmask of bit to be cleared
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911ClrRegisterBits( uint8_t reg, uint8_t clr_mask );
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Set bits on Register
|
||||||
|
*
|
||||||
|
* This function sets the given bitmask on the register
|
||||||
|
*
|
||||||
|
* \warning This method does not guarantee consistency of register content
|
||||||
|
* when called from multiple contexts (task, ISR, thread)
|
||||||
|
*
|
||||||
|
* \param[in] reg: Address of the register clear
|
||||||
|
* \param[in] set_mask: Bitmask of bit to be cleared
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911SetRegisterBits( uint8_t reg, uint8_t set_mask );
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Changes the given bits on a ST25R3911 register
|
||||||
|
*
|
||||||
|
* This function is used if only a particular bits should be changed within
|
||||||
|
* an ST25R3911 register.
|
||||||
|
*
|
||||||
|
* \warning This method does not guarantee consistency of register content
|
||||||
|
* when called from multiple contexts (task, ISR, thread)
|
||||||
|
*
|
||||||
|
* \param[in] reg: Address of the register to write.
|
||||||
|
* \param[in] valueMask: bitmask of bits to be changed
|
||||||
|
* \param[in] value: the bits to be written on the enabled valueMask bits
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911ChangeRegisterBits(uint8_t reg, uint8_t valueMask, uint8_t value);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Read a test register within the ST25R3911
|
||||||
|
*
|
||||||
|
* This function is used to read the content of test address \a reg within the ST25R3911.
|
||||||
|
*
|
||||||
|
* \param[in] reg: Address of the register to read.
|
||||||
|
* \param[out] value: Returned read.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911ReadTestRegister(uint8_t reg, uint8_t* value);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Writes a given value to a test register within the ST25R3911
|
||||||
|
*
|
||||||
|
* This function is used to write \a value to test address \a reg within the ST25R3911.
|
||||||
|
*
|
||||||
|
* \param[in] reg: Address of the register to write.
|
||||||
|
* \param[in] value: Value to be written.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911WriteTestRegister(uint8_t reg, uint8_t value);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Modifies a value within a ST25R3911 register
|
||||||
|
*
|
||||||
|
* This function is used if only a particular bits should be changed within
|
||||||
|
* an ST25R3911 register.
|
||||||
|
*
|
||||||
|
* \warning This method does not guarantee consistency of register content
|
||||||
|
* when called from multiple contexts (task, ISR, thread)
|
||||||
|
*
|
||||||
|
* \param[in] reg: Address of the register to write.
|
||||||
|
* \param[in] clr_mask: bitmask of bits to be cleared to 0.
|
||||||
|
* \param[in] set_mask: bitmask of bits to be set to 1.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911ModifyRegister(uint8_t reg, uint8_t clr_mask, uint8_t set_mask);
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Changes the given bits on a ST25R3911 Test register
|
||||||
|
*
|
||||||
|
* This function is used if only a particular bits should be changed within
|
||||||
|
* an ST25R3916 register.
|
||||||
|
*
|
||||||
|
* \param[in] reg: Address of the Test register to change.
|
||||||
|
* \param[in] valueMask: bitmask of bits to be changed
|
||||||
|
* \param[in] value: the bits to be written on the enabled valueMask bits
|
||||||
|
*
|
||||||
|
* \warning This method does not guarantee consistency of register content
|
||||||
|
* when called from multiple contexts (task, ISR, thread)
|
||||||
|
|
||||||
|
* \return ERR_NONE : Operation successful
|
||||||
|
* \return ERR_PARAM : Invalid parameter
|
||||||
|
* \return ERR_SEND : Transmission error or acknowledge not received
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911ChangeTestRegisterBits( uint8_t reg, uint8_t valueMask, uint8_t value );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Writes multiple values to ST25R3911 registers
|
||||||
|
*
|
||||||
|
* This function is used to write multiple values to the ST25R3911 using the
|
||||||
|
* auto-increment feature. That is, after each write the address pointer
|
||||||
|
* inside the ST25R3911 gets incremented automatically.
|
||||||
|
*
|
||||||
|
* \param[in] reg: Address of the frist register to write.
|
||||||
|
* \param[in] values: pointer to a buffer containing the values to be written.
|
||||||
|
* \param[in] length: Number of values to be written.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911WriteMultipleRegisters(uint8_t reg, const uint8_t* values, uint8_t length);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Reads from multiple ST25R3911 registers
|
||||||
|
*
|
||||||
|
* This function is used to read from multiple registers using the
|
||||||
|
* auto-increment feature. That is, after each read the address pointer
|
||||||
|
* inside the ST25R3911 gets incremented automatically.
|
||||||
|
*
|
||||||
|
* \param[in] reg: Address of the frist register to read from.
|
||||||
|
* \param[in] values: pointer to a buffer where the result shall be written to.
|
||||||
|
* \param[in] length: Number of registers to be read out.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911ReadMultipleRegisters(uint8_t reg, uint8_t* values, uint8_t length);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Writes values to ST25R3911 FIFO
|
||||||
|
*
|
||||||
|
* This function needs to be called in order to write to the ST25R3911 FIFO.
|
||||||
|
*
|
||||||
|
* \param[in] values: pointer to a buffer containing the values to be written
|
||||||
|
* to the FIFO.
|
||||||
|
* \param[in] length: Number of values to be written.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911WriteFifo(const uint8_t* values, uint8_t length);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Read values from ST25R3911 FIFO
|
||||||
|
*
|
||||||
|
* This function needs to be called in order to read from ST25R3911 FIFO.
|
||||||
|
*
|
||||||
|
* \param[out] buf: pointer to a buffer where the FIFO content shall be
|
||||||
|
* written to.
|
||||||
|
* \param[in] length: Number of bytes to read. (= size of \a buf)
|
||||||
|
* \note: This function doesn't check whether \a length is really the
|
||||||
|
* number of available bytes in FIFO
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911ReadFifo(uint8_t* buf, uint8_t length);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Execute a direct command
|
||||||
|
*
|
||||||
|
* This function is used to start so-called direct command. These commands
|
||||||
|
* are implemented inside the chip and each command has unique code (see
|
||||||
|
* datasheet).
|
||||||
|
*
|
||||||
|
* \param[in] cmd : code of the direct command to be executed.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911ExecuteCommand(uint8_t cmd);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Execute several direct commands
|
||||||
|
*
|
||||||
|
* This function is used to start so-called direct command. These commands
|
||||||
|
* are implemented inside the chip and each command has unique code (see
|
||||||
|
* datasheet).
|
||||||
|
*
|
||||||
|
* \param[in] cmds : codes of the direct command to be executed.
|
||||||
|
* \param[in] length : number of commands to be executed
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911ExecuteCommands(const uint8_t *cmds, uint8_t length);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Check if register ID is valid
|
||||||
|
*
|
||||||
|
* Checks if the given register ID a valid ST25R3911 register
|
||||||
|
*
|
||||||
|
* \param[in] reg: Address of register to check
|
||||||
|
*
|
||||||
|
* \return true if is a valid register ID
|
||||||
|
* \return false otherwise
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern bool st25r3911IsRegValid( uint8_t reg );
|
||||||
|
|
||||||
|
#endif /* ST25R3911_COM_H */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
249
Software/Drivers/BSP/Components/ST25R3911/st25r3911_interrupt.c
Normal file
249
Software/Drivers/BSP/Components/ST25R3911/st25r3911_interrupt.c
Normal file
@ -0,0 +1,249 @@
|
|||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* \attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PROJECT: ST25R3911 firmware
|
||||||
|
* Revision:
|
||||||
|
* LANGUAGE: ISO C99
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author Ulrich Herrmann
|
||||||
|
*
|
||||||
|
* \brief ST25R3911 Interrupt handling
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#include "st25r3911_interrupt.h"
|
||||||
|
#include "st25r3911_com.h"
|
||||||
|
#include "st25r3911.h"
|
||||||
|
#include "st_errno.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! Length of the interrupt registers */
|
||||||
|
#define ST25R3911_INT_REGS_LEN ( (ST25R3911_REG_IRQ_ERROR_WUP - ST25R3911_REG_IRQ_MAIN) + 1U )
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL DATA TYPES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! Holds current and previous interrupt callback pointer as well as current Interrupt status and mask */
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
void (*prevCallback)(void); /*!< call back function for 3911 interrupt */
|
||||||
|
void (*callback)(void); /*!< call back function for 3911 interrupt */
|
||||||
|
uint32_t status; /*!< latest interrupt status */
|
||||||
|
uint32_t mask; /*!< Interrupt mask. Negative mask = ST25R3911 mask regs */
|
||||||
|
}t_st25r3911Interrupt;
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL VARIABLES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
static volatile t_st25r3911Interrupt st25r3911interrupt; /*!< Instance of ST25R3911 interrupt */
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL FUNCTIONS
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
void st25r3911InitInterrupts( void )
|
||||||
|
{
|
||||||
|
platformIrqST25R3911PinInitialize();
|
||||||
|
platformIrqST25R3911SetCallback( st25r3911Isr );
|
||||||
|
|
||||||
|
st25r3911interrupt.callback = NULL;
|
||||||
|
st25r3911interrupt.prevCallback = NULL;
|
||||||
|
st25r3911interrupt.status = ST25R3911_IRQ_MASK_NONE;
|
||||||
|
st25r3911interrupt.mask = ST25R3911_IRQ_MASK_NONE;
|
||||||
|
|
||||||
|
/* Initialize LEDs if existing and defined */
|
||||||
|
platformLedsInitialize();
|
||||||
|
|
||||||
|
#ifdef PLATFORM_LED_RX_PIN
|
||||||
|
platformLedOff( PLATFORM_LED_RX_PORT, PLATFORM_LED_RX_PIN );
|
||||||
|
#endif /* PLATFORM_LED_RX_PIN */
|
||||||
|
|
||||||
|
#ifdef PLATFORM_LED_FIELD_PIN
|
||||||
|
platformLedOff( PLATFORM_LED_FIELD_PORT, PLATFORM_LED_FIELD_PIN );
|
||||||
|
#endif /* PLATFORM_LED_FIELD_PIN */
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911Isr( void )
|
||||||
|
{
|
||||||
|
st25r3911CheckForReceivedInterrupts();
|
||||||
|
|
||||||
|
if (NULL != st25r3911interrupt.callback)
|
||||||
|
{
|
||||||
|
st25r3911interrupt.callback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911CheckForReceivedInterrupts( void )
|
||||||
|
{
|
||||||
|
uint8_t iregs[ST25R3911_INT_REGS_LEN];
|
||||||
|
uint32_t irqStatus;
|
||||||
|
|
||||||
|
irqStatus = ST25R3911_IRQ_MASK_NONE;
|
||||||
|
ST_MEMSET( iregs, (int32_t)(ST25R3911_IRQ_MASK_ALL & 0xFFU), ST25R3911_INT_REGS_LEN ); /* MISRA 10.3 */
|
||||||
|
|
||||||
|
/* In case the IRQ is Edge (not Level) triggered read IRQs until done */
|
||||||
|
while( platformGpioIsHigh( ST25R391X_INT_PORT, ST25R391X_INT_PIN ) )
|
||||||
|
{
|
||||||
|
st25r3911ReadMultipleRegisters(ST25R3911_REG_IRQ_MAIN, iregs, sizeof(iregs));
|
||||||
|
|
||||||
|
#ifdef PLATFORM_LED_FIELD_PIN
|
||||||
|
if ((iregs[0] & ST25R3911_IRQ_MASK_TXE) != 0U)
|
||||||
|
{
|
||||||
|
platformLedOn( PLATFORM_LED_FIELD_PORT, PLATFORM_LED_FIELD_PIN );
|
||||||
|
}
|
||||||
|
#endif /* PLATFORM_LED_FIELD_PIN */
|
||||||
|
|
||||||
|
#ifdef PLATFORM_LED_RX_PIN
|
||||||
|
if ((iregs[0] & ST25R3911_IRQ_MASK_RXS) != 0)
|
||||||
|
{
|
||||||
|
platformLedOn( PLATFORM_LED_RX_PORT, PLATFORM_LED_RX_PIN );
|
||||||
|
}
|
||||||
|
if (((iregs[0] & ST25R3911_IRQ_MASK_RXE) != 0) || ((iregs[1] & (ST25R3911_IRQ_MASK_NRE >> 8)) != 0)) /* In rare cases there is rxs but not rxe, then we have nre */
|
||||||
|
{
|
||||||
|
platformLedOff( PLATFORM_LED_RX_PORT, PLATFORM_LED_RX_PIN );
|
||||||
|
}
|
||||||
|
#endif /* PLATFORM_LED_RX_PIN */
|
||||||
|
|
||||||
|
irqStatus |= (uint32_t)iregs[0];
|
||||||
|
irqStatus |= (uint32_t)iregs[1]<<8;
|
||||||
|
irqStatus |= (uint32_t)iregs[2]<<16;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Forward all interrupts, even masked ones to application. */
|
||||||
|
platformProtectST25R391xIrqStatus();
|
||||||
|
st25r3911interrupt.status |= irqStatus;
|
||||||
|
platformUnprotectST25R391xIrqStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void st25r3911ModifyInterrupts(uint32_t clr_mask, uint32_t set_mask)
|
||||||
|
{
|
||||||
|
uint8_t i;
|
||||||
|
uint32_t old_mask;
|
||||||
|
uint32_t new_mask;
|
||||||
|
|
||||||
|
old_mask = st25r3911interrupt.mask;
|
||||||
|
new_mask = (~old_mask & set_mask) | (old_mask & clr_mask);
|
||||||
|
st25r3911interrupt.mask &= ~clr_mask;
|
||||||
|
st25r3911interrupt.mask |= set_mask;
|
||||||
|
for (i=0; i<3U ; i++)
|
||||||
|
{
|
||||||
|
if (((new_mask >> (i*8U)) & 0xffU) == 0U) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
st25r3911WriteRegister((ST25R3911_REG_IRQ_MASK_MAIN + i), (uint8_t)((st25r3911interrupt.mask>>(i*8U))&0xffU));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
uint32_t st25r3911WaitForInterruptsTimed(uint32_t mask, uint16_t tmo)
|
||||||
|
{
|
||||||
|
uint32_t tmr;
|
||||||
|
uint32_t status;
|
||||||
|
|
||||||
|
tmr = platformTimerCreate(tmo);
|
||||||
|
do
|
||||||
|
{
|
||||||
|
status = (st25r3911interrupt.status & mask);
|
||||||
|
} while( ( !platformTimerIsExpired( tmr ) || (tmo == 0U)) && (status == 0U) );
|
||||||
|
|
||||||
|
status = st25r3911interrupt.status & mask;
|
||||||
|
|
||||||
|
platformProtectST25R391xIrqStatus();
|
||||||
|
st25r3911interrupt.status &= ~status;
|
||||||
|
platformUnprotectST25R391xIrqStatus();
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t st25r3911GetInterrupt(uint32_t mask)
|
||||||
|
{
|
||||||
|
uint32_t irqs;
|
||||||
|
|
||||||
|
irqs = (st25r3911interrupt.status & mask);
|
||||||
|
if (irqs != ST25R3911_IRQ_MASK_NONE)
|
||||||
|
{
|
||||||
|
platformProtectST25R391xIrqStatus();
|
||||||
|
st25r3911interrupt.status &= ~irqs;
|
||||||
|
platformUnprotectST25R391xIrqStatus();
|
||||||
|
}
|
||||||
|
return irqs;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911EnableInterrupts(uint32_t mask)
|
||||||
|
{
|
||||||
|
st25r3911ModifyInterrupts(mask,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911DisableInterrupts(uint32_t mask)
|
||||||
|
{
|
||||||
|
st25r3911ModifyInterrupts(0,mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911ClearInterrupts( void )
|
||||||
|
{
|
||||||
|
uint8_t iregs[3];
|
||||||
|
|
||||||
|
st25r3911ReadMultipleRegisters(ST25R3911_REG_IRQ_MAIN, iregs, 3);
|
||||||
|
|
||||||
|
platformProtectST25R391xIrqStatus();
|
||||||
|
st25r3911interrupt.status = 0;
|
||||||
|
platformUnprotectST25R391xIrqStatus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911IRQCallbackSet( void (*cb)(void) )
|
||||||
|
{
|
||||||
|
st25r3911interrupt.prevCallback = st25r3911interrupt.callback;
|
||||||
|
st25r3911interrupt.callback = cb;
|
||||||
|
}
|
||||||
|
|
||||||
|
void st25r3911IRQCallbackRestore( void )
|
||||||
|
{
|
||||||
|
st25r3911interrupt.callback = st25r3911interrupt.prevCallback;
|
||||||
|
st25r3911interrupt.prevCallback = NULL;
|
||||||
|
}
|
||||||
|
|
250
Software/Drivers/BSP/Components/ST25R3911/st25r3911_interrupt.h
Normal file
250
Software/Drivers/BSP/Components/ST25R3911/st25r3911_interrupt.h
Normal file
@ -0,0 +1,250 @@
|
|||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* \attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PROJECT: ST25R3911 firmware
|
||||||
|
* Revision:
|
||||||
|
* LANGUAGE: ISO C99
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author Ulrich Herrmann
|
||||||
|
*
|
||||||
|
* \brief ST25R3911 Interrupt header file
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* \addtogroup RFAL
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* \addtogroup RFAL-HAL
|
||||||
|
* \brief RFAL Hardware Abstraction Layer
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* \addtogroup ST25R3911
|
||||||
|
* \brief RFAL ST25R3911 Driver
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* \addtogroup ST25R3911_Interrupt
|
||||||
|
* \brief RFAL ST25R3911 Interrupt
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ST25R3911_INTERRUPT_H
|
||||||
|
#define ST25R3911_INTERRUPT_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#include "platform.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Main interrupt register. */
|
||||||
|
#define ST25R3911_IRQ_MASK_ALL (uint32_t)(0xFFFFFFU) /*!< All ST25R3911 interrupt sources */
|
||||||
|
#define ST25R3911_IRQ_MASK_NONE (uint32_t)(0U) /*!< No ST25R3911 interrupt source */
|
||||||
|
#define ST25R3911_IRQ_MASK_OSC (uint32_t)(0x80U) /*!< ST25R3911 oscillator stable interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_FWL (uint32_t)(0x40U) /*!< ST25R3911 FIFO water level interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_RXS (uint32_t)(0x20U) /*!< ST25R3911 start of receive interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_RXE (uint32_t)(0x10U) /*!< ST25R3911 end of receive interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_TXE (uint32_t)(0x08U) /*!< ST25R3911 end of transmission interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_COL (uint32_t)(0x04U) /*!< ST25R3911 bit collision interrupt */
|
||||||
|
|
||||||
|
/* Timer and NFC interrupt register. */
|
||||||
|
#define ST25R3911_IRQ_MASK_DCT (uint32_t)(0x8000U) /*!< ST25R3911 termination of direct command interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_NRE (uint32_t)(0x4000U) /*!< ST25R3911 no-response timer expired interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_GPE (uint32_t)(0x2000U) /*!< ST25R3911 general purpose timer expired interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_EON (uint32_t)(0x1000U) /*!< ST25R3911 external field on interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_EOF (uint32_t)(0x0800U) /*!< ST25R3911 external field off interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_CAC (uint32_t)(0x0400U) /*!< ST25R3911 collision during RF collision avoidance interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_CAT (uint32_t)(0x0200U) /*!< ST25R3911 minimum guard time expired interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_NFCT (uint32_t)(0x0100U) /*!< ST25R3911 initiator bit rate recognized interrupt */
|
||||||
|
|
||||||
|
/* Error and wake-up interrupt register. */
|
||||||
|
#define ST25R3911_IRQ_MASK_CRC (uint32_t)(0x800000U) /*!< ST25R3911 CRC error interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_PAR (uint32_t)(0x400000U) /*!< ST25R3911 parity error interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_ERR2 (uint32_t)(0x200000U) /*!< ST25R3911 soft framing error interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_ERR1 (uint32_t)(0x100000U) /*!< ST25R3911 hard framing error interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_WT (uint32_t)(0x080000U) /*!< ST25R3911 wake-up interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_WAM (uint32_t)(0x040000U) /*!< ST25R3911 wake-up due to amplitude interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_WPH (uint32_t)(0x020000U) /*!< ST25R3911 wake-up due to phase interrupt */
|
||||||
|
#define ST25R3911_IRQ_MASK_WCAP (uint32_t)(0x010000U) /*!< ST25R3911 wake-up due to capacitance measurement */
|
||||||
|
|
||||||
|
|
||||||
|
#define ST25R3911_IRQ_MASK_TIM (0x02U) /*!< additional interrupts in ST25R3911_REG_IRQ_TIMER_NFC */
|
||||||
|
#define ST25R3911_IRQ_MASK_ERR (0x01U) /*!< additional interrupts in ST25R3911_REG_IRQ_ERROR_WUP */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL FUNCTION PROTOTYPES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Wait until an ST25R3911 interrupt occurs
|
||||||
|
*
|
||||||
|
* This function is used to access the ST25R3911 interrupt flags. Use this
|
||||||
|
* to wait for max. \a tmo milliseconds for the \b first interrupt indicated
|
||||||
|
* with mask \a mask to occur.
|
||||||
|
*
|
||||||
|
* \param[in] mask : mask indicating the interrupts to wait for.
|
||||||
|
* \param[in] tmo : time in milliseconds until timeout occurs. If set to 0
|
||||||
|
* the functions waits forever.
|
||||||
|
*
|
||||||
|
* \return : 0 if timeout occurred otherwise a mask indicating the cleared
|
||||||
|
* interrupts.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern uint32_t st25r3911WaitForInterruptsTimed(uint32_t mask, uint16_t tmo);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Get status for the given interrupt
|
||||||
|
*
|
||||||
|
* This function is used to check whether the interrupt given by \a mask
|
||||||
|
* has occurred. If yes the interrupt gets cleared. This function returns
|
||||||
|
* only status bits which are inside \a mask.
|
||||||
|
*
|
||||||
|
* \param[in] mask : mask indicating the interrupt to check for.
|
||||||
|
*
|
||||||
|
* \return the mask of the interrupts occurred
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern uint32_t st25r3911GetInterrupt(uint32_t mask);
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Init the 3911 interrupt
|
||||||
|
*
|
||||||
|
* This function initiates the 3911 interrupts.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911InitInterrupts( void );
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Modifies the Interrupt
|
||||||
|
*
|
||||||
|
* This function modifies the interrupt
|
||||||
|
*
|
||||||
|
* \param[in] clr_mask : bit mask to be cleared on the interrupt mask
|
||||||
|
* \param[in] set_mask : bit mask to be set on the interrupt mask
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911ModifyInterrupts(uint32_t clr_mask, uint32_t set_mask);
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Checks received interrupts
|
||||||
|
*
|
||||||
|
* Checks received interrupts and saves the result into global params
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911CheckForReceivedInterrupts( void );
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief ISR Service routine
|
||||||
|
*
|
||||||
|
* This function modifies the interrupt
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911Isr( void );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Enable a given ST25R3911 Interrupt source
|
||||||
|
*
|
||||||
|
* This function enables all interrupts given by \a mask,
|
||||||
|
* ST25R3911_IRQ_MASK_ALL enables all interrupts.
|
||||||
|
*
|
||||||
|
* \param[in] mask: mask indicating the interrupts to be enabled
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911EnableInterrupts(uint32_t mask);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Disable one or more a given ST25R3911 Interrupt sources
|
||||||
|
*
|
||||||
|
* This function disables all interrupts given by \a mask. 0xff disables all.
|
||||||
|
*
|
||||||
|
* \param[in] mask: mask indicating the interrupts to be disabled.
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911DisableInterrupts(uint32_t mask);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Clear all st25r3911 irq flags
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911ClearInterrupts(void);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Sets IRQ callback for the ST25R3911 interrupt
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911IRQCallbackSet(void (*cb)(void));
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Sets IRQ callback for the ST25R3911 interrupt
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
extern void st25r3911IRQCallbackRestore(void);
|
||||||
|
|
||||||
|
#endif /* ST25R3911_ISR_H */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*/
|
165
Software/Drivers/BSP/Components/ST25R3911/st_errno.h
Normal file
165
Software/Drivers/BSP/Components/ST25R3911/st_errno.h
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* \attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PROJECT: STxxxx firmware
|
||||||
|
* LANGUAGE: ISO C99
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file st_errno.h
|
||||||
|
*
|
||||||
|
* \author
|
||||||
|
*
|
||||||
|
* \brief Main error codes
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ST_ERRNO_H
|
||||||
|
#define ST_ERRNO_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL DATA TYPES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef uint16_t ReturnCode; /*!< Standard Return Code type from function. */
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Error codes to be used within the application.
|
||||||
|
* They are represented by an uint8_t
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define ERR_NONE ((ReturnCode)0U) /*!< no error occurred */
|
||||||
|
#define ERR_NOMEM ((ReturnCode)1U) /*!< not enough memory to perform the requested operation */
|
||||||
|
#define ERR_BUSY ((ReturnCode)2U) /*!< device or resource busy */
|
||||||
|
#define ERR_IO ((ReturnCode)3U) /*!< generic IO error */
|
||||||
|
#define ERR_TIMEOUT ((ReturnCode)4U) /*!< error due to timeout */
|
||||||
|
#define ERR_REQUEST ((ReturnCode)5U) /*!< invalid request or requested function can't be executed at the moment */
|
||||||
|
#define ERR_NOMSG ((ReturnCode)6U) /*!< No message of desired type */
|
||||||
|
#define ERR_PARAM ((ReturnCode)7U) /*!< Parameter error */
|
||||||
|
#define ERR_SYSTEM ((ReturnCode)8U) /*!< System error */
|
||||||
|
#define ERR_FRAMING ((ReturnCode)9U) /*!< Framing error */
|
||||||
|
#define ERR_OVERRUN ((ReturnCode)10U) /*!< lost one or more received bytes */
|
||||||
|
#define ERR_PROTO ((ReturnCode)11U) /*!< protocol error */
|
||||||
|
#define ERR_INTERNAL ((ReturnCode)12U) /*!< Internal Error */
|
||||||
|
#define ERR_AGAIN ((ReturnCode)13U) /*!< Call again */
|
||||||
|
#define ERR_MEM_CORRUPT ((ReturnCode)14U) /*!< memory corruption */
|
||||||
|
#define ERR_NOT_IMPLEMENTED ((ReturnCode)15U) /*!< not implemented */
|
||||||
|
#define ERR_PC_CORRUPT ((ReturnCode)16U) /*!< Program Counter has been manipulated or spike/noise trigger illegal operation */
|
||||||
|
#define ERR_SEND ((ReturnCode)17U) /*!< error sending*/
|
||||||
|
#define ERR_IGNORE ((ReturnCode)18U) /*!< indicates error detected but to be ignored */
|
||||||
|
#define ERR_SEMANTIC ((ReturnCode)19U) /*!< indicates error in state machine (unexpected cmd) */
|
||||||
|
#define ERR_SYNTAX ((ReturnCode)20U) /*!< indicates error in state machine (unknown cmd) */
|
||||||
|
#define ERR_CRC ((ReturnCode)21U) /*!< crc error */
|
||||||
|
#define ERR_NOTFOUND ((ReturnCode)22U) /*!< transponder not found */
|
||||||
|
#define ERR_NOTUNIQUE ((ReturnCode)23U) /*!< transponder not unique - more than one transponder in field */
|
||||||
|
#define ERR_NOTSUPP ((ReturnCode)24U) /*!< requested operation not supported */
|
||||||
|
#define ERR_WRITE ((ReturnCode)25U) /*!< write error */
|
||||||
|
#define ERR_FIFO ((ReturnCode)26U) /*!< fifo over or underflow error */
|
||||||
|
#define ERR_PAR ((ReturnCode)27U) /*!< parity error */
|
||||||
|
#define ERR_DONE ((ReturnCode)28U) /*!< transfer has already finished */
|
||||||
|
#define ERR_RF_COLLISION ((ReturnCode)29U) /*!< collision error (Bit Collision or during RF Collision avoidance ) */
|
||||||
|
#define ERR_HW_OVERRUN ((ReturnCode)30U) /*!< lost one or more received bytes */
|
||||||
|
#define ERR_RELEASE_REQ ((ReturnCode)31U) /*!< device requested release */
|
||||||
|
#define ERR_SLEEP_REQ ((ReturnCode)32U) /*!< device requested sleep */
|
||||||
|
#define ERR_WRONG_STATE ((ReturnCode)33U) /*!< incorrent state for requested operation */
|
||||||
|
#define ERR_MAX_RERUNS ((ReturnCode)34U) /*!< blocking procedure reached maximum runs */
|
||||||
|
#define ERR_DISABLED ((ReturnCode)35U) /*!< operation aborted due to disabled configuration */
|
||||||
|
#define ERR_HW_MISMATCH ((ReturnCode)36U) /*!< expected hw do not match */
|
||||||
|
#define ERR_LINK_LOSS ((ReturnCode)37U) /*!< Other device's field didn't behave as expected: turned off by Initiator in Passive mode, or AP2P did not turn on field */
|
||||||
|
#define ERR_INVALID_HANDLE ((ReturnCode)38U) /*!< invalid or not initalized device handle */
|
||||||
|
|
||||||
|
#define ERR_INCOMPLETE_BYTE ((ReturnCode)40U) /*!< Incomplete byte rcvd */
|
||||||
|
#define ERR_INCOMPLETE_BYTE_01 ((ReturnCode)41U) /*!< Incomplete byte rcvd - 1 bit */
|
||||||
|
#define ERR_INCOMPLETE_BYTE_02 ((ReturnCode)42U) /*!< Incomplete byte rcvd - 2 bit */
|
||||||
|
#define ERR_INCOMPLETE_BYTE_03 ((ReturnCode)43U) /*!< Incomplete byte rcvd - 3 bit */
|
||||||
|
#define ERR_INCOMPLETE_BYTE_04 ((ReturnCode)44U) /*!< Incomplete byte rcvd - 4 bit */
|
||||||
|
#define ERR_INCOMPLETE_BYTE_05 ((ReturnCode)45U) /*!< Incomplete byte rcvd - 5 bit */
|
||||||
|
#define ERR_INCOMPLETE_BYTE_06 ((ReturnCode)46U) /*!< Incomplete byte rcvd - 6 bit */
|
||||||
|
#define ERR_INCOMPLETE_BYTE_07 ((ReturnCode)47U) /*!< Incomplete byte rcvd - 7 bit */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* General Sub-category number */
|
||||||
|
#define ERR_GENERIC_GRP (0x0000) /*!< Reserved value for generic error no */
|
||||||
|
#define ERR_WARN_GRP (0x0100) /*!< Errors which are not expected in normal operation */
|
||||||
|
#define ERR_PROCESS_GRP (0x0200) /*!< Processes management errors */
|
||||||
|
#define ERR_SIO_GRP (0x0800) /*!< SIO errors due to logging */
|
||||||
|
#define ERR_RINGBUF_GRP (0x0900) /*!< Ring Buffer errors */
|
||||||
|
#define ERR_MQ_GRP (0x0A00) /*!< MQ errors */
|
||||||
|
#define ERR_TIMER_GRP (0x0B00) /*!< Timer errors */
|
||||||
|
#define ERR_RFAL_GRP (0x0C00) /*!< RFAL errors */
|
||||||
|
#define ERR_UART_GRP (0x0D00) /*!< UART errors */
|
||||||
|
#define ERR_SPI_GRP (0x0E00) /*!< SPI errors */
|
||||||
|
#define ERR_I2C_GRP (0x0F00) /*!< I2c errors */
|
||||||
|
|
||||||
|
|
||||||
|
#define ERR_INSERT_SIO_GRP(x) (ERR_SIO_GRP | (x)) /*!< Insert the SIO grp */
|
||||||
|
#define ERR_INSERT_RINGBUF_GRP(x) (ERR_RINGBUF_GRP | (x)) /*!< Insert the Ring Buffer grp */
|
||||||
|
#define ERR_INSERT_RFAL_GRP(x) (ERR_RFAL_GRP | (x)) /*!< Insert the RFAL grp */
|
||||||
|
#define ERR_INSERT_SPI_GRP(x) (ERR_SPI_GRP | (x)) /*!< Insert the spi grp */
|
||||||
|
#define ERR_INSERT_I2C_GRP(x) (ERR_I2C_GRP | (x)) /*!< Insert the i2c grp */
|
||||||
|
#define ERR_INSERT_UART_GRP(x) (ERR_UART_GRP | (x)) /*!< Insert the uart grp */
|
||||||
|
#define ERR_INSERT_TIMER_GRP(x) (ERR_TIMER_GRP | (x)) /*!< Insert the timer grp */
|
||||||
|
#define ERR_INSERT_MQ_GRP(x) (ERR_MQ_GRP | (x)) /*!< Insert the mq grp */
|
||||||
|
#define ERR_INSERT_PROCESS_GRP(x) (ERR_PROCESS_GRP | (x)) /*!< Insert the process grp */
|
||||||
|
#define ERR_INSERT_WARN_GRP(x) (ERR_WARN_GRP | (x)) /*!< Insert the i2c grp */
|
||||||
|
#define ERR_INSERT_GENERIC_GRP(x) (ERR_GENERIC_GRP | (x)) /*!< Insert the generic grp */
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL MACROS
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define ERR_NO_MASK(x) ((uint16_t)(x) & 0x00FFU) /*!< Mask the error number */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*! Common code to exit a function with the error if function f return error */
|
||||||
|
#define EXIT_ON_ERR(r, f) \
|
||||||
|
(r) = (f); \
|
||||||
|
if (ERR_NONE != (r)) \
|
||||||
|
{ \
|
||||||
|
return (r); \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* ST_ERRNO_H */
|
||||||
|
|
121
Software/Drivers/BSP/Components/ST25R3911/timer.c
Normal file
121
Software/Drivers/BSP/Components/ST25R3911/timer.c
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
/*
|
||||||
|
* PROJECT: ST25R391x firmware
|
||||||
|
* $Revision: $
|
||||||
|
* LANGUAGE: ANSI C
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file timer.c
|
||||||
|
*
|
||||||
|
* \brief SW Timer implementation
|
||||||
|
*
|
||||||
|
* \author Gustavo Patricio
|
||||||
|
*
|
||||||
|
* This module makes use of a System Tick in millisconds and provides
|
||||||
|
* an abstraction for SW timers
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#include "timer.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* LOCAL VARIABLES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
static uint32_t timerStopwatchTick;
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL FUNCTIONS
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
uint32_t timerCalculateTimer( uint16_t time )
|
||||||
|
{
|
||||||
|
return (platformGetSysTick() + time);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
bool timerIsExpired( uint32_t timer )
|
||||||
|
{
|
||||||
|
uint32_t uDiff;
|
||||||
|
int32_t sDiff;
|
||||||
|
|
||||||
|
uDiff = (timer - platformGetSysTick()); /* Calculate the diff between the timers */
|
||||||
|
sDiff = uDiff; /* Convert the diff to a signed var */
|
||||||
|
/* Having done this has two side effects:
|
||||||
|
* 1) all differences smaller than -(2^31) ms (~25d) will become positive
|
||||||
|
* Signaling not expired: acceptable!
|
||||||
|
* 2) Time roll-over case will be handled correctly: super!
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Check if the given timer has expired already */
|
||||||
|
if( sDiff < 0 )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
void timerDelay( uint16_t tOut )
|
||||||
|
{
|
||||||
|
uint32_t t;
|
||||||
|
|
||||||
|
/* Calculate the timer and wait blocking until is running */
|
||||||
|
t = timerCalculateTimer( tOut );
|
||||||
|
while( timerIsRunning(t) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
void timerStopwatchStart( void )
|
||||||
|
{
|
||||||
|
timerStopwatchTick = platformGetSysTick();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************/
|
||||||
|
uint32_t timerStopwatchMeasure( void )
|
||||||
|
{
|
||||||
|
return (uint32_t)(platformGetSysTick() - timerStopwatchTick);
|
||||||
|
}
|
||||||
|
|
128
Software/Drivers/BSP/Components/ST25R3911/timer.h
Normal file
128
Software/Drivers/BSP/Components/ST25R3911/timer.h
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
/*
|
||||||
|
* PROJECT: ST25R391x firmware
|
||||||
|
* $Revision: $
|
||||||
|
* LANGUAGE: ANSI C
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file timer.h
|
||||||
|
*
|
||||||
|
* \brief SW Timer implementation header file
|
||||||
|
*
|
||||||
|
* This module makes use of a System Tick in millisconds and provides
|
||||||
|
* an abstraction for SW timers
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#include "platform.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL MACROS
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#define timerIsRunning(t) (!timerIsExpired(t))
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL DEFINES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Calculate Timer
|
||||||
|
*
|
||||||
|
* This method calculates when the timer will be expired given the amount
|
||||||
|
* time in milliseconds /a tOut.
|
||||||
|
* Once the timer has been calculated it will then be used to check when
|
||||||
|
* it expires.
|
||||||
|
*
|
||||||
|
* \see timersIsExpired
|
||||||
|
*
|
||||||
|
* \param[in] time : time/duration in Milliseconds for the timer
|
||||||
|
*
|
||||||
|
* \return u32 : The new timer calculated based on the given time
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
uint32_t timerCalculateTimer( uint16_t time );
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Checks if a Timer is Expired
|
||||||
|
*
|
||||||
|
* This method checks if a timer has already expired.
|
||||||
|
* Based on the given timer previously calculated it checks if this timer
|
||||||
|
* has already elapsed
|
||||||
|
*
|
||||||
|
* \see timersCalculateTimer
|
||||||
|
*
|
||||||
|
* \param[in] timer : the timer to check
|
||||||
|
*
|
||||||
|
* \return true : timer has already expired
|
||||||
|
* \return false : timer is still running
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
bool timerIsExpired( uint32_t timer );
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Performs a Delay
|
||||||
|
*
|
||||||
|
* This method performs a delay for the given amount of time in Milliseconds
|
||||||
|
*
|
||||||
|
* \param[in] time : time/duration in Milliseconds of the delay
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
void timerDelay( uint16_t time );
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Stopwatch start
|
||||||
|
*
|
||||||
|
* This method initiates the stopwatch to later measure the time in ms
|
||||||
|
*
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
void timerStopwatchStart( void );
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*****************************************************************************
|
||||||
|
* \brief Stopwatch Measure
|
||||||
|
*
|
||||||
|
* This method returns the elapsed time in ms since the stopwatch was initiated
|
||||||
|
*
|
||||||
|
* \return The time in ms since the stopwatch was started
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
uint32_t timerStopwatchMeasure( void );
|
111
Software/Drivers/BSP/Components/ST25R3911/utils.h
Normal file
111
Software/Drivers/BSP/Components/ST25R3911/utils.h
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* PROJECT: NFCC firmware
|
||||||
|
* $Revision: $
|
||||||
|
* LANGUAGE: ISO C99
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author Ulrich Herrmann
|
||||||
|
*
|
||||||
|
* \brief Common and helpful macros
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef UTILS_H
|
||||||
|
#define UTILS_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL MACROS
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
* this macro evaluates an error variable \a ERR against an error code \a EC.
|
||||||
|
* in case it is not equal it jumps to the given label \a LABEL.
|
||||||
|
*/
|
||||||
|
#define EVAL_ERR_NE_GOTO(EC, ERR, LABEL) \
|
||||||
|
if ((EC) != (ERR)) goto LABEL;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* this macro evaluates an error variable \a ERR against an error code \a EC.
|
||||||
|
* in case it is equal it jumps to the given label \a LABEL.
|
||||||
|
*/
|
||||||
|
#define EVAL_ERR_EQ_GOTO(EC, ERR, LABEL) \
|
||||||
|
if ((EC) == (ERR)) goto LABEL;
|
||||||
|
|
||||||
|
#define SIZEOF_ARRAY(a) (sizeof(a) / sizeof((a)[0])) /*!< Compute the size of an array */
|
||||||
|
#define MAX(a, b) (((a) > (b)) ? (a) : (b)) /*!< Return the maximum of the 2 values */
|
||||||
|
#define MIN(a, b) (((a) < (b)) ? (a) : (b)) /*!< Return the minimum of the 2 values */
|
||||||
|
#define BITMASK_1 (0x01) /*!< Bit mask for lsb bit */
|
||||||
|
#define BITMASK_2 (0x03) /*!< Bit mask for two lsb bits */
|
||||||
|
#define BITMASK_3 (0x07) /*!< Bit mask for three lsb bits */
|
||||||
|
#define BITMASK_4 (0x0F) /*!< Bit mask for four lsb bits */
|
||||||
|
#define U16TOU8(a) ((a) & 0x00FF) /*!< Cast 16-bit unsigned to 8-bit unsigned */
|
||||||
|
#define GETU16(a) (((uint16_t)(a)[0] << 8) | (uint16_t)(a)[1])/*!< Cast two Big Endian 8-bits byte array to 16-bits unsigned */
|
||||||
|
#define GETU32(a) (((uint32_t)(a)[0] << 24) | ((uint32_t)(a)[1] << 16) | ((uint32_t)(a)[2] << 8) | ((uint32_t)(a)[3])) /*!< Cast four Big Endian 8-bit byte array to 32-bit unsigned */
|
||||||
|
|
||||||
|
#define REVERSE_BYTES(pData, nDataSize) \
|
||||||
|
{unsigned char swap, *lo = ((unsigned char *)(pData)), *hi = ((unsigned char *)(pData)) + (nDataSize) - 1; \
|
||||||
|
while (lo < hi) { swap = *lo; *lo++ = *hi; *hi-- = swap; }}
|
||||||
|
|
||||||
|
#ifdef __CSMC__
|
||||||
|
/* STM8 COSMIC */
|
||||||
|
#define ST_MEMMOVE(s1,s2,n) memmove(s1,s2,n) /*!< map memmove to string library code */
|
||||||
|
static inline void * ST_MEMCPY(void *s1, const void *s2, uint32_t n) { return memcpy(s1,s2,(uint16_t)n); } /* PRQA S 0431 # MISRA 1.1 - string.h from Cosmic only provides functions with low qualified parameters */
|
||||||
|
#define ST_MEMSET(s1,c,n) memset(s1,(char)(c),n) /*!< map memset to string library code */
|
||||||
|
static inline int32_t ST_BYTECMP(void *s1, const void *s2, uint32_t n) { return (int32_t)memcmp(s1,s2,(uint16_t)n); } /* PRQA S 0431 # MISRA 1.1 - string.h from Cosmic only provides functions with low qualified parameters */
|
||||||
|
|
||||||
|
#else /* __CSMC__ */
|
||||||
|
|
||||||
|
#define ST_MEMMOVE memmove /*!< map memmove to string library code */
|
||||||
|
#define ST_MEMCPY memcpy /*!< map memcpy to string library code */
|
||||||
|
#define ST_MEMSET memset /*!< map memset to string library code */
|
||||||
|
#define ST_BYTECMP memcmp /*!< map bytecmp to string library code */
|
||||||
|
#endif /* __CSMC__ */
|
||||||
|
|
||||||
|
#define NO_WARNING(v) ((void) (v)) /*!< Macro to suppress compiler warning */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef NULL
|
||||||
|
#define NULL (void*)0 /*!< represents a NULL pointer */
|
||||||
|
#endif /* !NULL */
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* GLOBAL FUNCTION PROTOTYPES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* UTILS_H */
|
||||||
|
|
180
Software/Drivers/BSP/NFC05A1/Release_Notes.html
Normal file
180
Software/Drivers/BSP/NFC05A1/Release_Notes.html
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
<!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 X-NUCLEO-NFC03A1 STM32 Expansion Board</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 X-NUCLEO-NFC05A1 STM32 Expansion Board</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 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;">V1.0.0
|
||||||
|
/ 15-March-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;">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;"><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>
|
145
Software/Drivers/BSP/NFC05A1/led.c
Normal file
145
Software/Drivers/BSP/NFC05A1/led.c
Normal file
@ -0,0 +1,145 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||||
|
*
|
||||||
|
* Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License");
|
||||||
|
* You may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at:
|
||||||
|
*
|
||||||
|
* http://www.st.com/myliberty
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||||
|
* AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
/*
|
||||||
|
* PROJECT: ST25R3911 firmware
|
||||||
|
* $Revision: $
|
||||||
|
* LANGUAGE: ANSI C
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*! \file
|
||||||
|
*
|
||||||
|
* \author
|
||||||
|
*
|
||||||
|
* \brief Implementation for controlling shield LEDs functionality
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* INCLUDES
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
#ifdef STM32L476xx
|
||||||
|
#include "stm32l4xx.h"
|
||||||
|
#else
|
||||||
|
#include "stm32f4xx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "led.h"
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
volatile uint16_t msLedA = 0;
|
||||||
|
volatile uint16_t msLedB = 0;
|
||||||
|
volatile uint16_t msLedF = 0;
|
||||||
|
volatile uint16_t msLedV = 0;
|
||||||
|
volatile uint16_t msLedAP2P = 0;
|
||||||
|
|
||||||
|
void ledOn(st25R3911Led_t Led)
|
||||||
|
{
|
||||||
|
switch(Led){
|
||||||
|
case LED_A: HAL_GPIO_WritePin(LED_A_GPIO_Port , LED_A_Pin , GPIO_PIN_SET); break;
|
||||||
|
case LED_B: HAL_GPIO_WritePin(LED_B_GPIO_Port , LED_B_Pin , GPIO_PIN_SET); break;
|
||||||
|
case LED_F: HAL_GPIO_WritePin(LED_F_GPIO_Port , LED_F_Pin , GPIO_PIN_SET); break;
|
||||||
|
case LED_V: HAL_GPIO_WritePin(LED_V_GPIO_Port , LED_V_Pin , GPIO_PIN_SET); break;
|
||||||
|
case LED_AP2P: HAL_GPIO_WritePin(LED_AP2P_GPIO_Port , LED_AP2P_Pin , GPIO_PIN_SET); break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ledOff(st25R3911Led_t Led)
|
||||||
|
{
|
||||||
|
switch(Led){
|
||||||
|
case LED_A: HAL_GPIO_WritePin(LED_A_GPIO_Port , LED_A_Pin , GPIO_PIN_RESET); break;
|
||||||
|
case LED_B: HAL_GPIO_WritePin(LED_B_GPIO_Port , LED_B_Pin , GPIO_PIN_RESET); break;
|
||||||
|
case LED_F: HAL_GPIO_WritePin(LED_F_GPIO_Port , LED_F_Pin , GPIO_PIN_RESET); break;
|
||||||
|
case LED_V: HAL_GPIO_WritePin(LED_V_GPIO_Port , LED_V_Pin , GPIO_PIN_RESET); break;
|
||||||
|
case LED_AP2P: HAL_GPIO_WritePin(LED_AP2P_GPIO_Port , LED_AP2P_Pin , GPIO_PIN_RESET); break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ledToggle(st25R3911Led_t Led)
|
||||||
|
{
|
||||||
|
switch(Led){
|
||||||
|
case LED_A: HAL_GPIO_TogglePin(LED_A_GPIO_Port , LED_A_Pin ); break;
|
||||||
|
case LED_B: HAL_GPIO_TogglePin(LED_B_GPIO_Port , LED_B_Pin ); break;
|
||||||
|
case LED_F: HAL_GPIO_TogglePin(LED_F_GPIO_Port , LED_F_Pin ); break;
|
||||||
|
case LED_V: HAL_GPIO_TogglePin(LED_V_GPIO_Port , LED_V_Pin ); break;
|
||||||
|
case LED_AP2P: HAL_GPIO_TogglePin(LED_AP2P_GPIO_Port , LED_AP2P_Pin ); break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void ledOnOff(st25R3911Led_t Led, uint32_t delay)
|
||||||
|
{
|
||||||
|
ledOn(Led);
|
||||||
|
|
||||||
|
switch(Led){
|
||||||
|
case LED_A: msLedA = delay; break;
|
||||||
|
case LED_B: msLedB = delay; break;
|
||||||
|
case LED_F: msLedF = delay; break;
|
||||||
|
case LED_V: msLedV = delay; break;
|
||||||
|
case LED_AP2P: msLedAP2P = delay; break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void ledFeedbackHandler()
|
||||||
|
{
|
||||||
|
if(msLedA > 0){
|
||||||
|
msLedA--;
|
||||||
|
if(msLedA == 0)
|
||||||
|
ledOff(LED_A);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(msLedB > 0){
|
||||||
|
msLedB--;
|
||||||
|
if(msLedB == 0)
|
||||||
|
ledOff(LED_B);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(msLedF > 0){
|
||||||
|
msLedF--;
|
||||||
|
if(msLedF == 0)
|
||||||
|
ledOff(LED_F);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(msLedV > 0){
|
||||||
|
msLedV--;
|
||||||
|
if(msLedV == 0)
|
||||||
|
ledOff(LED_V);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(msLedAP2P > 0){
|
||||||
|
msLedAP2P--;
|
||||||
|
if(msLedAP2P == 0)
|
||||||
|
ledOff(LED_AP2P);
|
||||||
|
}
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user