Compare commits

..

1 Commits

Author SHA1 Message Date
Benny Liu 440158f806 calibration mode 2019-10-01 18:46:51 +08:00
43 changed files with 1379 additions and 5304 deletions
-39
View File
@@ -1,39 +0,0 @@
#!/bin/bash
#path=$(pwd)
#folder=$($path | awk -F"/" '{$NF}')
folder=$(basename "$(pwd)")
if [ "$folder" == "bioprocc2650" ]; then
year=$(date +%-y)
month=$(date +%-m)
day=$(date +%-d)
hour=$(date +%-H)
minute=$(date +%-M)
hash=$(git rev-parse HEAD)
branch=$(git rev-parse --abbrev-ref HEAD)
sed -i "5c #define VERSION_DATE_YEAR ${year}"\
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
sed -i "6c #define VERSION_DATE_MONTH ${month}"\
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
sed -i "7c #define VERSION_DATE_DAY ${day}"\
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
sed -i "8c #define VERSION_DATE_HOUR ${hour}"\
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
sed -i "9c #define VERSION_DATE_MINUTE ${minute}"\
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
sed -i "13c #define VERSION_HASH ${hash}"\
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
sed -i "14c #define VERSION_GIT_BRANCH ${branch}"\
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
#cat ./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_version.h
fi
@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configurations XML_version="1.2" id="configurations_0">
<configuration XML_version="1.2" id="configuration_0">
<instance XML_version="1.2" desc="Texas Instruments XDS100v3 USB Debug Probe" href="connections/TIXDS100v3_Dot7_Connection.xml" id="Texas Instruments XDS100v3 USB Debug Probe" xml="TIXDS100v3_Dot7_Connection.xml" xmlpath="connections"/>
<connection XML_version="1.2" id="Texas Instruments XDS100v3 USB Debug Probe">
<instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2cortexM.xml" id="drivers" xml="tixds100v2cortexM.xml" xmlpath="drivers"/>
<property Type="choicelist" Value="2" id="The Converter Usage">
<choice Name="Generate 1149.7 2-pin advanced modes" value="enable">
<property Type="choicelist" Value="1" id="The Converter 1149.7 Frequency">
<choice Name="Overclock with user specified value" value="unused">
<property Type="choicelist" Value="5" id="-- Choose a value from 1.0MHz to 50.0MHz"/>
</choice>
</property>
<property Type="choicelist" Value="5" id="The Target Scan Format"/>
</choice>
</property>
<platform XML_version="1.2" id="platform_0">
<instance XML_version="1.2" desc="CC2640F128" href="devices/cc2640f128.xml" id="CC2640F128" xml="cc2640f128.xml" xmlpath="devices"/>
</platform>
</connection>
</configuration>
</configurations>
@@ -1,9 +0,0 @@
The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based
on the device and connection settings specified in your project on the Properties > General page.
Please note that in automatic target-configuration management, changes to the project's device and/or
connection settings will either modify an existing or generate a new target-configuration file. Thus,
if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively,
you may create your own target-configuration file for this project and manage it manually. You can
always switch back to automatic target-configuration management by checking the "Manage the project's
target-configuration automatically" checkbox on the project's Properties > General page.
@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configurations XML_version="1.2" id="configurations_0">
<configuration XML_version="1.2" id="configuration_0">
<instance XML_version="1.2" desc="Texas Instruments XDS100v3 USB Debug Probe" href="connections/TIXDS100v3_Dot7_Connection.xml" id="Texas Instruments XDS100v3 USB Debug Probe" xml="TIXDS100v3_Dot7_Connection.xml" xmlpath="connections"/>
<connection XML_version="1.2" id="Texas Instruments XDS100v3 USB Debug Probe">
<instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2cortexM.xml" id="drivers" xml="tixds100v2cortexM.xml" xmlpath="drivers"/>
<property Type="choicelist" Value="2" id="The Converter Usage">
<choice Name="Generate 1149.7 2-pin advanced modes" value="enable">
<property Type="choicelist" Value="1" id="The Converter 1149.7 Frequency">
<choice Name="Overclock with user specified value" value="unused">
<property Type="choicelist" Value="5" id="-- Choose a value from 1.0MHz to 50.0MHz"/>
</choice>
</property>
<property Type="choicelist" Value="5" id="The Target Scan Format"/>
</choice>
</property>
<platform XML_version="1.2" id="platform_0">
<instance XML_version="1.2" desc="CC2640F128" href="devices/cc2640f128.xml" id="CC2640F128" xml="cc2640f128.xml" xmlpath="devices"/>
</platform>
</connection>
</configuration>
</configurations>
@@ -1,9 +0,0 @@
The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based
on the device and connection settings specified in your project on the Properties > General page.
Please note that in automatic target-configuration management, changes to the project's device and/or
connection settings will either modify an existing or generate a new target-configuration file. Thus,
if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively,
you may create your own target-configuration file for this project and manage it manually. You can
always switch back to automatic target-configuration management by checking the "Manage the project's
target-configuration automatically" checkbox on the project's Properties > General page.
@@ -18,8 +18,8 @@
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.rtsc.XDCtools.parsers.ErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser;org.eclipse.cdt.core.GmakeErrorParser" id="com.ti.ccstudio.buildDefinitions.TMS470.Default.67178137" name="FlashROM" parent="com.ti.ccstudio.buildDefinitions.TMS470.Default" postbuildStep="${CG_TOOL_HEX} -order MS --memwidth=8 --romwidth=8 --intel -o ${ProjName}.hex ${ProjName}.out" prebuildStep="">
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Default.67178137." name="/" resourcePath="">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.410623502" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.1351821865">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1751124300" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.1369151231" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.223507680">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.732777020" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.CC2650F128"/>
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
@@ -34,17 +34,17 @@
<listOptionValue builtIn="false" value="LINK_ORDER=TOOLS/ccs_linker_defines.cmd;TOOLS/cc26xx_app.cmd;"/>
<listOptionValue builtIn="false" value="RTSC_MBS_VERSION=2.2.0"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.277675815" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="18.1.4.LTS" valueType="string"/>
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug.1593934674" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug"/>
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug.632414212" name="GNU Make.FlashROM" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.154623462" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.974280107" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.7M3" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.1783826131" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.16" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.1536570599" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.eabi" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN.1895413316" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.322983319" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.1305400753" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH.1468985930" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.579299287" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="18.1.4.LTS" valueType="string"/>
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug.2112816025" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug"/>
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug.1418617668" name="GNU Make.FlashROM" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.1368914557" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.872349905" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.7M3" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.1023813954" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.16" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.1674413144" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.eabi" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN.184317276" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.1068578615" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.1943600764" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH.644525479" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
<listOptionValue builtIn="false" value="C:\ti\simplelink\ble_sdk_2_02_02_25\src\examples\simple_peripheral\cc26xx\app\headstage"/>
<listOptionValue builtIn="false" value="${SRC_EX}/examples/simple_peripheral/cc26xx/app"/>
@@ -70,7 +70,7 @@
<listOptionValue builtIn="false" value="${SRC_BLE_CORE}/rom"/>
<listOptionValue builtIn="false" value="${CC26XXWARE}"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.1897088" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.1330623088" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
<listOptionValue builtIn="false" value="BOARD_DISPLAY_EXCLUDE_UART"/>
<listOptionValue builtIn="false" value="POWER_SAVING"/>
<listOptionValue builtIn="false" value="BOOSTXL_CC2650MA"/>
@@ -86,71 +86,71 @@
<listOptionValue builtIn="false" value="xdc_runtime_Assert_DISABLE_ALL"/>
<listOptionValue builtIn="false" value="xdc_runtime_Log_DISABLE_ALL"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.871011287" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.863089168" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.C99" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GCC.1454248503" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GCC" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS.1965115059" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.1308360247" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.504235202" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.C99" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GCC.105967788" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GCC" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS.698913237" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS" valueType="stringList">
<listOptionValue builtIn="false" value="48"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.1638011093" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.1399241416" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING" valueType="stringList">
<listOptionValue builtIn="false" value="225"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.1920170652" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER.2038786257" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS.811478344" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE.1229809338" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.867926379" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER.980626282" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS.374992114" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE.1890491357" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE" valueType="stringList">
<listOptionValue builtIn="false" value="${SRC_EX}/config/build_components.opt"/>
<listOptionValue builtIn="false" value="${ORG_PROJ_DIR}/build_config.opt"/>
<listOptionValue builtIn="false" value="${ORG_PROJ_DIR}/../../ccs/config/ccs_compiler_defines.bcfg"/>
</option>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.1540775079" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.319000695" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.270651019" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.463094612" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.263445006" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.1235873701" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.207268648" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.1068957263" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.1351821865" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE.174129193" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE" value="256" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE.567300083" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE" value="0" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE.1800982811" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE" value="&quot;${ProjName}.map&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE.1091211742" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY.1479599481" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY" valueType="libs">
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.223507680" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE.698430423" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE" value="256" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE.402182782" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE" value="0" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE.1628689699" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE" value="&quot;${ProjName}.map&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE.2141951901" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY.679112687" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY" valueType="libs">
<listOptionValue builtIn="false" value="libc.a"/>
<listOptionValue builtIn="false" value="${CC26XXWARE}/driverlib/bin/ccs/driverlib.lib"/>
<listOptionValue builtIn="false" value="${ROM}/common_rom_releases/03282014/common_rom.symbols"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.672837228" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH" valueType="libPaths">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.650613345" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH" valueType="libPaths">
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/lib"/>
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.544523272" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.782343525" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS" valueType="stringList">
<listOptionValue builtIn="false" value="10247-D"/>
<listOptionValue builtIn="false" value="16002-D"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1281207998" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER.468817864" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO.1679096029" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO" value="&quot;${ProjName}_linkInfo.xml&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.254835397" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.on" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.1848192295" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.on" valueType="enumerated"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS.1999849945" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS.25027104" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS.888093741" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1555270082" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER.16105060" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO.1713299511" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO" value="&quot;${ProjName}_linkInfo.xml&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.68776981" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.on" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.1860389255" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.on" valueType="enumerated"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS.152379533" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS.158095632" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS.978853236" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.19288898" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.11734737" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH" value="8" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH.466140455" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH" value="8" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.824070691" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.INTEL" valueType="enumerated"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.2015106526" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.1270425102" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH" value="8" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH.16813235" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH" value="8" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.318851558" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.INTEL" valueType="enumerated"/>
</tool>
<tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.1392704063" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.225737408" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">
<tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.927640565" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.1908494509" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">
<listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_REPOS}"/>
<listOptionValue builtIn="false" value="${TARGET_CONTENT_BASE}"/>
</option>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.571281110" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.arm.elf.M3" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.205178830" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="ti.platforms.simplelink:CC2640F128" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.1097777495" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW" value="ti.platforms.simplelink:CC2640F128" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.744121344" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="release" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.165807018" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value="${CG_TOOL_ROOT}" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS.391961861" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS" value="&quot;${COMPILER_FLAGS}&quot;" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.1746187707" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.arm.elf.M3" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.884959194" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="ti.platforms.simplelink:CC2640F128" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.943624305" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW" value="ti.platforms.simplelink:CC2640F128" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.1521167272" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="release" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.1901654533" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value="${CG_TOOL_ROOT}" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS.138005453" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS" value="&quot;${COMPILER_FLAGS}&quot;" valueType="string"/>
</tool>
</toolChain>
</folderInfo>
@@ -9,6 +9,6 @@
<linkerCommandFile value="cc26x0f128.cmd"/>
<rts value="libc.a"/>
<createSlaveProjects value=""/>
<connection value="common/targetdb/connections/TIXDS110_Connection.xml"/>
<connection value="common/targetdb/connections/TIXDS100v3_Dot7_Connection.xml"/>
<isTargetManual value="false"/>
</projectOptions>
@@ -15,8 +15,8 @@
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Default.1209999684" name="FlashROM" parent="com.ti.ccstudio.buildDefinitions.TMS470.Default" postannouncebuildStep="" postbuildStep="${CG_TOOL_HEX} -order MS --memwidth=8 --romwidth=8 --intel -o ${ProjName}.hex ${ProjName}.out;${TOOLS_BLE}/frontier/frontier.exe ccs ${PROJECT_LOC}/${ConfigName}/${ProjName}_linkInfo.xml ${ORG_PROJ_DIR}/../../ccs/config/ccs_compiler_defines.bcfg ${ORG_PROJ_DIR}/../../ccs/config/ccs_linker_defines.cmd" preannouncebuildStep="" prebuildStep="&quot;${TOOLS_BLE}/lib_search/lib_search.exe&quot; ${ORG_PROJ_DIR}/build_config.opt &quot;${TOOLS_BLE}/lib_search/params_split_cc2640.xml&quot; ${SRC_BLE_CORE}/../blelib &quot;${ORG_PROJ_DIR}/../../ccs/config/lib_linker.cmd&quot;">
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Default.1209999684." name="/" resourcePath="">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.958553711" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.2088015050">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.2112506999" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.929750171" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.1008890994">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1479696404" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.CC2650F128"/>
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
@@ -26,17 +26,17 @@
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE="/>
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.101349069" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="18.1.4.LTS" valueType="string"/>
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug.572884961" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug"/>
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug.50794417" name="GNU Make.FlashROM" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.783335843" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.341974501" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.7M3" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.274225680" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.16" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.529764162" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.eabi" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN.1837039616" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.1393115220" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.2112471580" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH.152832201" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.201372544" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="18.1.4.LTS" valueType="string"/>
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug.1951196199" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug"/>
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug.20903631" name="GNU Make.FlashROM" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.1176131016" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.647279085" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.7M3" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.1443871767" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.16" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.227818129" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.eabi" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN.784155377" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.494285153" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.581550859" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH.1288777730" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
<listOptionValue builtIn="false" value="${SRC_EX}/examples/simple_peripheral/cc26xx/stack"/>
<listOptionValue builtIn="false" value="${SRC_EX}/common/cc26xx"/>
@@ -60,7 +60,7 @@
<listOptionValue builtIn="false" value="${SRC_EX}/profiles/roles"/>
<listOptionValue builtIn="false" value="${CC26XXWARE}"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.1361895403" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.986125825" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
<listOptionValue builtIn="false" value="CC26XX"/>
<listOptionValue builtIn="false" value="POWER_SAVING"/>
<listOptionValue builtIn="false" value="CC26XXWARE"/>
@@ -81,60 +81,60 @@
<listOptionValue builtIn="false" value="xTESTMODES"/>
<listOptionValue builtIn="false" value="xTEST_BLEBOARD"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.1555958931" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.C99" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS.1144396572" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.372638078" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.C99" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS.201347726" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS" valueType="stringList">
<listOptionValue builtIn="false" value="48"/>
<listOptionValue builtIn="false" value="16004"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.1546809951" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.73314177" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING" valueType="stringList">
<listOptionValue builtIn="false" value="225"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.12083718" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER.1432753391" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE.1345637669" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.1126279750" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER.1492280006" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE.538453952" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE" valueType="stringList">
<listOptionValue builtIn="false" value="${SRC_EX}/config/build_components.opt"/>
<listOptionValue builtIn="false" value="${ORG_PROJ_DIR}/build_config.opt"/>
</option>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.1884548091" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.682104615" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.662317863" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.728508440" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.313905687" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.1129729173" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.156783227" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.538375181" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.2088015050" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE.1079333148" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE" value="256" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE.1347544490" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE" value="0" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE.136883143" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE" value="&quot;${ProjName}.map&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE.1510359183" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY.1331488920" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY" valueType="libs">
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.1008890994" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE.1873600405" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE" value="256" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE.1359172875" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE" value="0" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE.1355177509" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE" value="&quot;${ProjName}.map&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE.829303802" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY.1078356909" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY" valueType="libs">
<listOptionValue builtIn="false" value="libc.a"/>
<listOptionValue builtIn="false" value="${ORG_PROJ_DIR}/../../ccs/config/lib_linker.cmd"/>
<listOptionValue builtIn="false" value="${ROM}/ble_rom_releases/04242014/ble_rom_patch.symbols"/>
<listOptionValue builtIn="false" value="${CC26XXWARE}/driverlib/bin/ccs/driverlib.lib"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.1835383942" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH" valueType="libPaths">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.1707930214" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH" valueType="libPaths">
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/lib"/>
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.821225577" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.59164041" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS" valueType="stringList">
<listOptionValue builtIn="false" value="16002-D"/>
<listOptionValue builtIn="false" value="10247-D"/>
<listOptionValue builtIn="false" value="10325-D"/>
<listOptionValue builtIn="false" value="10229-D"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1390204935" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER.1601082213" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO.351715800" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO" value="&quot;${ProjName}_linkInfo.xml&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.ENTRY_POINT.90863272" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.ENTRY_POINT" value="startup_entry" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.1779672459" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.on" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.1701763005" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.on" valueType="enumerated"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS.687564793" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS.1056923280" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS.73723664" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.11567165" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER.1727810233" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO.1385277262" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO" value="&quot;${ProjName}_linkInfo.xml&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.ENTRY_POINT.1153340314" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.ENTRY_POINT" value="startup_entry" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.450995330" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.on" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.1827942626" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.on" valueType="enumerated"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS.1279238428" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS.526125450" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS.581803256" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.1766088709" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.494132983" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH" value="8" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH.1603693219" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH" value="8" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.1153492005" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.INTEL" valueType="enumerated"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.947560992" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.1295209583" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH" value="8" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH.110293046" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH" value="8" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.1122561921" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.INTEL" valueType="enumerated"/>
</tool>
</toolChain>
</folderInfo>
@@ -12,7 +12,6 @@
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${target_config_active_default:simple_peripheral_cc2650em_stack}"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS100v3 USB Debug Probe_0/Cortex_M3_0" value="C:/ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\FlashROM\simple_peripheral_cc2650em_stack.out"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe/Cortex_M3_0" value="C:/ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\FlashROM\simple_peripheral_cc2650em_stack.out"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe_0/Cortex_M3_0" value="C:/ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\FlashROM\simple_peripheral_cc2650em_stack.out"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/simple_peripheral_cc2650em_stack"/>
</listAttribute>
@@ -1,20 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configurations XML_version="1.2" id="configurations_0">
<configuration XML_version="1.2" id="Texas Instruments XDS110 USB Debug Probe_0">
<instance XML_version="1.2" desc="Texas Instruments XDS110 USB Debug Probe_0" href="connections/TIXDS110_Connection.xml" id="Texas Instruments XDS110 USB Debug Probe_0" xml="TIXDS110_Connection.xml" xmlpath="connections"/>
<connection XML_version="1.2" id="Texas Instruments XDS110 USB Debug Probe_0">
<instance XML_version="1.2" href="drivers/tixds510icepick_c.xml" id="drivers" xml="tixds510icepick_c.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds510cs_dap.xml" id="drivers" xml="tixds510cs_dap.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds510cortexM.xml" id="drivers" xml="tixds510cortexM.xml" xmlpath="drivers"/>
<property Type="choicelist" Value="1" id="Power Selection">
<choice Name="Probe supplied power" value="1">
<property Type="stringfield" Value="3.3" id="Voltage Level"/>
</choice>
</property>
<property Type="choicelist" Value="0" id="JTAG Signal Isolation"/>
<property Type="choicelist" Value="4" id="SWD Mode Settings">
<choice Name="cJTAG (1149.7) 2-pin advanced modes" value="enable">
<property Type="choicelist" Value="1" id="XDS110 Aux Port"/>
<configuration XML_version="1.2" id="Texas Instruments XDS100v3 USB Debug Probe_0">
<instance XML_version="1.2" desc="Texas Instruments XDS100v3 USB Debug Probe_0" href="connections/TIXDS100v3_Dot7_Connection.xml" id="Texas Instruments XDS100v3 USB Debug Probe_0" xml="TIXDS100v3_Dot7_Connection.xml" xmlpath="connections"/>
<connection XML_version="1.2" id="Texas Instruments XDS100v3 USB Debug Probe_0">
<instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2cortexM.xml" id="drivers" xml="tixds100v2cortexM.xml" xmlpath="drivers"/>
<property Type="choicelist" Value="2" id="The Converter Usage">
<choice Name="Generate 1149.7 2-pin advanced modes" value="enable">
<property Type="choicelist" Value="1" id="The Converter 1149.7 Frequency">
<choice Name="Overclock with user specified value" value="unused">
<property Type="choicelist" Value="5" id="-- Choose a value from 1.0MHz to 50.0MHz"/>
</choice>
</property>
<property Type="choicelist" Value="5" id="The Target Scan Format"/>
</choice>
</property>
<platform XML_version="1.2" id="platform_0">
@@ -12,7 +12,7 @@
#define CMD_CURRENT_MEASURE 0xC5
#define CMD_VOLT_MEASURE 0xD5
#define CMD_DAC_MEASURE 0xE5
#define CMD_BATTERY_MEASURE 0xF1
#define CMD_BATTERY_MEASURE 0xF5
// controller command, these are command from control box
#define ADC_CH_CURRENT 0x00
@@ -62,29 +62,24 @@ static void ADC_read(uint8_t *ADCdata){
static void ADCGainControl(uint8_t ADCLevel){
if(ADCLevel == 0){
// ADC gain level = 0, using 200K resister
// ADC gain level = 0, using 200R resister
PIN_setOutputValue(pin_handle, Turnon10K, 0);
PIN_setOutputValue(pin_handle, Turnon200R, 0);
PIN_setOutputValue(pin_handle, Turnon100R, 0);
}
else if(ADCLevel == 1){
// ADC gain level = 1, using 10K resister
PIN_setOutputValue(pin_handle, Turnon10K, 1);
PIN_setOutputValue(pin_handle, Turnon200R, 0);
PIN_setOutputValue(pin_handle, Turnon100R, 0);
}
else if(ADCLevel == 2){
// ADC gain level = 2, using 200R resister
// ADC gain level = 2, using 100R resister
PIN_setOutputValue(pin_handle, Turnon10K, 0);
PIN_setOutputValue(pin_handle, Turnon200R, 1);
}
else if(ADCLevel == 3){
// ADC gain level = 0, auto gain (using 200R resister)
PIN_setOutputValue(pin_handle, Turnon10K, 0);
PIN_setOutputValue(pin_handle, Turnon200R, 1);
PIN_setOutputValue(pin_handle, Turnon100R, 1);
}
else{
// default using 200R resister
PIN_setOutputValue(pin_handle, Turnon10K, 0);
PIN_setOutputValue(pin_handle, Turnon200R, 1);
PIN_setOutputValue(pin_handle, Turnon100R, 0);
}
}
@@ -126,161 +121,4 @@ static void ADCChannelSelect(uint8_t ADCChannel){
}
}
static void ReadVolt(uint8_t *buf){
// Read data twice since the first data we get is previous data
ADCChannelSelect(ADC_CH_VOLT);
ADC_read(buf);
ADCChannelSelect(ADC_CH_VOLT);
ADC_read(buf);
}
static void ReadVoutVolt(uint8_t *buf){
// Read data twice since the first data we get is previous data
ADCChannelSelect(ADC_CH_DAC);
ADC_read(buf);
ADCChannelSelect(ADC_CH_DAC);
ADC_read(buf);
}
static void ReadCurrent(uint8_t *buf){
// Read data twice since the first data we get is previous data
ADCGainControl(INSTRUCTION.ADCGainLevel);
ADCChannelSelect(ADC_CH_CURRENT);
ADC_read(buf);
ADCChannelSelect(ADC_CH_CURRENT);
ADC_read(buf);
}
static void ReadBatVolt(uint8_t *buf){
// Read data twice since the first data we get is previous data
ADCChannelSelect(ADC_CH_BAT);
ADC_read(buf);
ADCChannelSelect(ADC_CH_BAT);
ADC_read(buf);
}
// theoretical boundary <20, 10~500, >100 (uA)
//#define GAIN_SMALL_BOUNDARY 40000 // 40 uA = 40,000,000 pA
//#define GAIN_MID_BOUNDARY1 20000 // 20 uA = 20,000,000 pA
//#define GAIN_MID_BOUNDARY2 400000 // 400 uA = 400,000,000 pA
//#define GAIN_LARGE_BOUNDARY 200000 // 200 uA = 200,000 nA
//#define GAIN_SMALL_BOUNDARY 8000 // 8 uA = 8,000,000 pA
//#define GAIN_MID_BOUNDARY1 3000 // 3 uA = 3,000,000 pA
//#define GAIN_MID_BOUNDARY2 90000 // 90 uA = 90,000,000 pA
//#define GAIN_LARGE_BOUNDARY 70000 // 70 uA = 70,000 nA
/* for Elite1.4-re which 6.3kohm replaced by 10kohm */
// theoretical boundary <40, 30~1350, >1000 (uA)
#define GAIN_SMALL_BOUNDARY 40000 // 40 uA = 40,000,000 pA
#define GAIN_MID_BOUNDARY1 30000 // 30 uA = 30,000,000 pA
#define GAIN_MID_BOUNDARY2 1350000 // 1350 uA = 1350,000,000 pA
#define GAIN_LARGE_BOUNDARY 1000000 // 1000 uA = 1000,000 nA
static int32_t AutoGainReadCurrent(uint8_t *buf){
int32_t Real_Current = 0;
if(INSTRUCTION.ADCGainLevel == GAIN_AUTO){
INSTRUCTION.ADCGainLevel = GAIN_200R;
}
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
return Real_Current;
}
static void AutoGainChange(int32_t Real_Current){
if(INSTRUCTION.ADCGainLevel == GAIN_200R){
// switch to mid range current
if(Real_Current < GAIN_LARGE_BOUNDARY && Real_Current > -1*GAIN_LARGE_BOUNDARY){
// switch to small range current
if (Real_Current < GAIN_MID_BOUNDARY1 && Real_Current > -1*GAIN_MID_BOUNDARY1){
GAIN_200K_counter++;
if(GAIN_200K_counter > 5){
INSTRUCTION.ADCGainLevel = GAIN_200K;
GAIN_200K_counter = 0;
}
}else{
GAIN_10K_counter++;
if(GAIN_10K_counter > 5){
INSTRUCTION.ADCGainLevel = GAIN_10K;
GAIN_10K_counter = 0;
}
}
}else{
if(GAIN_200K_counter > 0){
GAIN_200K_counter--;
}
if(GAIN_10K_counter > 0){
GAIN_10K_counter--;
}
}
}
else if(INSTRUCTION.ADCGainLevel == GAIN_10K){
// switch to large range current
if(Real_Current > GAIN_MID_BOUNDARY2 || Real_Current < -1*GAIN_MID_BOUNDARY2){
GAIN_200R_counter++;
if(GAIN_200R_counter > 5){
INSTRUCTION.ADCGainLevel = GAIN_200R;
GAIN_200R_counter = 0;
}
}
// switch to small range current
else if (Real_Current < GAIN_MID_BOUNDARY1 && Real_Current > -1*GAIN_MID_BOUNDARY1){
GAIN_200K_counter++;
if(GAIN_200K_counter > 5){
INSTRUCTION.ADCGainLevel = GAIN_200K;
GAIN_200K_counter = 0;
}
}else{
if(GAIN_200R_counter > 0){
GAIN_200R_counter--;
}
if(GAIN_200K_counter > 0){
GAIN_200K_counter--;
}
}
}
else if(INSTRUCTION.ADCGainLevel == GAIN_200K){
// switch to mid range current
if(Real_Current > GAIN_SMALL_BOUNDARY || Real_Current < -1*GAIN_SMALL_BOUNDARY){
// switch to large range current
if(Real_Current > GAIN_MID_BOUNDARY2 || Real_Current < -1*GAIN_MID_BOUNDARY2){
GAIN_200R_counter++;
if(GAIN_200R_counter > 5){
INSTRUCTION.ADCGainLevel = GAIN_200R;
GAIN_200R_counter = 0;
}
}else{
GAIN_10K_counter++;
if(GAIN_10K_counter > 5){
INSTRUCTION.ADCGainLevel = GAIN_10K;
GAIN_10K_counter = 0;
}
}
}else{
if(GAIN_200R_counter > 0){
GAIN_200R_counter--;
}
if(GAIN_10K_counter > 0){
GAIN_10K_counter--;
}
}
}
}
#define ReadADCVolt(x) ((x==0)? ReadVoutVolt(spi_ADC_rxbuf) : ReadVolt(spi_ADC_rxbuf))
#endif
@@ -1,32 +0,0 @@
#ifndef ELITECCC
#define ELITECCC
#include "EliteCCMode.h"
// XXX : should we reset DAC output after STOP?
static void CCModeReverseCurrent(CCCMode *CCC){
if(CCC->StandBy){
if(CT.StandByCounter == CCC->StandByTime){
CCC->StandBy = false;
CT.StandByCounter = 0;
}
else{
CT.StandByCounter ++;
}
}
else{
// reverse charge/discharge
if(CCC->BatteryV == CCC->VMax){
CCC->StandBy = true;
CCC->value = CCC->DischargeCurrent;
}
else if(CCC->BatteryV == CCC->VMin){
CCC->StandBy = true;
CCC->value = CCC->ChargeCurrent;
}
}
}
#endif
@@ -2,250 +2,309 @@
#ifndef ELITECCMODE
#define ELITECCMODE
#define Vset INSTRUCTION.Vset
#define DELTAVOLTMAX 100000
#define CURRENT_LV_FOUR 4
#define CURRENT_LV_THREE 3
#define CURRENT_LV_TWO 2
#define CURRENT_LV_ONE 1
#define CURRENT_LV_ZERO 0
/* Transform setting CC into IUC
*
* User code in CC mode : 0 ~ 3000000
* Real current value : -15.00000 ~ 15.00000 mA
* => user code = 1500000 mapping to 0.00000 mA
*/
static void CC_Plot(WorkMode *WorkModeData){
switch (INSTRUCTION.eliteFxn) {
case IT_CURVE:{
#define CURRENT_MODE WorkModeData->IT
break;
}
case VT_CURVE:{
#define CURRENT_MODE WorkModeData->VT
break;
}
case ZT_CURVE:{
#define CURRENT_MODE WorkModeData->RT
break;
}
case IV_CURVE:{
#define CURRENT_MODE WorkModeData->IV
break;
}
case CV_CURVE:{
#define CURRENT_MODE WorkModeData->CV
break;
}
case CONSTANT_CURRENT:{
#define CURRENT_MODE WorkModeData->CC
break;
}
case CYCLIC_VOLTAMMETRY:{
#define CURRENT_MODE WorkModeData->CV3
break;
}
case LINEAR_SWEEP_VOLTAMMETRY:{
#define CURRENT_MODE WorkModeData->LSV
break;
}
case CONSTANT_VSCAN:{
#define CURRENT_MODE WorkModeData->CVSCAN
break;
}
default: {
break;
}
}
/*********************************************************************
* @struct Constant Current Code
*
* @brief A struct to handle CC mode command
*/
typedef struct _CURRENT_USER_CODE {
/** current level range: 0-4 **/
// current level = 0 => 0-499 nA => ADCGainLevel = 200K
// current level = 1 => 500-999 nA => ADCGainLevel = 10K
// current level = 2 => 0-499 uA => ADCGainLevel = 10K
// current level = 3 => 500-999 uA => ADCGainLevel = 200R
// current level = 4 => 0-499 mA => ADCGainLevel = 200R
uint8_t lv;
static uint8_t ADCSwitch = 0;
static uint8_t BatSwitch = 0;
static int32_t VoltData = 0;
/** current value **/
// current value divide current level into 50000 pieces
uint16_t value;
if(batteryCheck_flag){
if(ADCSwitch == 0){
if(BatSwitch == 0){ /**read Iin(buffer),read bat**/
if(INSTRUCTION.AutoGainEnable){
CURRENT_MODE->_measureCurrent = AutoGainReadCurrent(spi_ADC_rxbuf);
AutoGainChange(CURRENT_MODE->_measureCurrent);
}else{
ReadCurrent(spi_ADC_rxbuf);
CURRENT_MODE->_measureCurrent = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent);
DACenable(WorkModeData, VoltData, AFTER_READ_I);
/** Measure Current **/
int32_t _MeasureCurrent;
ReadBatVolt(spi_ADC_rxbuf);
BatSwitch++;
}else if(BatSwitch == 1){
ReadBatVolt(spi_ADC_rxbuf);
BatSwitch++;
}else if(BatSwitch == 2){
headstage_battery_volt();
ReadCurrent(spi_ADC_rxbuf);
batteryCheck_flag = false;
BatSwitch = 0;
ADCSwitch = 3;
}
}
else if(ADCSwitch == 1 || ADCSwitch == 3){
if(BatSwitch == 0){ /**read Bat**/
ReadBatVolt(spi_ADC_rxbuf);
BatSwitch++;
}else if(BatSwitch == 1){
ReadBatVolt(spi_ADC_rxbuf);
BatSwitch++;
}else if(BatSwitch == 2){
headstage_battery_volt();
ReadCurrent(spi_ADC_rxbuf);
batteryCheck_flag = false;
BatSwitch = 0;
ADCSwitch = 3;
}
}
else if(ADCSwitch == 2){
if(BatSwitch == 0){ /**read V(buffer),read bat**/
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
if(CURRENT_MODE->_VoViSwitch == 0x01){
CURRENT_MODE->_measureVin = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
VoltData = CURRENT_MODE->_measureVin;
}else if(CURRENT_MODE->_VoViSwitch == 0x00){
CURRENT_MODE->_measureVout = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_DAC, spi_ADC_rxbuf);
VoltData = CURRENT_MODE->_measureVout;
}
InputNotify(NOTIFY_VOLT, VoltData);
DACenable(WorkModeData, VoltData, AFTER_READ_V);
/** transform a current user code (IUC) to real current in pA **/
// handle current lv 0~2
int32_t (*_Transform2RealpA)(struct _CURRENT_USER_CODE *);
ReadBatVolt(spi_ADC_rxbuf);
BatSwitch++;
}else if(BatSwitch == 1){
ReadBatVolt(spi_ADC_rxbuf);
BatSwitch++;
}else if(BatSwitch == 2){
headstage_battery_volt();
ReadCurrent(spi_ADC_rxbuf);
batteryCheck_flag = false;
BatSwitch = 0;
ADCSwitch = 3;
}
}
}else{
BatSwitch = 0;
if(ADCSwitch == 0){ /**read Iin(buffer),read V**/
if(INSTRUCTION.AutoGainEnable){
CURRENT_MODE->_measureCurrent = AutoGainReadCurrent(spi_ADC_rxbuf);
AutoGainChange(CURRENT_MODE->_measureCurrent);
}else{
ReadCurrent(spi_ADC_rxbuf);
CURRENT_MODE->_measureCurrent = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
/** transform an IUC to real current in nA **/
// handle current lv 3~4
int32_t (*_Transform2RealnA)(struct _CURRENT_USER_CODE *);
InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent);
/** MeasureCurrent operation **/
void (*SetMeasureCurrent)(struct _CURRENT_USER_CODE *, int32_t);
DACenable(WorkModeData, VoltData, AFTER_READ_I);
int32_t (*GetMeasureCurrent)(struct _CURRENT_USER_CODE *);
}CURRENT_USER_CODE;
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
ADCSwitch++;
}
else if(ADCSwitch == 1){ /**read V**/
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
ADCSwitch++;
}
else if(ADCSwitch == 2){ /**read V(buffer),read Iin**/
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
if(CURRENT_MODE->_VoViSwitch == 0x01 || CURRENT_MODE->_VoViSwitch == 0x02){
CURRENT_MODE->_measureVin = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
VoltData = CURRENT_MODE->_measureVin;
}else if(CURRENT_MODE->_VoViSwitch == 0x00){
CURRENT_MODE->_measureVout = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_DAC, spi_ADC_rxbuf);
VoltData = CURRENT_MODE->_measureVout;
}
//static CURRENT_USER_CODE CurrentUserCode;
if(INSTRUCTION.VoViSwitch == 0x02){
int32_t Vscan = (Vset / 200 - CURRENT_MODE->_measureVin);
Vscan = (int32_t)(Vscan);//[1uV]
InputNotify(NOTIFY_VOLT, Vscan);
}else{
InputNotify(NOTIFY_VOLT, VoltData);
}
static int32_t CCModeReadCurrent(CURRENT_USER_CODE *CurrentUserCode){
int32_t Real_Current = 0;
CCModeReset = 0; // This flag will control DAC working
DACenable(WorkModeData, VoltData, AFTER_READ_V);
CCCurrent2IUC(CurrentUserCode);
ReadCurrent(spi_ADC_rxbuf);
ADCSwitch++;
}
else if(ADCSwitch == 3){ /**read Iin**/
ReadCurrent(spi_ADC_rxbuf);
ADCSwitch = 0;
}
}
// if(CurrentUserCode->lv == CURRENT_LV_FOUR){
// Real_Current = CurrentUserCode->_Transform2RealnA(CurrentUserCode);
// }
// else{
// Real_Current = CurrentUserCode->_Transform2RealpA(CurrentUserCode);
// }
#undef CURRENT_MODE
// set ADC gain according to constant current value
SetCCModeGain(CurrentUserCode);
// read ADC current
ADCGainControl(INSTRUCTION.ADCGainLevel);
ADCChannelSelect(ADC_CH_CURRENT);
CPUdelay(10);
ADC_read(spi_ADC_rxbuf);
// decode ADC value and put it into notify buffer
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
Real_Current = 8787877;
CurrentUserCode->SetMeasureCurrent(CurrentUserCode, Real_Current);
return Real_Current;
}
static void CC_Vscan(CCMode *CC){
static int32_t Iin = 0;
static int32_t deltaI = 0;
static int32_t deltaV = 0;
uint16_t divisionRate;
static int32_t CCModeVoltOut(CURRENT_USER_CODE *CurrentUserCode){
int32_t MeasureCurrent = 0;
if(vscanReset){
Vset = 0;
if(CC->_charge == 0){
CC->_Iset *= -1;
}
Iin = CC->_measureCurrent * 20; //[50pA] nA => 50pA
deltaI = Iin - CC->_Iset;
if(deltaI > 20000000 || deltaI < -20000000){ //1mA
divisionRate = 1000;
}else{
divisionRate = 10;
}
deltaV = -1 * (deltaI / divisionRate); //-5 * deltaI / 5000 //pV=> 5nV
if(deltaV > DELTAVOLTMAX){ //100000 = 500uV
deltaV = DELTAVOLTMAX;
}else if(deltaV < (-DELTAVOLTMAX)){
deltaV = (-DELTAVOLTMAX);
}
Vset = Vset + deltaV; //[5nV]
if(Vset <= CC->_Vmin){
Vset = CC->_Vmin;
}else if(Vset >= CC->_Vmax){
Vset = CC->_Vmax;
}
if(CCModeReset){
// DAC should not work now
return 0;
}
if(!vscanReset){
Iin = CC->_measureCurrent * 20; //[50pA] nA => 50pA
deltaI = Iin - CC->_Iset;
// MeasureCurrent = CurrentUserCode->GetMeasureCurrent(CurrentUserCode);
if(deltaI > 20000000 || deltaI < -20000000){ //1mA
divisionRate = 1000;
}else{
divisionRate = 10;
}
NotifyCurrent[0] = (uint8_t) (MeasureCurrent >> 24);
NotifyCurrent[1] = (uint8_t) ((MeasureCurrent & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((MeasureCurrent & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (MeasureCurrent & 0x000000FF);
deltaV = -1 * (deltaI / divisionRate); //-5 * deltaI / 5000 //pV=> 5nV
NotifyVolt[0] = (uint8_t) (MeasureCurrent >> 24);
NotifyVolt[1] = (uint8_t) ((MeasureCurrent & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((MeasureCurrent & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (MeasureCurrent & 0x000000FF);
if(deltaV > DELTAVOLTMAX){ //100000 = 500uV
deltaV = DELTAVOLTMAX;
}else if(deltaV < (-DELTAVOLTMAX)){
deltaV = (-DELTAVOLTMAX);
}
Vset = Vset + deltaV; //[5nV]
if(Vset <= CC->_Vmin){
Vset = CC->_Vmin;
}else if(Vset >= CC->_Vmax){
Vset = CC->_Vmax;
}
}
// int32_t RealV;
// RealV = (int32_t)(deltaV);
// InputNotify(NOTIFY_IMPEDANCE, RealV);
// INSTRUCTION.VoltConstant = 24999 + 500;
// DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
return MeasureCurrent;
}
static void SetCCModeGain(CURRENT_USER_CODE *CurrentUserCode){
switch(CurrentUserCode->lv){
case CURRENT_LV_FOUR:{
INSTRUCTION.ADCGainLevel = GAIN_200R;
break;
}
case CURRENT_LV_THREE:{
INSTRUCTION.ADCGainLevel = GAIN_200R;
break;
}
case CURRENT_LV_TWO:{
INSTRUCTION.ADCGainLevel = GAIN_10K;
break;
}
case CURRENT_LV_ONE:{
INSTRUCTION.ADCGainLevel = GAIN_200K;
break;
}
case CURRENT_LV_ZERO:{
INSTRUCTION.ADCGainLevel = GAIN_200K;
break;
}
default :{
INSTRUCTION.ADCGainLevel = GAIN_200R;
break;
}
}
}
static void CCCurrent2IUC(CURRENT_USER_CODE *CurrentUserCode){
if (INSTRUCTION.CurrentLV == CURRENT_LV_MA){
// largest current ( 0~500 mA)
CurrentUserCode->lv = CURRENT_LV_FOUR;
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent);
}
else if (INSTRUCTION.CurrentLV == CURRENT_LV_UA){
if(INSTRUCTION.ConstantCurrent >= 50000){
// mid range current ( 500 uA ~ 999 uA)
CurrentUserCode->lv = CURRENT_LV_THREE;
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent - 50000);
}
else{
// mid range current ( 0 uA ~ 499 uA)
CurrentUserCode->lv = CURRENT_LV_TWO;
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent);
}
}
else{
if(INSTRUCTION.ConstantCurrent >= 50000){
// mid range current ( 500 nA ~ 999 nA)
CurrentUserCode->lv = CURRENT_LV_ONE;
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent - 50000);
}
else{
// mid range current ( 0 nA ~ 499 nA)
CurrentUserCode->lv = CURRENT_LV_ZERO;
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent);
}
}
}
//static int32_t IUC2RealnA(){
//
//}
//
//static int32_t IUC2RealpA{
//
//}
/*********************************************************************
* @fn Transform2RealpA
*
* @brief transform an IUC into real current value in pA.
*
* @param self, which is an IUC
*
* @return an int32_t current value in pA
*/
static int32_t _Transform2RealpA(CURRENT_USER_CODE *self){
int32_t IUCReal;
/** current level range: 0-4 **/
// current level = 0 => 0-499 nA => ADCGainLevel = 200K
// current level = 1 => 500-999 nA => ADCGainLevel = 10K
// current level = 2 => 0-499 uA => ADCGainLevel = 10K
// current level = 3 => 500-999 uA => ADCGainLevel = 200R
// current level = 4 => 0-499 mA => ADCGainLevel = 200R
// Saturate if current > 500 uA
if (self->lv == CURRENT_LV_FOUR){
return 0xFFFFFFFF;
}
if (self->lv == CURRENT_LV_THREE){
return 0xFFFFFFFF;
}
// 0-499 nA
if (self->lv == CURRENT_LV_ZERO){
IUCReal = (int32_t) (self->value) * 1e3;
}
// 500-999 nA
else if (self->lv == CURRENT_LV_ONE){
IUCReal = ((int32_t) (self->value) * 1e3);
IUCReal = IUCReal + 500e3;
}
// 0-499 uA
else if (self->lv == CURRENT_LV_TWO){
IUCReal = (int32_t) (self->value) * 1e6;
}
return IUCReal;
}
/*********************************************************************
* @fn Transform2RealnA
*
* @brief transform an IUC into real current value in nA.
*
* @param self, which is an IUC
*
* @return an int32_t current value in nA
*/
static int32_t _Transform2RealnA(CURRENT_USER_CODE *self){
int32_t IUCReal;
// Saturate if current < 500 uA
if (self->lv == CURRENT_LV_ZERO | self->lv == CURRENT_LV_ONE | self->lv == CURRENT_LV_TWO){
return 0;
}
// 500-999 uA
if (self->lv == CURRENT_LV_THREE){
IUCReal = (int32_t) (self->value) * 1e3;
IUCReal = IUCReal + 500e3;
}
// 0-499 mA
else if (self->lv == 4){
IUCReal = (int32_t) (self->value) * 1e6;
}
return IUCReal;
}
/*********************************************************************
* @fn CompareCurrent
*
* @brief compare an int32 current with CURRENT_USER_CODE (IUC) type current.
*
* @param unit is current unit (0 = pA, 1 = nA)
* value is current value
*
* @return 0 if equal
* 1 if IUC is larger
* 2 if int32 current is larger.
*/
static uint8_t CompareCurrent(CURRENT_USER_CODE *self, uint8_t unit, int32_t value){
int32_t ErrorRangeIUCReal;
// unit = pA
if (unit == 0){
if (self->_Transform2RealpA(self) > value){
return 1;
}
else if (self->_Transform2RealpA(self) < value){
return 2;
}
else{
return 0;
}
}
// unit = nA
else if (unit == 1){
if (self->_Transform2RealnA(self) > value){
return 1;
}
else if (self->_Transform2RealnA(self) < value){
return 2;
}
else{
return 0;
}
}
}
static void SetMeasureCurrent(CURRENT_USER_CODE *self, int32_t current){
self->_MeasureCurrent = current;
}
static int32_t GetMeasureCurrent(CURRENT_USER_CODE *self){
LED_color(DARKLED, 0x0F, 0x00, 0xFF);
return self->_MeasureCurrent;
}
static CURRENT_USER_CODE *InitCurrentUserCode(){
CURRENT_USER_CODE *CurrentUserCode = malloc(sizeof(CURRENT_USER_CODE));
CurrentUserCode->lv = 0;
CurrentUserCode->value = 0;
CurrentUserCode->_MeasureCurrent = 0;
CurrentUserCode->_Transform2RealnA = &_Transform2RealnA;
CurrentUserCode->_Transform2RealpA = &_Transform2RealpA;
CurrentUserCode->SetMeasureCurrent = &SetMeasureCurrent;
CurrentUserCode->GetMeasureCurrent = &GetMeasureCurrent;
return CurrentUserCode;
}
#endif
@@ -1,130 +0,0 @@
#ifndef ELITECV3
#define ELITECV3
#define Vset INSTRUCTION.Vset
static uint16_t CV3Curve(CV3Mode *CV3){
static uint16_t DACOutCode;
static int32_t Vin;
static int32_t Vout;
static int32_t DeltaVout;
Vin = CV3->_measureVin * 200;//[5nV]
if(DACReset){
Vout = Vset + Vin;
DACReset = false;
}else{
DeltaVout = Vset - (Vout - Vin);
Vout = Vout + DeltaVout;
}
INSTRUCTION.VoltConstant = Vout / 40000 + 25000;//5nV=>usercode
DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant);
int32_t RealV2;
RealV2 = (int32_t)((Vout - Vin) / 200);//[1uV]
InputNotify(NOTIFY_VOLT, RealV2);
int32_t RealV;
RealV = (int32_t)(Vout / 200);//[1uV]
InputNotify(NOTIFY_IMPEDANCE, RealV);
DAC_outputV(DACOutCode);
return DACOutCode;
}
static void CV3_Vscan(CV3Mode *CV3){
static int16_t VminCounter;
static int16_t VmaxCounter;
static uint16_t CycleCounter;
NotifyCycleNumber = (INSTRUCTION.cycleNumber - CV3->_cycleNumber + 1);
if(vscanReset){
VmaxCounter = 0;
VminCounter = 0;
CycleCounter = 0;
if(INSTRUCTION.directionInit == 1){
CV3->_direction_up = true;
CV3->_current_direction_up = true;
}else{
CV3->_direction_up = false;
CV3->_current_direction_up = false;
}
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
if(INSTRUCTION.step <= 10){
CV3->_Vstep = INSTRUCTION.step * INSTRUCTION.VsetRate / 5;
}else{
CV3->_Vstep = INSTRUCTION.step / 5 * INSTRUCTION.VsetRate;
}
if(CV3->_Vmin == CV3->_Vinit){
VminCounter = -1;
}
if(CV3->_Vmax == CV3->_Vinit){
VmaxCounter = -1;
}
Vset = CV3->_Vinit;
}
if(!vscanReset){
if (Vset >= CV3->_Vmax){
VmaxCounter++;
}else if (Vset <= CV3->_Vmin){
VminCounter++;
}
if (CV3->_current_direction_up){
Vset = Vset + CV3->_Vstep;
}else{
Vset = Vset - CV3->_Vstep;
}
if(VmaxCounter != 0 && VminCounter != 0){
if(VmaxCounter == VminCounter && CV3->_direction_up && CV3->_current_direction_up){
if(CycleCounter != VmaxCounter){
if(Vset >= CV3->_Vinit){
CV3->_cycleNumber--;
CycleCounter = VmaxCounter; //VmaxCounter = VminCounter = CycleCounter
}
}
}
if(VmaxCounter == VminCounter && !CV3->_direction_up && !CV3->_current_direction_up){
if(CycleCounter != VmaxCounter){
if(Vset <= CV3->_Vinit){
CV3->_cycleNumber--;
CycleCounter = VmaxCounter; //VmaxCounter = VminCounter = CycleCounter
}
}
}
}
if (Vset >= CV3->_Vmax){
CV3->_current_direction_up = false;
}else if (Vset <= CV3->_Vmin){
CV3->_current_direction_up = true;
}
/*stop condition*/
if(CV3->_cycleNumber == 0){
// PeriodicEvent = false;
InitEliteFlag();
INSTRUCTION.eliteFxn = CONSTANT_CURRENT;
INSTRUCTION.sampleRate = 15;
INSTRUCTION.charge = 0x01;
INSTRUCTION.constantCurrent = 0x00;
INSTRUCTION.Vmax = 0xC350;
INSTRUCTION.Vmin = 0x0000;
INSTRUCTION.notifyRate = 500;
INSTRUCTION.VoViSwitch = 0x02;//read Vscan = Vout - Vin
}
}
// int32_t RealV;
// RealV = (int32_t)(Vset / 500);//[1uV]
// InputNotify(NOTIFY_VOLT, RealV);
}
#endif
@@ -2,7 +2,7 @@
#ifndef ELITECV
#define ELITECV
static uint16_t SWVCurve(WorkMode *WorkModeData) {
static uint16_t SWVCurve() {
static uint8_t counter;
static uint16_t outputV;
static uint16_t Volt;
@@ -10,9 +10,9 @@ static uint16_t SWVCurve(WorkMode *WorkModeData) {
// reset origin volt at the begin
if (DACReset) {
Volt = INSTRUCTION.Ve1;
outputV = INSTRUCTION.Ve1;
if (INSTRUCTION.Ve1 < INSTRUCTION.Ve2)
Volt = INSTRUCTION.VoltOrigin;
outputV = INSTRUCTION.VoltOrigin;
if (INSTRUCTION.VoltOrigin < INSTRUCTION.VoltFinal)
direction_up = true;
else
direction_up = false;
@@ -32,7 +32,7 @@ static uint16_t SWVCurve(WorkMode *WorkModeData) {
// VoltValue = (ramp1*16 + ramp0/16) * 3.05;
// check if we reach the final volt
if ((outputV >= INSTRUCTION.Ve2 && direction_up) || (outputV <= INSTRUCTION.Ve2 && !direction_up)) {
if ((outputV >= INSTRUCTION.VoltFinal && direction_up) || (outputV <= INSTRUCTION.VoltFinal && !direction_up)) {
PeriodicEvent = false;
DACReset = true;
}
@@ -42,14 +42,14 @@ static uint16_t SWVCurve(WorkMode *WorkModeData) {
if (counter == PulseWidth)
Volt = Volt + Amplitude;
else if (counter == 2 * PulseWidth)
Volt = Volt - (Amplitude - INSTRUCTION.step);
Volt = Volt - (Amplitude - INSTRUCTION.Step);
else
Volt = Volt;
} else {
if (counter == PulseWidth)
Volt = Volt - Amplitude;
else if (counter == 2 * PulseWidth)
Volt = Volt + (Amplitude - INSTRUCTION.step);
Volt = Volt + (Amplitude - INSTRUCTION.Step);
else
Volt = Volt;
}
@@ -57,7 +57,7 @@ static uint16_t SWVCurve(WorkMode *WorkModeData) {
return outputV;
}
static uint16_t DPVCurve(WorkMode *WorkModeData) {
static uint16_t DPVCurve() {
static uint8_t counter;
static uint16_t Volt1;
static uint16_t Volt2;
@@ -66,16 +66,16 @@ static uint16_t DPVCurve(WorkMode *WorkModeData) {
// reset origin volt at the begin
if (DACReset) {
if (INSTRUCTION.Ve1 < INSTRUCTION.Ve2)
if (INSTRUCTION.VoltOrigin < INSTRUCTION.VoltFinal)
direction_up = true;
else
direction_up = false;
Volt1 = INSTRUCTION.Ve1;
Volt1 = INSTRUCTION.VoltOrigin;
if (direction_up)
Volt2 = INSTRUCTION.Ve1 + Amplitude;
Volt2 = INSTRUCTION.VoltOrigin + Amplitude;
else
Volt2 = INSTRUCTION.Ve1 - Amplitude;
Volt2 = INSTRUCTION.VoltOrigin - Amplitude;
counter = 1;
DACReset = false;
@@ -99,30 +99,30 @@ static uint16_t DPVCurve(WorkMode *WorkModeData) {
// VoltValue = (ramp1*16 + ramp0/16) * 3.05;
// check if we reach the final volt
if (((outputV >= INSTRUCTION.Ve2) && direction_up) || ((outputV <= INSTRUCTION.Ve2) && !direction_up)) {
if (((outputV >= INSTRUCTION.VoltFinal) && direction_up) || ((outputV <= INSTRUCTION.VoltFinal) && !direction_up)) {
PeriodicEvent = false;
DACReset = true;
}
// check overflow/underflow and prepare for next output
if (direction_up) {
if (Volt1 + INSTRUCTION.step < Volt1)
if (Volt1 + INSTRUCTION.Step < Volt1)
Volt1 = 0xffff;
else
Volt1 = Volt1 + INSTRUCTION.step;
if (Volt2 + INSTRUCTION.step < Volt2)
Volt1 = Volt1 + INSTRUCTION.Step;
if (Volt2 + INSTRUCTION.Step < Volt2)
Volt2 = 0xffff;
else
Volt2 = Volt2 + INSTRUCTION.step;
Volt2 = Volt2 + INSTRUCTION.Step;
} else {
if (Volt1 - INSTRUCTION.step > Volt1)
if (Volt1 - INSTRUCTION.Step > Volt1)
Volt1 = 0x0000;
else
Volt1 = Volt1 - INSTRUCTION.step;
if (Volt2 - INSTRUCTION.step > Volt2)
Volt1 = Volt1 - INSTRUCTION.Step;
if (Volt2 - INSTRUCTION.Step > Volt2)
Volt2 = 0x0000;
else
Volt2 = Volt2 - INSTRUCTION.step;
Volt2 = Volt2 - INSTRUCTION.Step;
}
if (counter + 1 <= (PulsePeriod - PulseWidth)) {
@@ -132,85 +132,68 @@ static uint16_t DPVCurve(WorkMode *WorkModeData) {
}
}
static void CV_Vscan(CVMode *CV){
static int16_t VminCounter;
static int16_t VmaxCounter;
static uint16_t CycleCounter;
static uint16_t CVCurve() {
static uint8_t ramp0;
static uint8_t ramp1;
static uint16_t outputV;
static bool direction_up;
static bool current_direction_up;
NotifyCycleNumber = (INSTRUCTION.cycleNumber - CV->_cycleNumber + 1);
if(vscanReset){
VmaxCounter = 0;
VminCounter = 0;
CycleCounter = 0;
if(INSTRUCTION.directionInit == 1){
CV->_direction_up = true;
CV->_current_direction_up = true;
}else if(INSTRUCTION.directionInit == 0){
CV->_direction_up = false;
CV->_current_direction_up = false;
// reset origin volt at the begin
if (DACReset) {
outputV = INSTRUCTION.VoltOrigin;
if (INSTRUCTION.VoltFinal > INSTRUCTION.VoltOrigin) {
direction_up = true;
current_direction_up = true;
} else {
direction_up = false;
current_direction_up = false;
}
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
if(INSTRUCTION.step <= 10){
CV->_Vstep = INSTRUCTION.step * INSTRUCTION.VsetRate / 5;
}else{
CV->_Vstep = INSTRUCTION.step / 5 * INSTRUCTION.VsetRate;
}
if(CV->_Vmin == CV->_Vinit){
VminCounter = -1;
}
if(CV->_Vmax == CV->_Vinit){
VmaxCounter = -1;
}
Vset = CV->_Vinit;
ramp0 = (uint8_t)(INSTRUCTION.VoltOrigin & 0x00FF); // right byte
ramp1 = (uint8_t)((INSTRUCTION.VoltOrigin >> 8) & 0x00FF); // left byte
DACReset = false;
}
if(!vscanReset){
if (Vset >= CV->_Vmax){
VmaxCounter++;
}else if (Vset <= CV->_Vmin){
VminCounter++;
}
// output a certain volt
DAC_outputV(outputV);
if (CV->_current_direction_up){
Vset = Vset + CV->_Vstep;
}else{
Vset = Vset - CV->_Vstep;
}
if(VmaxCounter != 0 && VminCounter != 0){
if(VmaxCounter == VminCounter && CV->_direction_up && CV->_current_direction_up){
if(CycleCounter != VmaxCounter){
if(Vset >= CV->_Vinit){
CV->_cycleNumber--;
CycleCounter = VmaxCounter; //VmaxCounter = VminCounter = CycleCounter
}
}
if (direction_up) {
if (outputV >= INSTRUCTION.VoltFinal) {
current_direction_up = false; // problem occurs when origin == 0000 final == ffff!!!!!!
} else if (outputV <= INSTRUCTION.VoltOrigin) {
current_direction_up = true;
if (INSTRUCTION.CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
}
if(VmaxCounter == VminCounter && !CV->_direction_up && !CV->_current_direction_up){
if(CycleCounter != VmaxCounter){
if(Vset <= CV->_Vinit){
CV->_cycleNumber--;
CycleCounter = VmaxCounter; //VmaxCounter = VminCounter = CycleCounter
}
}
INSTRUCTION.CycleNumber--;
}
} else {
if (outputV <= INSTRUCTION.VoltFinal) {
current_direction_up = true; // problem occurs when origin == 0000 final == ffff!!!!!!
} else if (outputV >= INSTRUCTION.VoltOrigin) {
current_direction_up = false;
if (INSTRUCTION.CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
}
}
if (Vset >= CV->_Vmax){
CV->_current_direction_up = false;
}else if (Vset <= CV->_Vmin){
CV->_current_direction_up = true;
}
/*stop condition*/
if(CV->_cycleNumber == 0){
reset();
INSTRUCTION.CycleNumber--;
}
}
if (current_direction_up) {
if (outputV + INSTRUCTION.Step < outputV)
outputV = 0xffff;
else
outputV = outputV + INSTRUCTION.Step;
} else {
if (outputV - INSTRUCTION.Step > outputV)
outputV = 0x0000;
else
outputV = outputV - INSTRUCTION.Step;
}
return outputV;
}
#endif
@@ -1,47 +0,0 @@
#ifndef ELITECVSCAN
#define ELITECVSCAN
#define Vset INSTRUCTION.Vset
static uint16_t CVSCANCurve(CVSCANMode *CVSCAN){
static uint16_t DACOutCode;
static int32_t Vin;
static int32_t Vout;
static int32_t DeltaVout;
Vin = CVSCAN->_measureVin * 200;//[5nV]
if(DACReset){
Vout = Vset + Vin;
DACReset = false;
}else{
DeltaVout = Vset - (Vout - Vin);
Vout = Vout + DeltaVout;
}
INSTRUCTION.VoltConstant = Vout / 40000 + 25000;//5nV=>usercode
DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant);
int32_t RealV2;
RealV2 = (int32_t)((Vout - Vin) / 200);//[1uV]
InputNotify(NOTIFY_VOLT, RealV2);
int32_t RealV;
RealV = (int32_t)(Vout / 200);//[1uV]
InputNotify(NOTIFY_IMPEDANCE, RealV);
DAC_outputV(DACOutCode);
return DACOutCode;
}
static void CVSCAN_Vscan(CVSCANMode *CVSCAN){
if(vscanReset){
Vset = CVSCAN->_Vinit;
}
if(!vscanReset){
Vset = CVSCAN->_Vinit;
}
}
#endif
@@ -57,9 +57,4 @@ static uint16_t DAC_outputV(uint16_t voltLV) {
#endif
static int32_t User2Real(uint16_t UserCode){
/* transfer usercode to real voltage value (mV) */
return (int32_t)((UserCode - 25000) / 5);
}
#endif
@@ -1,44 +0,0 @@
#ifndef ELITE_FLAG_CT_INIT
#define ELITE_FLAG_CT_INIT
// CT counter
struct _CT{
uint32_t SampleRate_counter;
uint16_t StepTimeCounter;
uint16_t NotifyCounter;
uint32_t StandByCounter;
}CT = {0};
// GPT counter
struct _GPT{
uint32_t GptimerCounter;
uint32_t GptimerCounter0;
uint8_t DeltaGptimerCounter;
uint32_t SampleRateCounter;
uint32_t NotifyCounter;
uint32_t VscanRateCounter;
uint32_t LeadTimeCounter;
uint32_t BatteryADCCounter;
uint32_t BatteryCheckCounter;
}GPT = {0};
static void InitCT(){
CT.SampleRate_counter = 1;
CT.StepTimeCounter = 1;
CT.NotifyCounter = 1;
CT.StandByCounter = 0;
}
static void InitGPT(){
GPT.GptimerCounter = 0;
GPT.GptimerCounter0 = 0;
GPT.DeltaGptimerCounter = 0;
GPT.SampleRateCounter = 0;
GPT.NotifyCounter = 0;
GPT.VscanRateCounter = 0;
GPT.LeadTimeCounter = 0;
GPT.BatteryADCCounter = 0;
GPT.BatteryCheckCounter = 0;
}
#endif
@@ -17,7 +17,7 @@ static void elite_gptimer_callback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_In
#define elite_gptimer_start() GPTimerCC26XX_start(gptimer_handle)
#define elite_gptimer_stop() GPTimerCC26XX_stop(gptimer_handle)
#define elite_gptimer_close() GPTimerCC26XX_close(gptimer_handle)
#define CLOCK_FREQ 4800 // clock freq = 0.1 ms
#define CLOCK_FREQ 4000 // clock freq = 0.1 ms
#define elite_gptimer_open() \
do { \
@@ -2,78 +2,22 @@
#ifndef ELITEIT
#define ELITEIT
static void IT_Plot(WorkMode *WorkModeData) {
switch (INSTRUCTION.eliteFxn) {
case IT_CURVE:{
#define CURRENT_MODE WorkModeData->IT
break;
}
case VT_CURVE:{
#define CURRENT_MODE WorkModeData->VT
break;
}
case ZT_CURVE:{
#define CURRENT_MODE WorkModeData->RT
break;
}
case IV_CURVE:{
#define CURRENT_MODE WorkModeData->IV
break;
}
case CV_CURVE:{
#define CURRENT_MODE WorkModeData->CV
break;
}
case CONSTANT_CURRENT:{
#define CURRENT_MODE WorkModeData->CC
break;
}
case CYCLIC_VOLTAMMETRY:{
#define CURRENT_MODE WorkModeData->CV3
break;
}
case LINEAR_SWEEP_VOLTAMMETRY:{
#define CURRENT_MODE WorkModeData->LSV
break;
}
case CONSTANT_VSCAN:{
#define CURRENT_MODE WorkModeData->CVSCAN
break;
}
default: {
break;
}
}
static int32_t IT_Plot() {
// read ADC current
int32_t Real_Current = 0;
ADCGainControl(INSTRUCTION.ADCGainLevel);
ADCChannelSelect(ADC_CH_CURRENT);
CPUdelay(10);
ADC_read(spi_ADC_rxbuf);
static uint8_t ADCSwitch = 0;
// check if ADC over/under flow
// let the output saturate if over/under flow
// ADC_overflow(INSTRUCTION.ADCGainLevel, spi_ADC_rxbuf);
if(batteryCheck_flag){
EliteADCBattery();
if(!batteryCheck_flag){
ReadCurrent(spi_ADC_rxbuf);
ADCSwitch = 2;
}
}else{
if(ADCSwitch == 0){ /**read Iin(buffer)**/
if(INSTRUCTION.AutoGainEnable){
CURRENT_MODE->_measureCurrent = AutoGainReadCurrent(spi_ADC_rxbuf);
AutoGainChange(CURRENT_MODE->_measureCurrent);
}else{
ReadCurrent(spi_ADC_rxbuf);
CURRENT_MODE->_measureCurrent = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent);
ADCSwitch++;
}
else if(ADCSwitch == 1){ /**read Iin**/
ReadCurrent(spi_ADC_rxbuf);
ADCSwitch++;
}
else if(ADCSwitch == 2){ /**read Iin**/
ReadCurrent(spi_ADC_rxbuf);
ADCSwitch = 0;
}
}
#undef CURRENT_MODE
// decode ADC value and put it into notify buffer
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
return Real_Current;
}
#endif
@@ -2,208 +2,69 @@
#ifndef ELITEIV
#define ELITEIV
#define Vset INSTRUCTION.Vset
static void DACenable(WorkMode *WorkModeData, int32_t VoltData ,uint8_t afterRead){
if(afterRead == AFTER_READ_I){
switch (INSTRUCTION.eliteFxn) {
case CONSTANT_CURRENT:{
CC_Vscan(WorkModeData->CC);
OneWayVoltScan();
break;
}
case IV_CURVE:
case CV_CURVE:
case ZT_CURVE:
case IT_CURVE:
case VT_CURVE:
case CYCLIC_VOLTAMMETRY:
case LINEAR_SWEEP_VOLTAMMETRY:
case CONSTANT_VSCAN:{
break;
}
default:{
break;
}
}
}else if(afterRead == AFTER_READ_V){
switch (INSTRUCTION.eliteFxn) {
case IV_CURVE:
case CV_CURVE:{
OneWayVoltScan();
break;
}
case ZT_CURVE:{
CalcuResistance(WorkModeData->RT, VoltData);
break;
}
case IT_CURVE:
case VT_CURVE:
case CONSTANT_CURRENT:{
break;
}
case CYCLIC_VOLTAMMETRY:{
CV3Curve(WorkModeData->CV3);
break;
}
case LINEAR_SWEEP_VOLTAMMETRY:{
LSVCurve(WorkModeData->LSV);
break;
}
case CONSTANT_VSCAN:{
CVSCANCurve(WorkModeData->CVSCAN);
break;
}
default:{
break;
}
}
static uint16_t VoltScan() {
uint16_t Voltage;
if (INSTRUCTION.VoltOrigin == INSTRUCTION.VoltFinal) {
Voltage = Usercode_Correction_to_DAC(INSTRUCTION.VoltOrigin);
DAC_outputV(Voltage);
PeriodicEvent = false;
return Voltage;
} else if (INSTRUCTION.eliteFxn == SQUARE_WAVE_VOLTAMMETRY) {
Voltage = SWVCurve();
} else if (INSTRUCTION.eliteFxn == DIFFERENTIAL_PULSE_VOLTAMMETRY) {
Voltage = DPVCurve();
} else if (INSTRUCTION.eliteFxn == CYCLIC_VOLTAMMETRY) {
Voltage = CVCurve();
}
}
static void CalcuResistance(RTMode *RT, int32_t VoltData){
/* Elite 100 = 100R
Elite 1000 = 1KR
Elite 10000 = 10KR
Elite 100000 = 100KR
Elite 1000000 = 1MR
*/
static int32_t resister_32 = 0;
int32_t Vtemp;
Vtemp = (VoltData * 1000) - (RT->_measureCurrent * 10); //V = Vin - Iin * 10
resister_32 = Vtemp / RT->_measureCurrent; //R = V / Iin;
InputNotify(NOTIFY_IMPEDANCE, resister_32);
// IV plot mode
else {
Voltage = OneWayVoltScan();
}
return Voltage;
}
static uint16_t OneWayVoltScan() {
static uint16_t DACOutCode;
static int32_t Vout;
static int32_t DeltaVout;
if(DACReset){
Vout = Vset;
DACReset = false;
}else{
DeltaVout = Vset - (Vout);
Vout = Vout + DeltaVout;
// reset origin volt at the begin
if (DACReset) {
DACUserCode = INSTRUCTION.VoltOrigin;
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
DACReset = false;
// output VOLT_ORIGIN
DAC_outputV(DACOutCode);
return DACOutCode;
}
INSTRUCTION.VoltConstant = Vout / 40000 + 25000; //5nV=>usercode
DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant);
DAC_outputV(DACOutCode);
if (StepTimeCounter == INSTRUCTION.StepTime) {
if (INSTRUCTION.VoltOrigin < INSTRUCTION.VoltFinal) {
// output the next output volt
DACUserCode = DACUserCode + INSTRUCTION.Step;
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
DAC_outputV(DACOutCode);
if ((INSTRUCTION.eliteFxn == IV_CURVE)||(INSTRUCTION.eliteFxn == CV_CURVE)||(INSTRUCTION.eliteFxn == CONSTANT_CURRENT)){
int32_t RealV;
RealV = (int32_t)(Vout / 200);//[1uV]
InputNotify(NOTIFY_IMPEDANCE, RealV);
// end IV task if we reach INSTRUCTION.VoltFinal
if (DACUserCode >= INSTRUCTION.VoltFinal) {
PeriodicEvent = false;
DACReset = true;
}
} else {
// output the next output volt
DACUserCode = DACUserCode - INSTRUCTION.Step;
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
DAC_outputV(DACOutCode);
// end IV task if we reach INSTRUCTION.VoltFinal
if (DACUserCode <= INSTRUCTION.VoltFinal) {
PeriodicEvent = false;
DACReset = true;
}
}
}
return DACOutCode;
}
static void IV_Plot(IVMode *IV) {
/**********************************************
CURRENT_MODE->_VoViSwitch : 1 read Vin volt
->_VoViSwitch : 0 read Vout volt
***********************************************/
static uint8_t VoltCurrentSwitch = 0;
if(VoltCurrentSwitch == 0){ /**read Iin(buffer),read Vin**/
// read current
if(INSTRUCTION.AutoGainEnable){
IV->_measureCurrent = AutoGainReadCurrent(spi_ADC_rxbuf);
AutoGainChange(IV->_measureCurrent);
}else{
ReadCurrent(spi_ADC_rxbuf);
IV->_measureCurrent = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
OneWayVoltScan();
InputNotify(NOTIFY_CURRENT, IV->_measureCurrent);
// read Volt
if(IV->_VoViSwitch == 0x01){
ReadVolt(spi_ADC_rxbuf);
}else if(IV->_VoViSwitch == 0x00){
ReadVoutVolt(spi_ADC_rxbuf);
}
VoltCurrentSwitch++;
}
else if(VoltCurrentSwitch == 1){ /**read Vin**/
// read Volt
if(IV->_VoViSwitch == 0x01){
ReadVolt(spi_ADC_rxbuf);
}else if(IV->_VoViSwitch == 0x00){
ReadVoutVolt(spi_ADC_rxbuf);
}
VoltCurrentSwitch++;
}
else if(VoltCurrentSwitch == 2){ /**read Vin(buffer),read Iin**/
// read Volt
if(IV->_VoViSwitch == 0x01){
ReadVolt(spi_ADC_rxbuf);
IV->_measureVin = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
}else if(IV->_VoViSwitch == 0x00){
ReadVoutVolt(spi_ADC_rxbuf);
IV->_measureVin = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_DAC, spi_ADC_rxbuf);
}
InputNotify(NOTIFY_VOLT, IV->_measureVin);
// read current
ReadCurrent(spi_ADC_rxbuf);
VoltCurrentSwitch++;
}
else if(VoltCurrentSwitch == 3){ /**read Iin**/
// read current
ReadCurrent(spi_ADC_rxbuf);
VoltCurrentSwitch = 0;
}
}
static void IV_Vscan(IVMode *IV){
if(vscanReset){
if(INSTRUCTION.directionInit == 1){
IV->_direction_up = true;
IV->_current_direction_up = true;
}else if(INSTRUCTION.directionInit == 0){
IV->_direction_up = false;
IV->_current_direction_up = false;
}
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
if(INSTRUCTION.step <= 10){
IV->_Vstep = INSTRUCTION.step * INSTRUCTION.VsetRate / 5;
}else{
IV->_Vstep = INSTRUCTION.step / 5 * INSTRUCTION.VsetRate;
}
Vset = IV->_Vinit;
}
if(!vscanReset){
if(IV->_current_direction_up){
if(Vset >= IV->_Vmax){
reset();
}
}else{
if(Vset <= IV->_Vmin){
reset();
}
}
if (IV->_current_direction_up){
Vset = Vset + IV->_Vstep;
}else{
Vset = Vset - IV->_Vstep;
}
}
}
#endif
@@ -8,54 +8,53 @@
#define GAIN_200R 0x02 // the least gain
#define GAIN_AUTO 0x03
/* DAC reset parameter */
#define DAC_ZERO 25000
#define DAC_POS_MAX 0x0000
#define DAC_NEG_MAX 0xFFFF
/** Resister meter **/
#define RESISTER_METER_SMALL 0x00
#define RESISTER_METER_MIDDLE1 0x01
#define RESISTER_METER_MIDDLE2 0x02
#define RESISTER_METER_LARGE 0x03
// Step time macro
#define STEPTIME_HALF_SEC 5000
#define STEPTIME_ONE_SEC 10000
#define STEPTIME_TWO_SEC 20000
/** CC mode parameter **/
// CurrentLV
#define CURRENT_LV_NA 0x00
#define CURRENT_LV_UA 0x01
#define CURRENT_LV_MA 0x02
/*==============================
==== headstage instruction ====
=============================*/
struct HEADSTAGE_INSTRUCTION {
/** chip ID */
uint8_t chip_id;
uint8_t chip_id;
uint8_t eliteFxn;
/** Sample rate **/
// SampleRate = SampleRateTable[SampleRateIndex]
uint8_t SampleRateIndex;
uint16_t SampleRate;
/** DAC parameter **/
uint8_t VsetRateIndex;
uint32_t VsetRate;
int32_t Vset;
// volt san parameter
uint16_t VoltOrigin;
uint16_t VoltFinal;
uint16_t Step;
uint8_t StepTime;
// constant volt
uint16_t VoltConstant;
uint8_t directionInit;
uint32_t step;
uint16_t Ve1;
uint16_t Ve2;
int32_t Vinit;
int32_t Vmax;
int32_t Vmin;
/** ADC parameter **/
uint8_t sampleRateIndex;
uint32_t sampleRate;
uint8_t VoViSwitch;
uint8_t AutoGainEnable;
uint8_t ADCGainLevel;
uint8_t ADCGainLevel;
/** Notify parameter **/
uint32_t notifyRate;
/** Constant Current Parameter **/
uint8_t CurrentLV; // nA? uA? mA?
uint32_t ConstantCurrent;
/** mode parameter **/
uint16_t cycleNumber;
uint8_t charge;
int32_t constantCurrent;
int32_t Currentmax;
/** Resister Measure **/
uint8_t ResisterMeter;
uint16_t StepTime;
// elite function
uint8_t eliteFxn;
uint8_t CycleNumber;
} INSTRUCTION = {0};
@@ -69,30 +68,20 @@ struct HEADSTAGE_INSTRUCTION {
* @return None.
*/
static void InitEliteInstruction(){
INSTRUCTION.chip_id = 0;
INSTRUCTION.eliteFxn = 0; //default is a null event
INSTRUCTION.VsetRateIndex = 0;
INSTRUCTION.VsetRate = 2;
INSTRUCTION.Vset = 0;
INSTRUCTION.VoltConstant = DAC_ZERO; //DAC_ZERO is about 0V
INSTRUCTION.directionInit = 1; //0:reverse 1:forward
INSTRUCTION.step = 0;
INSTRUCTION.Ve1 = DAC_ZERO;
INSTRUCTION.Ve2 = DAC_ZERO;
INSTRUCTION.Vinit = 0;
INSTRUCTION.Vmax = 0;
INSTRUCTION.Vmin = 0;
INSTRUCTION.sampleRateIndex = 1;
INSTRUCTION.sampleRate = 100;
INSTRUCTION.VoViSwitch = 0x01; //0:user see Vo 1: user see Vi
INSTRUCTION.AutoGainEnable = 1;
INSTRUCTION.ADCGainLevel = GAIN_AUTO;
INSTRUCTION.notifyRate = STEPTIME_ONE_SEC;
INSTRUCTION.cycleNumber = 1;
INSTRUCTION.charge = 1; //0:discharge 1:charge
INSTRUCTION.constantCurrent = 0;
INSTRUCTION.Currentmax = 0;
INSTRUCTION.StepTime = STEPTIME_ONE_SEC;
INSTRUCTION.chip_id = 0;
INSTRUCTION.SampleRateIndex = 1;
INSTRUCTION.SampleRate = 10;
INSTRUCTION.VoltOrigin = DAC_ZERO;
INSTRUCTION.VoltFinal = DAC_POS_MAX;
INSTRUCTION.Step = 0x0005; // 0x0005 = 1mV
INSTRUCTION.StepTime = STEPTIME_HALF_SEC; // about 0.5 sec
INSTRUCTION.VoltConstant = 24999; // is about 0V
INSTRUCTION.ADCGainLevel = GAIN_200R;
INSTRUCTION.ResisterMeter = RESISTER_METER_SMALL;
INSTRUCTION.CurrentLV = 0x00;
INSTRUCTION.ConstantCurrent = 0x00000000;
INSTRUCTION.eliteFxn = 0; // default is a null event
INSTRUCTION.CycleNumber = 0;
}
/*********************************************************************
@@ -108,7 +97,7 @@ static void GetInstructionParameter(uint8 *ins){
// CurrentLV=0 => unit is nA
// CurrentLV=1 => unit is uA
// CurrentLV=2 => unit is mA
// INSTRUCTION.CurrentLV = (*ins);
INSTRUCTION.CurrentLV = (*ins);
// ConstantCurrentRange=0 => current value is 0~499
// ConstantCurrentRange=1 => current value is 500~999
@@ -119,7 +108,7 @@ static void GetInstructionParameter(uint8 *ins){
// CurrentLV = 1 (unit is uA)
// ConstantCurrentRange = 0 (current range is 0~499)
// ConstantCurrent = 48570
INSTRUCTION.constantCurrent = (uint32_t) (*(ins+1))<<24 | (uint32_t) (*(ins+2))<<16 | (uint32_t) (*(ins+3))<<8 | (uint32_t) (*(ins+4));
INSTRUCTION.ConstantCurrent = (uint32_t) (*(ins+1))<<24 | (uint32_t) (*(ins+2))<<16 | (uint32_t) (*(ins+3))<<8 | (uint32_t) (*(ins+4));
}
#endif
@@ -2,31 +2,25 @@
#ifndef ELITEKEYDETECT
#define ELITEKEYDETECT
#define CLOCK_ONE_SECOND 10000
static bool TurnOnElite(uint8_t key) {
static uint16_t TurnOnCounter = 0;
if (key == 0) {
// press 1 sec, power on LED, read bat power
// press 1 sec, power on LED
if (TurnOnCounter >= CLOCK_ONE_SECOND) {
headstage_battery_volt();
uint16_t bat = ((uint16_t)(NotifyVoltBat[2]) << 8 & 0xFF00 ) |
((uint16_t)(NotifyVoltBat[3]) & 0x00FF);
if( bat < 768 && bat > 20){
PIN_setOutputValue(pin_handle, enable_5v, 0);
return false;
}else{
PIN_setOutputValue(pin_handle, enable_5v, 1); // enable 5V
TurnOn10V();
LEDPowerON();
return true;
}
PIN_setOutputValue(pin_handle, enable_5v, 1); // enable 5V
TurnOn10V();
LEDPowerON();
return true;
} else {
TurnOnCounter++;
return false;
}
} else {
TurnOnCounter = 0;
PIN_setOutputValue(pin_handle, enable_5v, 0);
PIN_setOutputValue(pin_handle, enable_5v, 0); // enable 5V
return false;
}
}
@@ -29,7 +29,7 @@ static void WorkModeLED() {
WORKLED();
break;
}
case CV_CURVE: {
case CYCLIC_VOLTAMMETRY: {
WORKLED();
break;
}
@@ -50,18 +50,14 @@ static void WorkModeLED() {
break;
}
case VT_CURVE: {
WORKLED();
// WORKLED();
break;
}
case IT_CURVE: {
WORKLED();
break;
}
case CONSTANT_CURRENT:{
// WORKLED();
LED_color(0xE2, 0x00, 0x00, 0xAA);
break;
}
case VIS_RST: {
LEDPowerON();
break;
@@ -70,18 +66,7 @@ static void WorkModeLED() {
WORKLED();
break;
}
case CYCLIC_VOLTAMMETRY: {
WORKLED();
break;
}
case LINEAR_SWEEP_VOLTAMMETRY: {
WORKLED();
break;
}
case CONSTANT_VSCAN: {
WORKLED();
break;
}
default: {
LEDPowerON();
break;
@@ -97,7 +82,7 @@ static void KeyWorkModeLED() {
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
break;
}
case CV_CURVE:{
case CYCLIC_VOLTAMMETRY:{
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
break;
}
@@ -1,96 +0,0 @@
#ifndef ELITELSV
#define ELITELSV
#define Vset INSTRUCTION.Vset
static uint16_t LSVCurve(LSVMode *LSV){
static uint16_t DACOutCode;
static int32_t Vin;
static int32_t Vout;
static int32_t DeltaVout;
Vin = LSV->_measureVin * 200;//[5nV]
if(DACReset){
Vout = Vset + Vin;
DACReset = false;
}else{
DeltaVout = Vset - (Vout - Vin);
Vout = Vout + DeltaVout;
}
INSTRUCTION.VoltConstant = Vout / 40000 + 25000;//5nV=>usercode
DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant);
int32_t RealV2;
RealV2 = (int32_t)((Vout - Vin) / 200);//[1uV]
InputNotify(NOTIFY_VOLT, RealV2);
int32_t RealV;
RealV = (int32_t)(Vout / 200);//[1uV]
InputNotify(NOTIFY_IMPEDANCE, RealV);
DAC_outputV(DACOutCode);
//
return DACOutCode;
}
static void LSV_Vscan(LSVMode *LSV){
NotifyCycleNumber = (INSTRUCTION.cycleNumber - LSV->_cycleNumber + 1);
if(vscanReset){
if(INSTRUCTION.directionInit == 1){
LSV->_direction_up = true;
LSV->_current_direction_up = true;
}else{
LSV->_direction_up = false;
LSV->_current_direction_up = false;
}
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
if(INSTRUCTION.step <= 10){
LSV->_Vstep = INSTRUCTION.step * INSTRUCTION.VsetRate / 5;
}else{
LSV->_Vstep = INSTRUCTION.step / 5 * INSTRUCTION.VsetRate;
}
Vset = LSV->_Vinit;
}
if(!vscanReset){
if (LSV->_current_direction_up){
Vset = Vset + LSV->_Vstep;
}else{
Vset = Vset - LSV->_Vstep;
}
/*stop condition*/
if (Vset >= LSV->_Vmax){
// PeriodicEvent = false;
Vset = LSV->_Vmin;
InitEliteFlag();
INSTRUCTION.eliteFxn = CONSTANT_CURRENT;
INSTRUCTION.sampleRate = 15;
INSTRUCTION.charge = 0x01;
INSTRUCTION.constantCurrent = 0x00;
INSTRUCTION.Vmax = 0xC350;
INSTRUCTION.Vmin = 0x0000;
INSTRUCTION.notifyRate = 500;
INSTRUCTION.VoViSwitch = 0x02;//read Vscan = Vout - Vin
}else if (Vset <= LSV->_Vmin){
// PeriodicEvent = false;
Vset = LSV->_Vmax;
InitEliteFlag();
INSTRUCTION.eliteFxn = CONSTANT_CURRENT;
INSTRUCTION.sampleRate = 15;
INSTRUCTION.charge = 0x01;
INSTRUCTION.constantCurrent = 0x00;
INSTRUCTION.Vmax = 0xC350;
INSTRUCTION.Vmin = 0x0000;
INSTRUCTION.notifyRate = 500;
INSTRUCTION.VoViSwitch = 0x02;//read Vscan = Vout - Vin
}
}
}
#endif
@@ -1,19 +1,15 @@
/**
* notify data buffer.
* the length equals to the characteristic 4 which value is 20 bytes.
*
*/
#ifndef ELITENOTIFY
#define ELITENOTIFY
#include "headstage.h"
/*notify's input type*/
#define NOTIFY_CURRENT 0
#define NOTIFY_VOLT 1
#define NOTIFY_IMPEDANCE 2
#define NOTIFY_VOLT_BAT 3
/**
* notify data buffer.
* the length equals to the characteristic 4 which value is 20 bytes.
*
*/
#define NOT_BUF_OFFSET_INIT 8
@@ -21,14 +17,18 @@
* the index where to start insert data into buffer.
* start from 6.
*/
static size_t not_buf_offset = NOT_BUF_OFFSET_INIT;
static size_t not_buf_offset = NOT_BUF_OFFSET_INIT;
static uint32_t not_time_stamp;
static uint8_t NotifyCurrent[4] = {0};
static uint8_t NotifyVolt[4] = {0};
static uint8_t NotifyImpedance[4] = {0};
static uint8_t NotifyVoltBat[4] = {0};
static uint16_t NotifyCycleNumber = 0;
static uint8_t NotifyCurrent[4] = {0};
static uint8_t NotifyVolt[4] = {0};
static uint8_t NotifyImpedance[4] = {0};
/**
* counter of notify send.
*/
static uint32_t notify_counter = 0;
// ****************** New Notify Format ******************************** //
/*
@@ -81,14 +81,12 @@ static uint16_t NotifyCycleNumber = 0;
0xFF
* header = device ID
* I = current (nA), V = voltage (uV),
* Z = impedance (ohm), T = time (ms)
* I = current (0.001nA), V = voltage (mV),
* Z = impedance (k ohm), T = time (ms)
*
*
*/
static void SendNotify() {
initDATBuf();
not_buf[0] = INSTRUCTION.chip_id;
for (int i = 0; i < 4; i++) {
@@ -105,84 +103,10 @@ static void SendNotify() {
not_buf[15] = (not_time_stamp >> 16) & 0xff;
not_buf[16] = (not_time_stamp >> 24) & 0xff;
not_buf[17] = (NotifyCycleNumber >> 8) & 0xff;
not_buf[18] = NotifyCycleNumber & 0xff;
not_buf[19] = 0;
not_buf[20] = 0;
not_buf[21] = 0;
not_buf[22] = 0;
// cyclic voltametry cycle number
not_buf[17] = INSTRUCTION.CycleNumber;
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
}
static void initDATBuf(){
for (int i = 0; i < BLE_DAT_BUFF_SIZE; i++){
not_buf[i] = 0;
}
}
static void initINSBuf(){
for (int i = 0; i < BLE_INS_BUFF_SIZE; i++){
ins_buf[i] = 0;
}
}
static void initCISBuf(){
for (int i = 0; i < BLE_CIS_BUFF_SIZE; i++){
cis_buf[i] = 0;
}
}
static void initRawDataBuf(){
not_time_stamp = 0;
NotifyCycleNumber = 0;
for (int i = 0; i < 4; i++){
NotifyCurrent[i] = 0;
NotifyVolt[i] = 0;
NotifyImpedance[i] = 0;
}
}
static void FlushNotify(){
initRawDataBuf();
initDATBuf();
not_buf[0] = INSTRUCTION.chip_id;
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
}
static void InputNotify(int NotifyType, int32_t Data){
switch (NotifyType) {
case NOTIFY_CURRENT:
NotifyCurrent[0] = (uint8_t)((Data & 0xFF000000) >> 24);
NotifyCurrent[1] = (uint8_t)((Data & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t)((Data & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t)(Data & 0x000000FF);
break;
case NOTIFY_IMPEDANCE:
NotifyImpedance[0] = (uint8_t)((Data & 0xFF000000) >> 24);
NotifyImpedance[1] = (uint8_t)((Data & 0x00FF0000) >> 16);
NotifyImpedance[2] = (uint8_t)((Data & 0x0000FF00) >> 8);
NotifyImpedance[3] = (uint8_t)(Data & 0x000000FF);
break;
case NOTIFY_VOLT :
NotifyVolt[0] = (uint8_t)((Data & 0xFF000000) >> 24);
NotifyVolt[1] = (uint8_t)((Data & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t)((Data & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t)(Data & 0x000000FF);
break;
case NOTIFY_VOLT_BAT :
NotifyVoltBat[0] = (uint8_t)((Data & 0xFF000000) >> 24);
NotifyVoltBat[1] = (uint8_t)((Data & 0x00FF0000) >> 16);
NotifyVoltBat[2] = (uint8_t)((Data & 0x0000FF00) >> 8);
NotifyVoltBat[3] = (uint8_t)(Data & 0x000000FF);
break;
}
}
#endif
@@ -3,16 +3,23 @@
#define ELITERESET
static void reset() {
InitEliteFlag();
InitFlag();
InitCT();
InitGPT();
PeriodicEvent = false;
DACReset = true;
CCModeReset = 1;
InitEliteInstruction();
SampleRate_counter = 1;
StepTimeCounter = 1;
avg_number = 0;
ADCRealCurrent_long = 0;
if (INSTRUCTION.eliteFxn == CONSTANT_CURRENT){
INSTRUCTION.eliteFxn = 0;
}
ADCGainControl(INSTRUCTION.ADCGainLevel);
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
LEDPowerON();
initINSBuf();
initDATBuf();
for (int i = 0; i < BLE_INS_BUFF_SIZE; i++) {
ins_buf[i] = 0;
}
for (int i = 0; i < SPI_LED_SIZE; i++) {
spi_LEDtxbuf[i] = 0;
@@ -29,22 +36,29 @@ static void reset() {
spi_ADC_rxbuf[i] = 0;
}
for (int i = 0; i < BLE_DAT_BUFF_SIZE; i++) {
not_buf[i] = 0;
}
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
CPUdelay(1600);
}
static void Eliteinterrupt() {
InitEliteFlag();
InitFlag();
InitCT();
InitGPT();
PeriodicEvent = false;
DACReset = true;
CCModeReset = 1;
InitEliteInstruction();
StepTimeCounter = 1;
SampleRate_counter = 1;
avg_number = 0;
ADCRealCurrent_long = 0;
ADCGainControl(GAIN_AUTO);
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
LEDPowerON();
initINSBuf();
initDATBuf();
for (int i = 0; i < BLE_INS_BUFF_SIZE; i++) {
ins_buf[i] = 0;
}
for (int i = 0; i < SPI_LED_SIZE; i++) {
spi_LEDtxbuf[i] = 0;
@@ -61,8 +75,47 @@ static void Eliteinterrupt() {
spi_ADC_rxbuf[i] = 0;
}
for (int i = 0; i < BLE_DAT_BUFF_SIZE; i++) {
not_buf[i] = 0;
}
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
CPUdelay(8000);
}
static void CleanBuffer() {
PeriodicEvent = false;
DACReset = true;
CCModeReset = 1;
// InitEliteInstruction();
SampleRate_counter = 1;
StepTimeCounter = 1;
avg_number = 0;
ADCRealCurrent_long = 0;
for (int i = 0; i < SPI_LED_SIZE; i++) {
spi_LEDtxbuf[i] = 0;
spi_LEDrxbuf[i] = 0;
}
for (int i = 0; i < SPI_DAC_SIZE; i++) {
spi_DACtxbuf[i] = 0;
spi_rxbuf[i] = 0;
}
for (int i = 0; i < SPI_ADC_SIZE; i++) {
spi_ADC_txbuf[i] = 0;
spi_ADC_rxbuf[i] = 0;
}
for (int i = 0; i < BLE_DAT_BUFF_SIZE; i++) {
not_buf[i] = 0;
}
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
CPUdelay(8000);
}
#endif
@@ -2,84 +2,17 @@
#ifndef ELITEVT
#define ELITEVT
static void VT_Plot(WorkMode *WorkModeData) {
switch (INSTRUCTION.eliteFxn) {
case IT_CURVE:{
#define CURRENT_MODE WorkModeData->IT
break;
}
case VT_CURVE:{
#define CURRENT_MODE WorkModeData->VT
break;
}
case ZT_CURVE:{
#define CURRENT_MODE WorkModeData->RT
break;
}
case IV_CURVE:{
#define CURRENT_MODE WorkModeData->IV
break;
}
case CV_CURVE:{
#define CURRENT_MODE WorkModeData->CV
break;
}
case CONSTANT_CURRENT:{
#define CURRENT_MODE WorkModeData->CC
break;
}
case CYCLIC_VOLTAMMETRY:{
#define CURRENT_MODE WorkModeData->CV3
break;
}
case LINEAR_SWEEP_VOLTAMMETRY:{
#define CURRENT_MODE WorkModeData->LSV
break;
}
case CONSTANT_VSCAN:{
#define CURRENT_MODE WorkModeData->CVSCAN
break;
}
default: {
break;
}
}
static void VT_Plot() {
// ADC gain is don't care when measuring voltage
INSTRUCTION.ADCGainLevel = GAIN_200R;
ADCGainControl(INSTRUCTION.ADCGainLevel);
uint8_t ADCGain = 0;
static uint8_t ADCSwitch = 0;
static int32_t VoltData;
// read ADC volt
ADCChannelSelect(ADC_CH_VOLT);
CPUdelay(10);
ADC_read(spi_ADC_rxbuf);
if(batteryCheck_flag){
EliteADCBattery();
if(!batteryCheck_flag){
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
ADCSwitch = 2;
}
}else{
if(ADCSwitch == 0){ /**read V(buffer)**/
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
if(CURRENT_MODE->_VoViSwitch == 0x01){
CURRENT_MODE->_measureVin = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
VoltData = CURRENT_MODE->_measureVin;
}else if(CURRENT_MODE->_VoViSwitch == 0x00){
CURRENT_MODE->_measureVout = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_DAC, spi_ADC_rxbuf);
VoltData = CURRENT_MODE->_measureVout;
}
InputNotify(NOTIFY_VOLT, VoltData);
ADCSwitch++;
}
else if(ADCSwitch == 1){ /**read V**/
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
ADCSwitch++;
}
else if(ADCSwitch == 2){ /**read V**/
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
ADCSwitch = 0;
}
}
#undef CURRENT_MODE
// decode ADC value and put it into notify buffer
DecodeADCValue(ADCGain, ADC_CH_VOLT, spi_ADC_rxbuf);
}
#endif
@@ -1,553 +0,0 @@
#ifndef ELITE_WORK_DATA
#define ELITE_WORK_DATA
#define CLOCK_ONE_SECOND 10000
#include "EliteInstruction.h"
static bool Free_Work_Mode = false;
typedef void (*InitWorkData) ();
/***** Template of Measure and VoltOut parameter *****/
#define MEASURE \
int32_t _measureCurrent; \
int32_t _measureVin; \
int32_t _measureVout; \
int32_t _measureBat; \
uint8_t _VoViSwitch
#define VOUT_PARA \
int32_t _Vinit; \
int32_t _Vmax; \
int32_t _Vmin; \
int32_t _Vset; \
uint32_t _Vstep; \
bool _direction_up; \
bool _current_direction_up; \
uint16_t _cycleNumber
// direction_up = true, if directionInit=1
// current_direction_up = true, Vstep => positive. vice versa
/* CC Mode parameter
* @ Measure : measure current value (nA)
* @ Charge : Charge or Discharge
* @ BatteryV : Vin measure battery voltage (mV)
* @ value : constant current setting.
* Current value divide current level into 3,000,001 pieces
* 1,500,000 is zero point; 3,000,000 is 15mA
* Current = (value - 1,500,000)/100,000 mA
* @ Done : Done = false => Ignore Vmin condition;
* Done will be true, if BatteryV <= Vmin last for about 12sec in discharge mode
* @ VMax : voltage upper bound in charge mode
* CC->value will set to zero if BatteryV >= VMax in charge mode
* @ VMin : voltage lower bound in charge mode
* CC->value will set to zero if BatteryV <=> VMin in charge mode
* Note that VMax and VMin are always larger or equal to zero
* @_Transform2RealnA : transform a current user code (IUC) to real current in nA
*/
#define CC_PARA \
int32_t _measureCurrent; \
uint8_t _VoViSwitch; \
uint8_t Charge; \
int32_t BatteryV; \
int32_t value; \
uint16_t Done; \
uint32_t VMax; \
uint16_t VMin; \
int32_t _measureVin; \
int32_t Vset; \
int32_t Iset; \
int32_t (*_Transform2RealnA)(struct CCModePara *)
#define LIMIT \
uint32_t _LimitValue; \
void (*SetLimitValue) (struct Limit *, uint32_t); \
uint32_t (*GetLimitValue) (struct Limit*)
struct Measure{
MEASURE;
};
struct VoltOutPara{
VOUT_PARA;
};
struct Limit{
LIMIT;
};
struct CCModePara{
CC_PARA;
};
/***** End of Measure and VoltOut parameter *****/
/**** Limit Mode ****/
//LimitValue
void _SetLimitValue(struct Limit *self, uint32_t LimitValue){
self->_LimitValue = LimitValue;
}
uint32_t _GetLimitValue(struct Limit *self){
return self->_LimitValue;
}
/* VoltOut Mode Data */
typedef struct _VoltOutMode{
uint16_t _Vset;
}VoltOutMode;
VoltOutMode *InitVoltOutMode(){
VoltOutMode *ret = malloc(sizeof(VoltOutMode));
ret->_Vset = INSTRUCTION.VoltConstant;
return ret;
}
/* End of VoltOut Mode Data */
/* IT Mode Data */
typedef struct _ITMode{
MEASURE;
}ITMode;
ITMode * InitITMode(){
ITMode *ret = malloc(sizeof(ITMode));
ret->_measureCurrent = 0;
ret->_measureVin = 0;
ret->_measureVout = 0;
ret->_measureBat = 0;
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
return ret;
}
/* End of IT Mode Data */
/* VT Mode Data */
typedef struct _VTMode{
MEASURE;
}VTMode;
VTMode * InitVTMode(){
VTMode *ret = malloc(sizeof(VTMode));
ret->_measureCurrent = 0;
ret->_measureVin = 0;
ret->_measureVout = 0;
ret->_measureBat = 0;
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
return ret;
}
/* End of VT Mode Data */
/* RT Mode Data */
typedef struct _RTMode{
MEASURE;
int32_t _Vset;
}RTMode;
RTMode * InitRTMode(){
RTMode *ret = malloc(sizeof(RTMode));
ret->_measureCurrent = 0;
ret->_measureVin = 0;
ret->_measureVout = 0;
ret->_measureBat = 0;
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
ret->_Vset = INSTRUCTION.VoltConstant;
return ret;
}
/* End of RT Mode Data */
/* IV Mode Data */
typedef struct _IVMode{
MEASURE;
VOUT_PARA;
}IVMode;
IVMode *InitIVMode(){
IVMode *ret = malloc(sizeof(IVMode));
ret->_measureCurrent = 0;
ret->_measureVin = 0;
ret->_measureVout = 0;
ret->_measureBat = 0;
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
ret->_Vinit = (INSTRUCTION.Vinit - 25000) * 4 * 10000; //[5nV]
ret->_Vmax = (INSTRUCTION.Vmax - 25000) * 4 * 10000; //[5nV]
ret->_Vmin = (INSTRUCTION.Vmin - 25000) * 4 * 10000; //[5nV]
ret->_Vset = 0;
ret->_Vstep = 0;
ret->_direction_up = true;
ret->_current_direction_up = true;
ret->_cycleNumber = INSTRUCTION.cycleNumber;
return ret;
}
/* End of IV Mode Data */
/* CV Mode(CYCLE_IV)*/
typedef struct _CVMode{
MEASURE;
VOUT_PARA;
}CVMode;
CVMode * InitCVMode(){
CVMode *ret = malloc(sizeof(CVMode));
ret->_measureCurrent = 0;
ret->_measureVin = 0;
ret->_measureVout = 0;
ret->_measureBat = 0;
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
ret->_Vinit = (INSTRUCTION.Vinit - 25000) * 4 * 10000; //[5nV]
ret->_Vmax = (INSTRUCTION.Vmax - 25000) * 4 * 10000; //[5nV]
ret->_Vmin = (INSTRUCTION.Vmin - 25000) * 4 * 10000; //[5nV]
ret->_Vset = 0;
ret->_Vstep = 0;
ret->_direction_up = true;
ret->_current_direction_up = true;
ret->_cycleNumber = INSTRUCTION.cycleNumber;
return ret;
}
/*End of CV Mode*/
/* CC Mode(CONSTANT_CURRENT)*/
#define CC_ZERO_POINT 0
#define MAX_DAC_UC 50000
#define MIN_DAC_UC 0
/*********************************************************************
* @fn Transform2RealnA
*
* @brief transform an IUC into real current value in nA.
*
* @param self, which is an IUC
*
* @return an int32_t current value in nA
*/
int32_t _Transform2RealnA(struct CCModePara *self){
int32_t IUCReal;
// self->value : 0 ~ 1500000 (which is 0 ~ 1500000 (10nA) )
if(self->Charge){
IUCReal = (self->value - CC_ZERO_POINT) * 10;
}
else{
IUCReal = -1 * (self->value - CC_ZERO_POINT) * 10;
}
return IUCReal;
}
typedef struct _CCMode{
MEASURE;
int32_t _Vmax;
int32_t _Vmin;
int32_t _Vset;
int32_t _Iset;
uint8_t _charge;
int32_t (*_Transform2RealnA)(struct CCModePara *);
}CCMode;
CCMode * InitCCMode(){
CCMode *ret = malloc(sizeof(CCMode));
ret->_measureCurrent = 0;
ret->_measureVin = 0;
ret->_measureVout = 0;
ret->_measureBat = 0;
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
ret->_Vmax = (INSTRUCTION.Vmax - 25000) * 4 * 10000; //[5nV]
ret->_Vmin = (INSTRUCTION.Vmin - 25000) * 4 * 10000; //[5nV]
ret->_Vset = 0;
ret->_Iset = INSTRUCTION.constantCurrent * 200 ; //[50pA] //controller UI 15000uA => Elite 1500000 => 1500000 * 10 * 1000 / 50 [50pA]
ret->_charge = INSTRUCTION.charge;
ret->_Transform2RealnA = &_Transform2RealnA;
return ret;
}
/*End of CC Mode*/
/* CV3 Mode(CYCLIC_VOLTAMMETRY)*/
typedef struct _CV3Mode{
MEASURE;
VOUT_PARA;
}CV3Mode;
CV3Mode * InitCV3Mode(){
CV3Mode *ret = malloc(sizeof(CV3Mode));
ret->_measureCurrent = 0;
ret->_measureVin = 0;
ret->_measureVout = 0;
ret->_measureBat = 0;
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
ret->_Vinit = (INSTRUCTION.Vinit - 25000) * 4 * 10000; //[5nV]
ret->_Vmax = (INSTRUCTION.Vmax - 25000) * 4 * 10000; //[5nV]
ret->_Vmin = (INSTRUCTION.Vmin - 25000) * 4 * 10000; //[5nV]
ret->_Vset = 0;
ret->_Vstep = 0;
ret->_direction_up = true;
ret->_current_direction_up = true;
ret->_cycleNumber = INSTRUCTION.cycleNumber;
return ret;
}
/*End of CV3 Mode*/
/* LSV Mode(LINEAR_SWEEP_VOLTAMMETRY)*/
typedef struct _LSVMode{
MEASURE;
VOUT_PARA;
}LSVMode;
LSVMode * InitLSVMode(){
LSVMode *ret = malloc(sizeof(LSVMode));
ret->_measureCurrent = 0;
ret->_measureVin = 0;
ret->_measureVout = 0;
ret->_measureBat = 0;
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
ret->_Vinit = (INSTRUCTION.Vinit - 25000) * 4 * 10000; //[5nV]
ret->_Vmax = (INSTRUCTION.Vmax - 25000) * 4 * 10000; //[5nV]
ret->_Vmin = (INSTRUCTION.Vmin - 25000) * 4 * 10000; //[5nV]
ret->_Vset = 0;
ret->_Vstep = 0;
ret->_direction_up = true;
ret->_current_direction_up = true;
ret->_cycleNumber = INSTRUCTION.cycleNumber;
return ret;
}
/*End of LSV Mode*/
/* CONSTANT_VSCAN Mode(CONSTANT_VSCAN)*/
typedef struct _CVSCANMode{
MEASURE;
int32_t _Vinit;
int32_t _Vset;
}CVSCANMode;
CVSCANMode * InitCVSCANMode(){
CVSCANMode *ret = malloc(sizeof(CVSCANMode));
ret->_measureCurrent = 0;
ret->_measureVin = 0;
ret->_measureVout = 0;
ret->_measureBat = 0;
ret->_VoViSwitch = INSTRUCTION.VoViSwitch;
ret->_Vinit = (INSTRUCTION.Vinit - 25000) * 4 * 10000; //[5nV]
ret->_Vset = 0;
return ret;
}
/*End of CONSTANT_VSCAN Mode*/
/* Cycle CC Mode */
typedef struct _CCCMode{
int32_t _measureCurrent;
uint8_t _VoViSwitch;
uint8_t Charge;
int32_t BatteryV;
int32_t value;
uint16_t Done;
uint32_t VMax;
uint32_t VMin;
int32_t _measureVin;
int32_t Vset;
int32_t Iset;
int32_t (*_Transform2RealnA)(struct CCModePara *);
/* Vmax and Vmin */
// Vmax protect battery charge
// Vmin protect battery discharge, uint = mV
/* Charge/Discharge Current */
int32_t ChargeCurrent;
int32_t DischargeCurrent;
uint8_t CycleNumber;
bool StandBy;
uint32_t StandByTime;
}CCCMode;
CCCMode * InitCCCMode(){
CCCMode *ret = malloc(sizeof(CCCMode));
ret->_measureCurrent = 0;
ret->Charge = 1;
ret->BatteryV = 0;
ret->value = CC_ZERO_POINT;
ret->VMax = MAX_DAC_UC; // max DAC UserCode
ret->VMin = MIN_DAC_UC; // min DAC UserCode
ret->ChargeCurrent = 0;
ret->DischargeCurrent = 0;
ret->CycleNumber = 0;
ret->StandBy = false;
ret->StandByTime = 0;
ret->_Transform2RealnA = &_Transform2RealnA;
return ret;
}
/* End of Cycle CC Mode */
/** Potential State Mode **/
typedef struct _PS{
// measure
int32_t _measureCurrent;
uint8_t _VoViSwitch;
int32_t ReferenceVolt;
int32_t _MeasureVolt;
uint16_t _VoltOut;
uint16_t _originVolt;
uint16_t _stopVolt;
uint16_t _step;
uint16_t _StepTime;
uint16_t _cycleNumber;
}PSMode;
PSMode *InitPSMode(){
PSMode *ret = malloc(sizeof(PSMode));
ret->_measureCurrent = 0;
ret->ReferenceVolt = 0;
ret->_MeasureVolt = INSTRUCTION.Ve1;
ret->_VoltOut = DAC_ZERO; // 25000 is DAC_ZERO
ret->_originVolt = INSTRUCTION.Ve1;
ret->_stopVolt = INSTRUCTION.Ve2;
ret->_step = INSTRUCTION.step;
ret->_StepTime = INSTRUCTION.StepTime; // STEPTIME_ONE_SEC
ret->_cycleNumber = INSTRUCTION.cycleNumber;
return ret;
}
/** End of Potential State Mode **/
typedef union _WorkMode{
// Output Only
VoltOutMode *VO;
// Measure only
ITMode *IT;
VTMode *VT;
// Measure + Output
RTMode *RT;
IVMode *IV;
CVMode *CV;
CCMode *CC;
CV3Mode *CV3;
LSVMode *LSV;
CVSCANMode *CVSCAN;
PSMode *PS;
// CCCMode *CCC;
}WorkMode;
WorkMode *CreateWorkMode(){
WorkMode *ret = malloc(sizeof(WorkMode));
return ret;
}
void InitWorkMode(WorkMode *WM){
switch(INSTRUCTION.eliteFxn){
case VOLT_OUTPUT:
WM->VO = InitVoltOutMode();
break;
case IT_CURVE:
WM->IT = InitITMode();
break;
case VT_CURVE:
WM->VT = InitVTMode();
break;
case ZT_CURVE:
WM->RT = InitRTMode();
break;
case IV_CURVE:
WM->IV = InitIVMode();
break;
case CV_CURVE:
WM->CV = InitCVMode();
break;
case CONSTANT_CURRENT:
WM->CC = InitCCMode();
break;
case CYCLIC_VOLTAMMETRY:
WM->CV3 = InitCV3Mode();
break;
case LINEAR_SWEEP_VOLTAMMETRY:
WM->LSV = InitLSVMode();
break;
case CONSTANT_VSCAN:
WM->CVSCAN = InitCVSCANMode();
break;
// case CYCLE_CONSTANT_CURRENT:
// WM->CCC = InitCCCMode();
// break;
default:
WM->VT = InitVTMode();
break;
}
}
void FreeWorkMode(WorkMode *WM){
switch(INSTRUCTION.eliteFxn){
case VOLT_OUTPUT:
if(WM->VO != NULL){
free(WM->VO);
WM->VO = NULL;
}
break;
case IT_CURVE:
if(WM->IT != NULL){
free(WM->IT);
WM->IT = NULL;
}
break;
case VT_CURVE:
if(WM->VT != NULL){
free(WM->VT);
WM->VT = NULL;
}
break;
case ZT_CURVE:
if(WM->RT != NULL){
free(WM->RT);
WM->RT = NULL;
}
break;
case IV_CURVE:
if(WM->IV != NULL){
free(WM->IV);
WM->IV = NULL;
}
break;
case CV_CURVE:
if(WM->CV != NULL){
free(WM->CV);
WM->CV = NULL;
}
break;
case CONSTANT_CURRENT:
if(WM->CC != NULL){
free(WM->CC);
WM->CC = NULL;
}
break;
case CYCLIC_VOLTAMMETRY:
if(WM->CV3 != NULL){
free(WM->CV3);
WM->CV3 = NULL;
}
break;
case LINEAR_SWEEP_VOLTAMMETRY:
if(WM->LSV != NULL){
free(WM->LSV);
WM->LSV = NULL;
}
break;
case CONSTANT_VSCAN:
if(WM->CVSCAN != NULL){
free(WM->CVSCAN);
WM->CVSCAN = NULL;
}
break;
// case CYCLE_CONSTANT_CURRENT:
// if(WM->CCC != NULL){
// free(WM->CCC);
// WM->CCC = NULL;
// }
// break;
default:
if(WM->VT != NULL){
free(WM->VT);
WM->VT = NULL;
}
break;
}
}
#endif
@@ -2,182 +2,71 @@
#ifndef ELITEZT
#define ELITEZT
static void ZT_notify(int32_t impedance);
// output a certain voltage e.g. 2v
// and measure the input voltage
// => calculate the resister
// change the output voltage step
// => get a R-T curve (with resolution = 1 sample/volt step )
static void ZT_Plot() {
int32_t Real_Resister = 0;
static uint16_t CurrentMeasure=0, VoltMeasure=0;
uint8_t SPICurrent[SPI_ADC_SIZE]={0}, SPIVolt[SPI_ADC_SIZE]={0};
static uint8_t VoltCurrentSwitch = 0;
static void ZT_Plot(WorkMode *WorkModeData) {
switch (INSTRUCTION.eliteFxn) {
case IT_CURVE:{
#define CURRENT_MODE WorkModeData->IT
break;
}
case VT_CURVE:{
#define CURRENT_MODE WorkModeData->VT
break;
}
case ZT_CURVE:{
#define CURRENT_MODE WorkModeData->RT
break;
}
case IV_CURVE:{
#define CURRENT_MODE WorkModeData->IV
break;
}
case CV_CURVE:{
#define CURRENT_MODE WorkModeData->CV
break;
}
case CONSTANT_CURRENT:{
#define CURRENT_MODE WorkModeData->CC
break;
}
case CYCLIC_VOLTAMMETRY:{
#define CURRENT_MODE WorkModeData->CV3
break;
}
case LINEAR_SWEEP_VOLTAMMETRY:{
#define CURRENT_MODE WorkModeData->LSV
break;
}
case CONSTANT_VSCAN:{
#define CURRENT_MODE WorkModeData->CVSCAN
break;
}
default: {
break;
}
// set ADC GAIN
if(INSTRUCTION.ResisterMeter == RESISTER_METER_SMALL){
INSTRUCTION.ADCGainLevel = GAIN_200R;
}
else if(INSTRUCTION.ResisterMeter == RESISTER_METER_MIDDLE1){
INSTRUCTION.ADCGainLevel = GAIN_200R;
}
else if(INSTRUCTION.ResisterMeter == RESISTER_METER_MIDDLE2){
INSTRUCTION.ADCGainLevel = GAIN_10K;
}
else{
INSTRUCTION.ADCGainLevel = GAIN_200K;
}
ADCGainControl(INSTRUCTION.ADCGainLevel);
if(VoltCurrentSwitch < 9){
ADCChannelSelect(ADC_CH_CURRENT);
CPUdelay(10);
ADC_read(SPICurrent);
VoltCurrentSwitch ++;
}
else if(VoltCurrentSwitch == 9){
// read current
ADCChannelSelect(ADC_CH_CURRENT);
CPUdelay(10);
ADC_read(SPICurrent);
CurrentMeasure = (uint16_t) (SPICurrent[0] << 8) | (uint16_t) (SPICurrent[1]);
VoltCurrentSwitch ++;
}
else if(VoltCurrentSwitch <18){
// read volt
ADCChannelSelect(ADC_CH_VOLT);
CPUdelay(10);
ADC_read(SPIVolt);
VoltCurrentSwitch++;
}
else if(VoltCurrentSwitch == 18){
// read volt
ADCChannelSelect(ADC_CH_VOLT);
CPUdelay(10);
ADC_read(SPIVolt);
VoltMeasure = (uint16_t) (SPIVolt[0] << 8) | (uint16_t) (SPIVolt[1]);
VoltCurrentSwitch++;
}
else{
VoltCurrentSwitch = 0;
}
static uint8_t ADCSwitch = 0;
static uint8_t BatSwitch = 0;
static int32_t VoltData = 0;
if(batteryCheck_flag){
if(ADCSwitch == 0){
if(BatSwitch == 0){ /**read Iin(buffer),read bat**/
if(INSTRUCTION.AutoGainEnable){
CURRENT_MODE->_measureCurrent = AutoGainReadCurrent(spi_ADC_rxbuf);
AutoGainChange(CURRENT_MODE->_measureCurrent);
}else{
ReadCurrent(spi_ADC_rxbuf);
CURRENT_MODE->_measureCurrent = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent);
DACenable(WorkModeData, VoltData, AFTER_READ_I);
ReadBatVolt(spi_ADC_rxbuf);
BatSwitch++;
}else if(BatSwitch == 1){
ReadBatVolt(spi_ADC_rxbuf);
BatSwitch++;
}else if(BatSwitch == 2){
headstage_battery_volt();
ReadCurrent(spi_ADC_rxbuf);
batteryCheck_flag = false;
BatSwitch = 0;
ADCSwitch = 3;
}
}
else if(ADCSwitch == 1 || ADCSwitch == 3){
if(BatSwitch == 0){ /**read Bat**/
ReadBatVolt(spi_ADC_rxbuf);
BatSwitch++;
}else if(BatSwitch == 1){
ReadBatVolt(spi_ADC_rxbuf);
BatSwitch++;
}else if(BatSwitch == 2){
headstage_battery_volt();
ReadCurrent(spi_ADC_rxbuf);
batteryCheck_flag = false;
BatSwitch = 0;
ADCSwitch = 3;
}
}
else if(ADCSwitch == 2){
if(BatSwitch == 0){ /**read V(buffer),read bat**/
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
if(CURRENT_MODE->_VoViSwitch == 0x01){
CURRENT_MODE->_measureVin = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
VoltData = CURRENT_MODE->_measureVin;
}else if(CURRENT_MODE->_VoViSwitch == 0x00){
CURRENT_MODE->_measureVout = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_DAC, spi_ADC_rxbuf);
VoltData = CURRENT_MODE->_measureVout;
}
InputNotify(NOTIFY_VOLT, VoltData);
DACenable(WorkModeData, VoltData, AFTER_READ_V);
ReadBatVolt(spi_ADC_rxbuf);
BatSwitch++;
}else if(BatSwitch == 1){
ReadBatVolt(spi_ADC_rxbuf);
BatSwitch++;
}else if(BatSwitch == 2){
headstage_battery_volt();
ReadCurrent(spi_ADC_rxbuf);
batteryCheck_flag = false;
BatSwitch = 0;
ADCSwitch = 3;
}
}
}else{
BatSwitch = 0;
if(ADCSwitch == 0){ /**read Iin(buffer),read V**/
if(INSTRUCTION.AutoGainEnable){
CURRENT_MODE->_measureCurrent = AutoGainReadCurrent(spi_ADC_rxbuf);
AutoGainChange(CURRENT_MODE->_measureCurrent);
}else{
ReadCurrent(spi_ADC_rxbuf);
CURRENT_MODE->_measureCurrent = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
InputNotify(NOTIFY_CURRENT, CURRENT_MODE->_measureCurrent);
DACenable(WorkModeData, VoltData, AFTER_READ_I);
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
ADCSwitch++;
}
else if(ADCSwitch == 1){ /**read V**/
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
ADCSwitch++;
}
else if(ADCSwitch == 2){ /**read V(buffer),read Iin**/
ReadADCVolt(CURRENT_MODE->_VoViSwitch);
if(CURRENT_MODE->_VoViSwitch == 0x01){
CURRENT_MODE->_measureVin = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
VoltData = CURRENT_MODE->_measureVin;
}else if(CURRENT_MODE->_VoViSwitch == 0x00){
CURRENT_MODE->_measureVout = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_DAC, spi_ADC_rxbuf);
VoltData = CURRENT_MODE->_measureVout;
}
InputNotify(NOTIFY_VOLT, VoltData);
DACenable(WorkModeData, VoltData, AFTER_READ_V);
ReadCurrent(spi_ADC_rxbuf);
ADCSwitch++;
}
else if(ADCSwitch == 3){ /**read Iin**/
ReadCurrent(spi_ADC_rxbuf);
ADCSwitch = 0;
}
}
#undef CURRENT_MODE
// decode ADC value and put it into notify buffer
DecodeResister(INSTRUCTION.ADCGainLevel, CurrentMeasure, VoltMeasure);
// Real_Resister = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
static void ZT_Vscan(RTMode *RT){
if(vscanReset){
Vset = ((int32_t)(INSTRUCTION.VoltConstant) - 25000) * 4 * 10000; //[5nV]
OneWayVoltScan();
}
if(!vscanReset){
}
}
#endif
@@ -20,7 +20,7 @@
#define ADC_CS IOID_8
#define DAC_CS IOID_9
#define Turnon200R IOID_5
#define Turnon100R IOID_5
#define Turnon10K IOID_6
/* I2C */
@@ -45,7 +45,7 @@ const PIN_Config BLE_IO[] = {
enable_10v | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // 10V_enable
enable_5v | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // 5V_enable
shutdown_6994 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // turn off power
Turnon200R | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
Turnon100R | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
Turnon10K | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
switch_on | PIN_INPUT_EN | PIN_PULLDOWN,
@@ -1,61 +0,0 @@
/*
***********************************************************
Read battery's method
***********************************************************
1.ReadBatVolt(spi_ADC_rxbuf)
let "spi_ADC_rxbuf" be 8000
8000 * 187.5uV * 2 = 3V ;
2.AONBatMonBatteryVoltageGet()
let "AONBatMonBatteryVoltageGet()" be 768
768 * 125 / 320 / 100 = 3V ;
if you want to use first method, and get value 768
conversion: 8000 * 187.5 * 1e-6 * 2 / 125 * 320 * 100 = 768
=> 8000 * 12 / 125 = 768
*/
#ifndef HEADSTAGE_BATT_H
#define HEADSTAGE_BATT_H
#include <driverlib/aon_batmon.h>
#define MAX_BATTERY_CAPACITY 4200
static uint8_t headstage_battery_percent() {
static uint8_t battery_percent = 100;
uint8_t internal_battery_percent;
uint32_t internal_batt_sense = AONBatMonBatteryVoltageGet();
internal_batt_sense = (internal_batt_sense * 125) >> 5;
internal_batt_sense = (internal_batt_sense * 100) / MAX_BATTERY_CAPACITY;
internal_battery_percent = internal_batt_sense & 0xFF;
if (internal_battery_percent < battery_percent) battery_percent = internal_battery_percent;
return battery_percent;
}
static void headstage_battery_volt(){
uint32_t bat_volt = 0;
ReadBatVolt(spi_ADC_rxbuf);
bat_volt = (uint32_t) (spi_ADC_rxbuf[0] << 8) | (uint32_t) (spi_ADC_rxbuf[1]);
bat_volt = bat_volt * 12 / 125; //x * 187.5 * 1e-6 * 2 / 125 * 320 * 100 ;
InputNotify(NOTIFY_VOLT_BAT, bat_volt);
}
static void EliteADCBattery(){
static uint8_t ADCSwitch = 0;
if(ADCSwitch == 0){ /**read V**/
ReadBatVolt(spi_ADC_rxbuf);
ADCSwitch++;
}
else if(ADCSwitch == 1){ /**read V**/
ReadBatVolt(spi_ADC_rxbuf);
ADCSwitch++;
}
else if(ADCSwitch == 2){ /**read V(buffer)**/
headstage_battery_volt();
batteryCheck_flag = false;
ADCSwitch = 0;
}
}
#endif // HEADSTAGE_BATT_H
@@ -1,9 +0,0 @@
#ifndef HEADSTAGE_POWER_H
#define HEADSTAGE_POWER_H
#include <ti/drivers/Power.h>
#include <ti/drivers/power/PowerCC26XX.h>
#define headstage_power_shutdown() Power_shutdown(NULL, 0)
#endif // HEADSTAGE_POWER_H
@@ -1,15 +0,0 @@
#ifndef VERSION_DATE
#define VERSION_DATE
#define VERSION_DATE_YEAR 20
#define VERSION_DATE_MONTH 7
#define VERSION_DATE_DAY 17
#define VERSION_DATE_HOUR 10
#define VERSION_DATE_MINUTE 34
// this is NOT the version hash !!
// it's the last version hash
#define VERSION_HASH 8808490caa465cc94d14896de28763a5e5c4672b
#define VERSION_GIT_BRANCH Elite_OBJ_0.2mv
#endif
@@ -1,7 +1,7 @@
/*
* impedance_meter.h
*
* Created on: 2019/01/15
* Created on: 2019~115
* Author: benny
*/
#ifndef HEADSTAGE_H
@@ -19,10 +19,8 @@
// header
#include <ti/drivers/PIN.h>
#include "board.h"
#include "EliteWorkData.h"
#include <driverlib/aon_batmon.h>
static void SimpleBLEPeripheral_performPeriodicTask(WorkMode *WorkModeData);
static void SimpleBLEPeripheral_performPeriodicTask(CURRENT_USER_CODE *CurrentUserCode);
static void SimpleBLEPeripheral_clockHandler(UArg arg) {
// Store the event.
@@ -35,7 +33,6 @@ static void SimpleBLEPeripheral_clockHandler(UArg arg) {
static void elite_gptimer_callback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask) {
events |= SBP_PERIODIC_EVT;
Semaphore_post(semaphore);
GPT.GptimerCounter++;
}
@@ -54,7 +51,6 @@ static void ZM_init() {
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
InitEliteInstruction();
ADCGainControl(GAIN_AUTO);
elite_gptimer_open();
// PIN_registerIntCb(pin_handle, switch_on_callback);
@@ -74,35 +70,12 @@ static void DACCode2Real2Notify(uint16_t DACcode) {
NotifyVolt[3] = (uint8_t)(RealV & 0x000000FF);
}
#define IsPeriodicMode() ( \
(INSTRUCTION.eliteFxn == IV_CURVE) || \
(INSTRUCTION.eliteFxn == CV_CURVE) || \
(INSTRUCTION.eliteFxn == IT_CURVE) || \
(INSTRUCTION.eliteFxn == VT_CURVE) || \
(INSTRUCTION.eliteFxn == ZT_CURVE) || \
(INSTRUCTION.eliteFxn == CONSTANT_CURRENT) || \
(INSTRUCTION.eliteFxn == CYCLIC_VOLTAMMETRY) || \
(INSTRUCTION.eliteFxn == LINEAR_SWEEP_VOLTAMMETRY) || \
(INSTRUCTION.eliteFxn == CONSTANT_VSCAN) \
)
#define Ve1MatchVe2Mode() ( \
(INSTRUCTION.eliteFxn == IV_CURVE) || \
(INSTRUCTION.eliteFxn == CV_CURVE) || \
(INSTRUCTION.eliteFxn == CYCLIC_VOLTAMMETRY) || \
(INSTRUCTION.eliteFxn == LINEAR_SWEEP_VOLTAMMETRY) \
)
#define SendLastDataMode() ( \
(INSTRUCTION.eliteFxn == IV_CURVE) || \
(INSTRUCTION.eliteFxn == CV_CURVE) || \
(INSTRUCTION.eliteFxn == IT_CURVE) || \
(INSTRUCTION.eliteFxn == VT_CURVE) || \
(INSTRUCTION.eliteFxn == ZT_CURVE) || \
(INSTRUCTION.eliteFxn == CONSTANT_CURRENT) || \
(INSTRUCTION.eliteFxn == CYCLIC_VOLTAMMETRY) || \
(INSTRUCTION.eliteFxn == LINEAR_SWEEP_VOLTAMMETRY) || \
(INSTRUCTION.eliteFxn == CONSTANT_VSCAN) \
#define IsPeriodicMode() ( \
(INSTRUCTION.eliteFxn == IV_CURVE) || \
(INSTRUCTION.eliteFxn == IT_CURVE) || \
(INSTRUCTION.eliteFxn == VT_CURVE) || \
(INSTRUCTION.eliteFxn == ZT_CURVE) || \
(INSTRUCTION.eliteFxn == CONSTANT_CURRENT) \
)
/*********************************************************************
@@ -114,249 +87,141 @@ static void DACCode2Real2Notify(uint16_t DACcode) {
*
* @return None.
*/
static void SimpleBLEPeripheral_performPeriodicTask(WorkMode *WorkModeData) {
static void SimpleBLEPeripheral_performPeriodicTask(CURRENT_USER_CODE *CurrentUserCode) {
if ( IsPeriodicMode() ){
// XXX Using nwe clock => StepTime/SampleRate should change
if (StepTimeCounter == INSTRUCTION.StepTime){
StepTimeCounter = 1;
}
else{
StepTimeCounter++;
}
if (SampleRate_counter == INSTRUCTION.SampleRate){
SampleRate_counter = 1;
}
else{
SampleRate_counter++;
}
/** Periodic Event **/
// Default working flow is vscan -> ADC read -> send notify
// We will need a flag to control vscan, ADC and notify
// Default working mode is DAC out -> ADC read -> send notify
// We will need a flag to control DAC, if we want to exchange to ADC -> DAC -> notify
// This flag can be named by FxnNameReset
GPT.DeltaGptimerCounter = GPT.GptimerCounter - GPT.GptimerCounter0;
GPT.GptimerCounter0 = GPT.GptimerCounter;
// In IV, CV, and func-gen mode, DAC will output voltage
// else DAC do nothing.
EliteDACControl();
if(EliteWorkReset){
InitEliteGPtimer();
EliteWorkReset = false;
batteryADC_flag = false;
if( Ve1MatchVe2Mode() ){
if (INSTRUCTION.Ve1 == INSTRUCTION.Ve2) {
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.Ve1));
PeriodicEvent = false;
}
}
}
// Control ADC to sample rate
EliteADCControl(CurrentUserCode);
GPT.LeadTimeCounter = GPT.LeadTimeCounter + GPT.DeltaGptimerCounter;
if(leadTimeReset && GPT.LeadTimeCounter <= 2000){
vscanReset = true;
}else{
if(notifyFirst_flag){
GPT.NotifyCounter = INSTRUCTION.notifyRate - 20;
notifyFirst_flag = false;
}
vscanReset = false;
leadTimeReset = false;
}
//vscan counter
GPT.VscanRateCounter = GPT.VscanRateCounter + GPT.DeltaGptimerCounter;
if(GPT.VscanRateCounter >= INSTRUCTION.VsetRate){
GPT.VscanRateCounter -= INSTRUCTION.VsetRate; //To get right time
vscan_flag = true;
if(vscan_flag){
EliteVscanControl(WorkModeData);
vscan_flag = false;
}
}
//battery counter
GPT.BatteryADCCounter = GPT.BatteryADCCounter + GPT.DeltaGptimerCounter;
GPT.BatteryCheckCounter = GPT.BatteryCheckCounter + GPT.DeltaGptimerCounter;
if(GPT.BatteryCheckCounter >= 50000){
GPT.BatteryCheckCounter -= 50000; //To get right time
batteryCheck_flag = true;
}
uint16_t bat = ((uint16_t)(NotifyVoltBat[2]) << 8 & 0xFF00 ) | ((uint16_t)(NotifyVoltBat[3]) & 0x00FF);
if( bat < 768 && bat > 20){
PIN_setOutputValue(pin_handle, enable_5v, 0);
}
//ADC counter
GPT.SampleRateCounter = GPT.SampleRateCounter + GPT.DeltaGptimerCounter;
if(GPT.SampleRateCounter >= INSTRUCTION.sampleRate){
GPT.SampleRateCounter = 0; //To get right data, ADC must be delay 1.5ms
ADC_flag = true;
if(ADC_flag){
EliteADCControl(WorkModeData);
ADC_flag = false;
}
}
//Notify counter(Notify control, check if we need to send notify)
//please don't put Notify counter before ADC counter, maybe get wrong data
GPT.NotifyCounter = GPT.NotifyCounter + GPT.DeltaGptimerCounter;
if(GPT.NotifyCounter >= INSTRUCTION.notifyRate){
GPT.NotifyCounter -= INSTRUCTION.notifyRate; //To get right time
notify_flag = true;
if(vscanReset){
notify_flag = false;
}
if(notify_flag){
SendNotify();
notify_flag = false;
}
}
EliteDone();
}else if(INSTRUCTION.eliteFxn == VOLT_OUTPUT){
WorkModeData->VO->_Vset = INSTRUCTION.VoltConstant;
DAC_outputV(Usercode_Correction_to_DAC(WorkModeData->VO->_Vset)); //UserCode -> DAC code -> DAC out
FreeWorkMode(WorkModeData);
PeriodicEvent = false;
}else{
InitFlag();
// Notify control, check if we need to send notify
EliteNotifyControl();
}
}
static void EliteADCControl(WorkMode *WorkModeData) {
switch (INSTRUCTION.eliteFxn) {
case IV_CURVE:{
ZT_Plot(WorkModeData);
break;
static void EliteDACControl(CURRENT_USER_CODE *CurrentUserCode) {
if (INSTRUCTION.eliteFxn == IV_CURVE) {
// output a certain voltage and put it into NotifyVolt
DACCode2Real2Notify(VoltScan());
}
else if (INSTRUCTION.eliteFxn == ZT_CURVE){
if(INSTRUCTION.ResisterMeter == RESISTER_METER_SMALL){
// output 5mV
INSTRUCTION.VoltConstant = 24999 + 50;
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
}
case CV_CURVE:{
ZT_Plot(WorkModeData);
break;
else{
// output 100mV
INSTRUCTION.VoltConstant = 24999 + 500;
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
}
case IT_CURVE:{
IT_Plot(WorkModeData);
break;
}
case VT_CURVE:{
VT_Plot(WorkModeData);
break;
}
case ZT_CURVE:{
ZT_Plot(WorkModeData);
break;
}
case CONSTANT_CURRENT:{
CC_Plot(WorkModeData);
break;
}
case CYCLIC_VOLTAMMETRY:{
CC_Plot(WorkModeData);
break;
}
case LINEAR_SWEEP_VOLTAMMETRY:{
CC_Plot(WorkModeData);
break;
}
case CONSTANT_VSCAN:{
CC_Plot(WorkModeData);
break;
}
default:{
break;
}
else if(INSTRUCTION.eliteFxn == CONSTANT_CURRENT){
CCModeVoltOut(CurrentUserCode);
// DAC_outputV(Usercode_Correction_to_DAC(CurrentUserCode->value));
}
else{
// IT, VT need only ADC measure
return;
}
}
static void EliteADCControl(CURRENT_USER_CODE *CurrentUserCode) {
if (SampleRate_counter == INSTRUCTION.SampleRate) {
switch (INSTRUCTION.eliteFxn) {
case IV_CURVE:{
IT_Plot();
break;
}
case IT_CURVE:{
IT_Plot();
break;
}
case VT_CURVE:{
// read volt through ADC and put it into notify buffer
VT_Plot();
break;
}
case ZT_CURVE:{
ZT_Plot();
break;
}
case CONSTANT_CURRENT:{
CCModeReadCurrent(CurrentUserCode);
break;
}
default:{
break;
}
}
}
}
static void EliteDone() {
if ((INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE) || (INSTRUCTION.eliteFxn == CYCLIC_VOLTAMMETRY)) {
static void EliteNotifyControl() {
if ((INSTRUCTION.eliteFxn == IV_CURVE)) {
// output the last notify, and reset Elite
if (!PeriodicEvent) {
SendNotify();
reset();
} else if (StepTimeCounter == INSTRUCTION.StepTime - 1) {
SendNotify();
}
}
else if (SampleRate_counter == INSTRUCTION.SampleRate) {
SendNotify();
}
}
static void EliteVscanControl(WorkMode *WorkModeData) {
switch (INSTRUCTION.eliteFxn) {
case IV_CURVE:{
IV_Vscan(WorkModeData->IV);
break;
}
case CV_CURVE:{
CV_Vscan(WorkModeData->CV);
break;
}
case ZT_CURVE:{
ZT_Vscan(WorkModeData->RT);
break;
}
case CYCLIC_VOLTAMMETRY:{
CV3_Vscan(WorkModeData->CV3);
break;
}
case CONSTANT_CURRENT:{
CC_Vscan(WorkModeData->CC);
break;
}
case LINEAR_SWEEP_VOLTAMMETRY:{
LSV_Vscan(WorkModeData->LSV);
break;
}
case CONSTANT_VSCAN:{
CVSCAN_Vscan(WorkModeData->CVSCAN);
break;
}
default:{
break;
}
}
static uint16_t StepCode2DACcode(uint16_t StepCode){
return (StepCode * 0x0005);
}
static uint32_t OldStep2NewStepTime(uint32_t StepTime){
static uint16_t OldStep2NewStepTime(uint8_t StepTime) {
uint8_t StepTimeLevel = 0;
StepTimeLevel = StepTime / 0x12;
switch (StepTimeLevel) {
case 0: { //0.5 sec
return STEPTIME_HALF_SEC;
}
case 1: { //1 sec
return STEPTIME_ONE_SEC;
}
case 2: { //2 sec
return STEPTIME_TWO_SEC;
}
default: { //1 sec
return STEPTIME_ONE_SEC;
}
case 0: { //0.5 sec
LED_color(LIGHTLED, 0xFF, 0xFF, 0xFF);
return STEPTIME_HALF_SEC;
}
case 1: { //1 sec
return STEPTIME_ONE_SEC;
}
case 2: { //2 sec
return STEPTIME_TWO_SEC;
}
default: { //1 sec
return STEPTIME_ONE_SEC;
}
}
}
static void step2VsetRate(uint32_t step){
/*step = 100 mv, index = 0, n = 2
10 mv, index = 1, n = 10
1 mv, index = 2, n = 100
0.1 mv, index = 3, n = 1000
0.01mv, index = 4, n = 10000 */
if(step >= 10000){
INSTRUCTION.VsetRateIndex = 0;
}else if (step >= 1000){
INSTRUCTION.VsetRateIndex = 1;
}else if (step >= 100){
INSTRUCTION.VsetRateIndex = 2;
}else if (step >= 10){
INSTRUCTION.VsetRateIndex = 3;
}else if (step >= 1){
INSTRUCTION.VsetRateIndex = 4;
}
}
static void InitFlag(){
PeriodicEvent = false; // is there an PeriodicEvent?
Free_Work_Mode = true; // Free(WorkModeData)
}
static void InitEliteGPtimer() {
GPT.SampleRateCounter = INSTRUCTION.sampleRate - 10;
GPT.VscanRateCounter = INSTRUCTION.VsetRate - 1;
notifyFirst_flag = true;
}
static void InitEliteFlag() {
InitPeriodicEvent = true; // need to create a WorkModeData?
DACReset = true;
vscanReset = true;
EliteWorkReset = true;
leadTimeReset = true;
GAIN_200R_counter = 0;
GAIN_200K_counter = 0;
GAIN_10K_counter = 0;
}
#endif /* IMPEDANCE_METER_H_ */
@@ -127,11 +127,11 @@
#ifndef FEATURE_OAD
// Minimum connection interval (units of 1.25ms, 80=100ms) if automatic
// parameter update request is enabled
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 8
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 6
// Maximum connection interval (units of 1.25ms, 800=1000ms) if automatic
// parameter update request is enabled
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 30
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 6
#else //! FEATURE_OAD
// Minimum connection interval (units of 1.25ms, 8=10ms) if automatic
// parameter update request is enabled
@@ -529,7 +529,7 @@ static void SimpleBLEPeripheral_init(void) {
}
#include "EliteWorkData.h"
/*********************************************************************
* @fn SimpleBLEPeripheral_taskFxn
*
@@ -544,27 +544,24 @@ static void SimpleBLEPeripheral_init(void) {
static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
#define CLOCK_ONE_SECOND 10000
// Initialize application
SimpleBLEPeripheral_init();
headstage_init_device_info();
ZM_init();
Elite_SPI_init();
WorkMode *WorkModeData = CreateWorkMode();
CURRENT_USER_CODE *CurrentUserCode = InitCurrentUserCode();
uint8_t key = 0;
uint8_t key = 0;
uint16_t counter6994 = 0;
bool EliteOn = 0;
bool EliteOn = 0;
// init DAC, set output ~= 0 V
DAC_outputV(Usercode_Correction_to_DAC(25000));
DAC_outputV(Usercode_Correction_to_DAC(24999));
elite_gptimer_start();
// Application main loops
GPT.GptimerCounter0 = GPT.GptimerCounter;
batteryADC_flag = false;
headstage_battery_volt();
headstage_init_device_info();
for (;;) {
// Waits for a signal to the semaphore associated with the calling thread.
// Note that the semaphore associated with a thread is signaled when a
@@ -614,69 +611,46 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
}
if(events & SBP_PERIODIC_EVT){
events &= ~SBP_PERIODIC_EVT;
if (!PeriodicEvent) { // if there is no periodic event
if (!PeriodicEvent) { // if there is no periodic event
key = PIN_getInputValue(switch_on);
if (EliteOn) {
if (counter6994 < CLOCK_ONE_SECOND/2) { // counter6994 enable a IC after 35 counts
counter6994++;
} else if (counter6994 == CLOCK_ONE_SECOND/2) {
PIN_setOutputValue(pin_handle, shutdown_6994, 1); // OFF = 1 => turn off 6994
// #ifdef ELITE_VERSION_1_4
// SPI_close(spiHandle0);
// I2Cinit();
// I2C_close(I2Chandle);
// spiHandle0 = SPI_open(Board_SPI0, &spiParams0); // LED SPI
// #endif
counter6994++;
}
EliteKeyPress(key);
if(key != 0){ //detect Elite battery power when no periodic event
GPT.DeltaGptimerCounter = GPT.GptimerCounter - GPT.GptimerCounter0;
GPT.GptimerCounter0 = GPT.GptimerCounter;
GPT.BatteryADCCounter = GPT.BatteryADCCounter + GPT.DeltaGptimerCounter;
GPT.BatteryCheckCounter = GPT.BatteryCheckCounter + GPT.DeltaGptimerCounter;
if(GPT.BatteryCheckCounter >= 50000){//5min=3000000, 5s=50000
GPT.BatteryCheckCounter = 0;
batteryCheck_flag = true;
}
if(GPT.BatteryADCCounter >= 15 && batteryCheck_flag){
GPT.BatteryADCCounter = 0; //To get the data right, ADC must be delay 1.5ms
batteryADC_flag = true;
if(batteryADC_flag){
EliteADCBattery();
batteryADC_flag = false;
}
}
uint16_t bat = ((uint16_t)(NotifyVoltBat[2]) << 8 & 0xFF00 ) |
((uint16_t)(NotifyVoltBat[3]) & 0x00FF);
if( bat < 768 && bat > 20){
PIN_setOutputValue(pin_handle, enable_5v, 0);
}
}
if(Free_Work_Mode){
FreeWorkMode(WorkModeData);
InitEliteInstruction();
ADCGainControl(INSTRUCTION.ADCGainLevel);
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
Free_Work_Mode = false;
}
} else {
EliteOn = TurnOnElite(key);
}
}
else { // if there is periodic event
if(InitPeriodicEvent){
InitWorkMode(WorkModeData);
InitPeriodicEvent = false;
}
// if there is periodic event
else {
// Perform periodic application task
SimpleBLEPeripheral_performPeriodicTask(WorkModeData);
SimpleBLEPeripheral_performPeriodicTask(CurrentUserCode);
key = PIN_getInputValue(switch_on);
EliteKeyPress(key); // onPress=> key = 0; 1.lighten LED 2.long press shut down 2650
}
}
// if (events & SBP_PERIODIC_EVT)
// {
// events &= ~SBP_PERIODIC_EVT;
// Util_startClock(&periodicClock);
// Perform periodic application task
// SimpleBLEPeripheral_performPeriodicTask();
// }
// headstage_gptimer_main_handle();
#ifdef FEATURE_OAD
while (!Queue_empty(hOadQ)) {
oadTargetWrite_t *oadWriteEvt = Queue_get(hOadQ);
@@ -950,18 +924,6 @@ static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState)
numActive = linkDB_NumActive();
uint16_t cxnHandle;
// requestedPDUSize = LL payload = L2CAP_header + ATT header + BLE_NOT_BUFF_SIZE = 7 + BLE_NOT_BUFF_SIZE //roy
uint16_t requestedPDUSize = 251; //251 roy
uint16_t requestTxTime = 2120; // (LL payload + 14) * 8 //2120 roy
GAPRole_GetParameter(GAPROLE_CONNHANDLE, &cxnHandle);
if (SUCCESS == HCI_LE_SetDataLenCmd(cxnHandle, requestedPDUSize, requestTxTime)) {
// LED_color(DARKLED, 0xFF, 0x00, 0xFF);
}
// Use numActive to determine the connection handle of the last
// connection
if (linkDB_GetInfo(numActive - 1, &linkInfo) == SUCCESS) {
@@ -85,7 +85,7 @@ extern "C"
// Length of Characteristic 5 in bytes
#define SIMPLEPROFILE_CHAR5_LEN 5
#define SIMPLEPROFILE_CHAR4_LEN 200
#define SIMPLEPROFILE_CHAR4_LEN 20
#define SIMPLEPROFILE_CHAR3_LEN 20
#define SIMPLEPROFILE_CHAR2_LEN 20
-91
View File
@@ -1,91 +0,0 @@
#!/bin/bash
#input="./Elite_test.txt"
input="D:/Elite/Calibration_data/$1.txt"
output="./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteDeviceCorrection.h"
#variable
declare -i current_line=79
declare -i col_index=0
declare -i row_index=0
#declare -i coeff=1
#declare -i offset=0
declare -i current_gain=0
#declare -i vin_gain=0
#declare -i vout_gain=0
MAC="MAC"
#constant
declare -i ADC_CURRENT_GAIN_NUMBER=3
declare -i ADC_VOLTAGE_GAIN_NUMBER=1
declare -i DAC_GAIN_NUMBER=1
while read -r line; do
for word in $line; do
# get device MAC
if [ $row_index -eq 0 ] && [ $col_index -eq 1 ];then
MAC=$word
sed -i "${current_line} i {" "$output"
sed -i "${current_line} i \\\n#ifdef BOARD_${MAC}" "$output"
sed -i 's/:/_/g' "$output"
current_line=$current_line+3
fi
#get ADC current cali data
declare -i Iin_range=2+$ADC_CURRENT_GAIN_NUMBER
if [ $row_index -gt 1 ] && [ $row_index -lt $Iin_range ];then
if [ $col_index -eq 1 ];then
sed -i "${current_line} i \\\t.ADC_current[${current_gain}].coeff = ($word)," "$output"
current_line=$current_line+1
elif [ $col_index -eq 2 ];then
sed -i "${current_line} i \\\t.ADC_current[${current_gain}].offset = ($word)," "$output"
current_line=$current_line+1
if [ $current_gain -lt 2 ];then
current_gain=$current_gain+1
else
current_gain=0
fi
fi
#get DAC Vout cali data
declare -i Vout_range=$Iin_range+$DAC_GAIN_NUMBER
elif [ $row_index -gt 1 ] && [ $row_index -lt $Vout_range ];then
if [ $col_index -eq 1 ];then
sed -i "${current_line} i \\\t.Usercode2DAC.coeff = ($word)," "$output"
current_line=$current_line+1
elif [ $col_index -eq 2 ];then
sed -i "${current_line} i \\\t.Usercode2DAC.offset = ($word)," "$output"
current_line=$current_line+1
fi
#get ADC Vin cali data
declare -i Vin_range=$Vout_range+$ADC_VOLTAGE_GAIN_NUMBER
elif [ $row_index -gt 1 ] && [ $row_index -lt $Vin_range ];then
if [ $col_index -eq 1 ];then
sed -i "${current_line} i \\\t.ADC_volt.coeff = ($word)," "$output"
current_line=$current_line+1
elif [ $col_index -eq 2 ];then
sed -i "${current_line} i \\\t.ADC_volt.offset = ($word)," "$output"
current_line=$current_line+1
fi
fi
#update index
if [ $col_index -lt 2 ];then
col_index=$col_index+1
else
col_index=0
row_index=$row_index+1
fi
done
done < $input
sed -i "${current_line} i };" "$output"
current_line=$current_line+1
sed -i "${current_line} i #endif" "$output"