Compare commits

...

141 Commits

Author SHA1 Message Date
Benny Liu c706b0119b elite shift gear working.
change settings to test.
2020-05-04 12:20:35 +08:00
Benny Liu 0f9ce0e22b add spi_close, elite shift gear working. 2020-04-28 18:05:57 +08:00
Benny Liu c6b46c600e add_elite_pin(), remove_elite_pin() not working. 2020-04-20 14:58:52 +08:00
Benny Liu 77da097582 Add shifting 2020-04-06 18:19:21 +08:00
Benny Liu 260bf54d61 Latch working. 2020-03-30 17:33:05 +08:00
Benny Liu 252f3d9d06 No No... 2020-03-23 18:24:25 +08:00
Benny Liu 5e4dad9027 LED cannot work 2020-03-16 18:33:13 +08:00
Benny Liu cfc596c32b LED cannot work 2020-03-09 17:23:13 +08:00
Benny Liu 0c4de74be8 No error, fucking great!!! 2020-02-27 18:37:43 +08:00
Benny Liu 4983bbd596 latch function finished? 2020-02-27 17:18:08 +08:00
Benny Liu 7f82ced132 add latch 2020-02-26 18:08:07 +08:00
Benny Liu 9a1f409e08 power supply test 2020-01-21 17:40:29 +08:00
Benny Liu 4e01c27e8e calibration data of board_C5F3 2020-01-13 17:30:38 +08:00
Benny Liu a71e456e81 calibration data of various boards 2020-01-13 16:40:01 +08:00
royluo df1c1f9f7e CV mode cyclenumber debug with Vin 2020-01-06 17:44:22 +08:00
royluo 06584e7d1c change ADC level 2019-12-31 10:56:11 +08:00
royluo 5ea5b16d89 add Bat() 2019-12-31 10:54:27 +08:00
Benny Liu 10e2d12bc2 calibration data of various boards 2019-12-25 16:55:49 +08:00
Benny Liu 857388b204 change to Vin 2019-12-25 15:41:05 +08:00
royluo 78d788cab2 IV and CV mode with Vout version 2019-12-20 12:13:22 +08:00
royluo 02185083f5 Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-12-20 12:06:34 +08:00
royluo aeca114c5f IV and CV mode with Vin version
(add ReadVout)
2019-12-20 12:04:59 +08:00
Benny Liu 7b4f2b5828 update BOARD_KUMA & BOARD_MINO calibration data. 2019-12-20 12:04:16 +08:00
YiChin 7b075f40a3 BOARD_KUMA & BOARD_MINO calibration data 2019-12-19 15:55:00 +08:00
yichin 6c68c67f0e annotation test CVcurve use led 2019-12-19 12:50:43 +08:00
Benny Liu fd9f0ef321 upload BOARD_BIGBROTHER calibration data 2019-12-17 19:01:30 +08:00
yichin cb44628316 Fucking Benny use my branch to calibrate 2019-12-17 16:23:07 +08:00
weiting2 63fd8cf1df flush notify buffer, cycle number should be 0x00, not 0xFF 2019-12-13 14:57:30 +08:00
Benny Liu cc39131466 don't care 2019-12-13 14:23:34 +08:00
Benny Liu e71e064846 Merge branch 'Elite_OBJ_Version' of https://gitlab.com/bioproscientific/bioprocc2650 into Elite_OBJ_Version 2019-12-13 11:22:34 +08:00
Benny Liu 1356a8c8af calibration usage 2019-12-13 11:22:16 +08:00
weiting2 d9b6340f23 reset ADC gain and DAC when press "Stop" button 2019-12-12 12:26:38 +08:00
weiting2 2709baf8e8 flush notify buffer after stop 2019-12-11 15:59:30 +08:00
weiting2 046fae3617 flush notify buffer before start 2019-12-11 15:58:59 +08:00
YiChin 688868fb48 flush notify buffer before start 2019-12-11 14:29:26 +08:00
weiting2 5967b6ebc6 Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-12-11 13:22:41 +08:00
weiting2 d9e9a2102e flush timestamp register before start PeriodicEvent 2019-12-11 13:22:26 +08:00
105042004 065517a7cc test CV curve 2019-12-06 18:09:13 +08:00
105042004 0691725819 test CV curve 2019-12-06 17:34:04 +08:00
105042004 5954a965dc test CVcurve use led 2019-12-06 16:28:59 +08:00
105042004 788aca30ef test CV curve 2019-12-06 16:01:01 +08:00
weiting2 bda30b15b5 Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-12-06 10:25:37 +08:00
weiting2 32523d6f88 fix ADC level 2019-12-06 10:25:20 +08:00
Benny Liu 300707871e Merge branch 'Elite_OBJ_Version' of https://gitlab.com/bioproscientific/bioprocc2650 into Elite_OBJ_Version 2019-12-03 15:35:17 +08:00
Benny Liu b21bdf57be calibration data for board KELLY 2019-12-03 15:35:08 +08:00
105042004 3067a5eafe CV test 2019-11-29 19:06:29 +08:00
105042004 ec4e48725c CV test 2019-11-29 18:54:16 +08:00
105042004 8322623699 test CV 2019-11-29 18:34:32 +08:00
105042004 c588d4d377 test CV curve 2019-11-29 18:21:40 +08:00
105042004 9e23b67e03 CV curve add VinVout switch 2019-11-29 17:40:37 +08:00
weiting2 0d4f77d25a add comment for CC mode 2019-11-28 19:09:51 +08:00
YiChin 0a16b06c78 11/28 NCKU version
[IV] return Vin
[CC] after reach Vmax/min, Iset = 0
2019-11-28 11:10:26 +08:00
weiting2 c6b6ff420d [CC] after Vin reach Vmax/min, Vout=VMax 2019-11-27 21:38:48 +08:00
YiChin 221c301739 CC Mode should add a DONE flag 2019-11-27 21:33:09 +08:00
weiting2 5355e584a3 fix CC stop condition 2019-11-27 19:19:25 +08:00
weiting2 9fa2c0eb1a fixup! This is a stable version. 11/28 sell to NCKU with CC mode IV mode return Vin 2019-11-27 19:12:44 +08:00
weiting2 03a1e5a633 fixup! This is a stable version. 11/28 sell to NCKU with CC mode IV mode return Vin 2019-11-27 18:58:27 +08:00
weiting2 968150e9b7 fixup! This is a stable version. 11/28 sell to NCKU with CC mode IV mode return Vin 2019-11-27 18:53:33 +08:00
weiting2 ef7484569d Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-11-27 17:25:43 +08:00
weiting2 9cc483da5a This is a stable version.
11/28 sell to NCKU with CC mode
IV mode return Vin
2019-11-27 17:22:54 +08:00
weiting2 eb9609da00 [CC] use INS.VoltLimit store CC mode limit volt 2019-11-27 17:20:35 +08:00
weiting2 ea5c79cd77 [CC] use INS.VoltLimit store CC mode limit volt 2019-11-27 17:02:54 +08:00
weiting2 4d4a0f5ce3 [CC] use INS.VoltLimit store CC mode limit volt 2019-11-27 16:39:15 +08:00
weiting2 cbeef5d00b [CC] use INS.VoltLimit store CC mode limit volt 2019-11-27 16:21:59 +08:00
weiting2 433e9d27ec [CC] use INS.VoltLimit store CC mode limit volt 2019-11-27 16:14:26 +08:00
weiting2 1e039a988a [CC] what's wrong 2019-11-27 15:48:05 +08:00
weiting2 393051bfec [IV] default output Volt is Vin instead of Vout 2019-11-27 14:03:47 +08:00
weiting2 d0b51aef7a Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-11-27 12:47:02 +08:00
YiChin c5e6739632 Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-11-27 12:45:57 +08:00
YiChin b91fdc6d3f delete neu 2019-11-27 12:45:25 +08:00
weiting2 d62b879a17 Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-11-27 12:42:27 +08:00
weiting2 31306ee2a9 [IV] default output Volt is Vin instead of Vout 2019-11-27 10:32:50 +08:00
Benny Liu 0346e37e50 calibration data of various boards 2019-11-26 18:52:14 +08:00
weiting2 f004c60964 [IV] default output Volt is Vin instead of Vout 2019-11-26 15:55:41 +08:00
YiChin 61c7827d93 Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-11-22 17:52:20 +08:00
105042004 4fcb7594d7 test 2019-11-22 17:51:45 +08:00
YiChin 4d71181d78 Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-11-22 17:43:35 +08:00
105042004 ed5e6d82fb test IV 2019-11-22 17:43:09 +08:00
YiChin efc23e1393 Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-11-22 17:35:33 +08:00
105042004 d8ce4418ae test realV 2019-11-22 17:26:30 +08:00
YiChin fc5cebe638 Merge branch 'Elite_OBJ_Version' of C:\ti with conflicts. 2019-11-22 17:22:32 +08:00
105042004 fb7811559b test IV curve 2019-11-22 17:01:23 +08:00
YiChin a2e7049aa6 test IV Vinout 2019-11-22 16:55:09 +08:00
105042004 f9e6fa7ad0 IV curve add Vin Vout select 2019-11-22 13:02:34 +08:00
Benny Liu e89dbd2f5c calibration data 2019-11-20 18:39:20 +08:00
Benny Liu 0b59913870 calibration data 2019-11-19 18:35:14 +08:00
YiChin d2e11c947a [RT] fix Vout value 2019-11-19 15:28:19 +08:00
weiting2 8c6968ec05 [CC] using new IUC 2019-11-18 16:28:23 +08:00
weiting2 b864235e5c Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-11-18 15:08:44 +08:00
YiChin bd15523916 Every thing well done 2019-11-18 15:08:09 +08:00
YiChin 2f61a9ce99 [CV] auto gain solved 2019-11-18 14:40:10 +08:00
YiChin ed2edccbc1 [CV] auto gain not solve yet 2019-11-18 14:28:11 +08:00
weiting2 59dc27dfda [CV] Try AutoGain 2019-11-18 14:21:30 +08:00
YiChin 1f1b20f92f steptime = 0.5sec bug fix 2019-11-18 14:12:52 +08:00
weiting2 9a511e0fc1 [CV] Try AutoGain 2019-11-18 12:02:53 +08:00
YiChin dff4082ea9 [CV] try to fix auto 2019-11-18 11:36:33 +08:00
YiChin a4e62ac39e [IV] Auto gain work 2019-11-18 11:11:23 +08:00
YiChin e119cfceb8 [IV] Auto gain work 2019-11-18 10:55:03 +08:00
YiChin 308d1c6ef3 Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version
# Conflicts:
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteIVCurve.h
2019-11-18 09:53:17 +08:00
weiting2 89cd606529 [IV] Try AutoGain 2019-11-18 09:50:03 +08:00
YiChin 0ed0c08878 [IV] AutoGain would block reading volt, WHY 2019-11-16 12:31:13 +08:00
weiting2 f1a3c290e9 Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-11-16 10:32:54 +08:00
weiting2 47af16a2e2 [IV] Try AutoGain 2019-11-16 10:32:35 +08:00
105042004 3f885decac add measurevolt for PS 2019-11-15 14:10:26 +08:00
weiting2 fb58112ba7 [IV] three-wire stable version 2019-11-14 18:25:21 +08:00
weiting2 9928f5281f [IV] read Vin origin data 2019-11-14 18:02:19 +08:00
weiting2 cf2944f651 [IV] read Vin origin data 2019-11-14 17:16:51 +08:00
weiting2 5cfdec63e2 [IV] read Vin origin data 2019-11-14 16:53:35 +08:00
weiting2 5defc984c2 [IV] read Vin origin data 2019-11-14 16:44:52 +08:00
weiting2 a0f7eff938 [IV] read Vin origin data 2019-11-14 16:19:44 +08:00
weiting2 31a2dd0891 [IV] read Vin origin data 2019-11-14 16:14:47 +08:00
YiChin 67b9a5be85 [IV] notify no data whyyyyyy 2019-11-14 16:12:14 +08:00
weiting2 837bd99e86 [IV] read Vin origin data 2019-11-14 15:59:20 +08:00
YiChin 507386a231 error fix 2019-11-14 15:54:14 +08:00
YiChin 11b155070d add wood/dirt star 2019-11-14 15:47:47 +08:00
YiChin 91a9a315e4 Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version
# Conflicts:
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteITCurve.h
2019-11-14 15:46:46 +08:00
weiting2 85e2f6cf9d [IV] try to report Vin 2019-11-14 15:45:07 +08:00
YiChin f3301069ef [IV] todo : fix auto gain 2019-11-14 13:47:33 +08:00
YiChin 7c1f558687 [IV] todo : fix auto gain 2019-11-14 12:58:14 +08:00
weiting2 448a81bdf7 [IV] try to solve auto gain 2019-11-14 11:53:20 +08:00
YiChin 2712a2fa73 error fix 2019-11-14 10:26:41 +08:00
weiting2 8151053d08 [IV] Vo = Vo - I*100R 2019-11-14 10:13:56 +08:00
weiting2 5e8f0af363 [CC] delete old code
[CCC] add CCC mode
2019-11-13 13:22:49 +08:00
YiChin 006d1c26b3 stable version fix Iin error 2019-11-13 11:38:33 +08:00
YiChin 46f080e642 stable version VERY NICE 2019-11-13 11:25:35 +08:00
YiChin 6088b102f8 stable version CC mode must autogain 2019-11-12 20:55:06 +08:00
YiChin 7a59623930 CC mode GAIN_10K work fine? 2019-11-11 17:53:02 +08:00
weiting2 4789a32fd4 [CC] Do not use auto gain in CC mode 2019-11-11 17:23:44 +08:00
weiting2 4b6bea5f41 test ADC gain instruction 2019-11-11 16:25:00 +08:00
weiting2 da2b97dcf1 NotifyReady not done
TODO: Vmax, Vmin in CC
2019-11-11 14:18:39 +08:00
YiChin 6aee724a7c NotifyReady flag can not work?! 2019-11-11 13:57:45 +08:00
weiting2 f1765d957c comment some useless function 2019-11-11 13:44:30 +08:00
YiChin 19e760f9cc NotifyReady flag can not work?! 2019-11-11 13:31:55 +08:00
weiting2 04c7e8d640 [headstage] add NotifyReady flag 2019-11-11 12:39:21 +08:00
weiting2 813ef50bf5 [headstage] add NotifyReady flag 2019-11-11 11:32:04 +08:00
YiChin 8bc43f1bb0 [CC] This is a stable version 2019-11-11 11:06:55 +08:00
weiting2 50acc23eb1 [CC mode] read Vin 2019-11-11 10:52:21 +08:00
YiChin a26bad68a6 [CC] everything well, return Vin works ^^ 2019-11-11 10:46:13 +08:00
weiting2 f5796e8ac5 [CC mode] read Vin 2019-11-11 10:26:13 +08:00
YiChin c862e6790f [CC] everything well, NEED RETURN VIN 2019-11-08 17:38:55 +08:00
YiChin fb43ec6ac3 [CC] Vin + V_(Iin-GND) = battery V 2019-11-08 16:09:09 +08:00
38 changed files with 2367 additions and 777 deletions
@@ -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>
@@ -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.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">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.387558095" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.937216340">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.281169844" 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.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">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.2039965704" 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.1903277145" 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.149660968" 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.289504931" 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.1502722911" 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.2080861677" 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.937535249" 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.1088642974" 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.171996990" 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.609555771" 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.394031010" 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.1330623088" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.625929411" 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.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">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.622361603" 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.390302855" 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.2050482239" 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.1364894214" 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.1399241416" 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.822683146" 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.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">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.1624671949" 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.592612441" 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.179162634" 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.1498208441" 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.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"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.250212368" 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.1375917091" 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.706927310" 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.276549457" 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.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">
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.937216340" 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.1691972566" 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.1078705642" 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.1249113889" 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.1768184374" 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.2049179859" 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.650613345" 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.980701920" 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.782343525" 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.783856815" 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.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"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.984075892" 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.669072727" 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.1024317334" 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.1828842189" 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.787190393" 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.548957088" 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.1267836979" 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.1197025444" 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.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 id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.1181725596" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.952035816" 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.86615841" 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.876565414" 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.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">
<tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.377787212" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.433008019" 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.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"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.1864761673" 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.435933837" 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.519249000" 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.457203420" 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.150643934" 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.1168082181" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS" value="&quot;${COMPILER_FLAGS}&quot;" valueType="string"/>
</tool>
</toolChain>
</folderInfo>
@@ -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">
@@ -16,7 +16,7 @@
# sources were generated) is:
# C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\config\src
#
GEN_SRC_DIR ?= ../../../../../ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/config/src
GEN_SRC_DIR ?= ../../config/src
ifeq (,$(wildcard $(GEN_SRC_DIR)))
$(error "ERROR: GEN_SRC_DIR must be set to the directory containing the generated sources")
@@ -1,12 +1,12 @@
XOPTS = -I"C:/ti/xdctools_3_32_00_06_core/packages/" -Dxdc_target_types__=C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/std.h -Dxdc_target_name__=M3
XOPTS = -I"C:/ti/xdctools_3_32_02_25_core/packages/" -Dxdc_target_types__=C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/std.h -Dxdc_target_name__=M3
vpath % C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/sysbios/
vpath %.c C:/ti/xdctools_3_32_00_06_core/packages/
vpath %.c C:/ti/xdctools_3_32_02_25_core/packages/
CCOPTS = --endian=little -mv7M3 --abi=eabi -q -ms --opt_for_speed=0 --program_level_compile -o3 -g --optimize_with_debug -Dti_sysbios_knl_Task_minimizeLatency__D=FALSE -Dti_sysbios_family_arm_cc26xx_Boot_driverlibVersion=2 -Dti_sysbios_knl_Clock_stopCheckNext__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_enableException__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_disablePriority__D=32U -Dti_sysbios_family_arm_m3_Hwi_numSparseInterrupts__D=0U
XDC_ROOT = C:/ti/xdctools_3_32_00_06_core/packages/
XDC_ROOT = C:/ti/xdctools_3_32_02_25_core/packages/
BIOS_ROOT = C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/sysbios/
@@ -16,14 +16,14 @@ BIOS_INC = -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/pa
TARGET_INC = -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/"
INCS = $(BIOS_INC) $(TARGET_INC) --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/icall/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/dev_info" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/common/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/heapmgr" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/controller/cc26xx/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/target" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/sdata" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/saddr" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/icall/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/rom" --include_path="C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272" -IC:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/
INCS = $(BIOS_INC) $(TARGET_INC) --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/icall/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/dev_info" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/common/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/heapmgr" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/controller/cc26xx/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/target" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/sdata" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/saddr" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/icall/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/rom" --include_path="C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272" -IC:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/
CC = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include
ASM = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include
AR = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/bin/armar rq
CC = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include
ASM = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include
AR = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/bin/armar rq
DEL = C:/ti/xdctools_3_32_00_06_core/packages/../bin/rm -f
CP = C:/ti/xdctools_3_32_00_06_core/packages/../bin/cp -f
DEL = C:/ti/xdctools_3_32_02_25_core/packages/../bin/rm -f
CP = C:/ti/xdctools_3_32_02_25_core/packages/../bin/cp -f
define RM
$(if $(wildcard $1),$(DEL) $1,:)
@@ -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.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">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.471422180" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.250601795">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1066752268" 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.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">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.591066117" 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.465978664" 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.1782436453" 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.812292407" 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.945830577" 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.629358648" 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.1190507826" 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.524534756" 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.922960520" 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.589280788" 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.627953259" 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.986125825" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.1479162610" 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.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">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.966215934" 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.1382031353" 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.73314177" 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.868796990" 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.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">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.2040185664" 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.381236121" 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.297855297" 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.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"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.1192288700" 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.1950914604" 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.761772919" 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.1403518814" 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.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">
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.250601795" 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.374772131" 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.1611239669" 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.1125944230" 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.1404460040" 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.707716591" 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.1707930214" 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.1465861606" 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.59164041" 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.2034053100" 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.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"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1351216935" 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.1920338944" 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.1799638407" 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.1388274122" 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.834696293" 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.1344940250" 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.1230012247" 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.270149070" 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.1784299431" 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.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 id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.1645242169" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.1390940545" 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.1983435198" 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.1140498271" 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,6 +12,7 @@
<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>
@@ -0,0 +1,210 @@
#ifndef Elite15_PIN
#define Elite_15PIN
#include "Elite_PIN.h"
static void update_latch_status (uint32_t latch_num, uint32_t elite_pin, bool highlow) {
switch (latch_num) {
case LOAD0: {
switch (elite_pin) {
case D0: {
LH.LATCH0[0] = highlow;
break;
}
case D1: {
LH.LATCH0[1] = highlow;
break;
}
case D2: {
LH.LATCH0[2] = highlow;
break;
}
case D3: {
LH.LATCH0[3] = highlow;
break;
}
case D4: {
LH.LATCH0[4] = highlow;
break;
}
case D5: {
LH.LATCH0[5] = highlow;
break;
}
case D6: {
LH.LATCH0[6] = highlow;
break;
}
case D7: {
LH.LATCH0[7] = highlow;
break;
}
default: {
break;
}
}
break;
}
case LOAD1: {
switch (elite_pin) {
case D0: {
LH.LATCH1[0] = highlow;
break;
}
case D1: {
LH.LATCH1[1] = highlow;
break;
}
case D2: {
LH.LATCH1[2] = highlow;
break;
}
case D3: {
LH.LATCH1[3] = highlow;
break;
}
case D4: {
LH.LATCH1[4] = highlow;
break;
}
case D5: {
LH.LATCH1[5] = highlow;
break;
}
case D6: {
LH.LATCH1[6] = highlow;
break;
}
case D7: {
LH.LATCH1[7] = highlow;
break;
}
default: {
break;
}
}
break;
}
case LOAD2: {
switch (elite_pin) {
case D0: {
LH.LATCH2[0] = highlow;
break;
}
case D1: {
LH.LATCH2[1] = highlow;
break;
}
case D2: {
LH.LATCH2[2] = highlow;
break;
}
case D3: {
LH.LATCH2[3] = highlow;
break;
}
case D4: {
LH.LATCH2[4] = highlow;
break;
}
case D5: {
LH.LATCH2[5] = highlow;
break;
}
case D6: {
LH.LATCH2[6] = highlow;
break;
}
case D7: {
LH.LATCH2[7] = highlow;
break;
}
default: {
break;
}
}
break;
}
default: {
break;
}
}
}
static void PIN15_setOutputValue (uint32_t latch_num, uint32_t pin_num, bool highlow) {
add_elite_pin();
update_latch_status (latch_num, pin_num, highlow);
PIN_setOutputValue(&ZM_rst, latch_num, 1); // Turn on latch
CPUdelay(10);
switch (latch_num) {
case LOAD0: {
// PIN_setOutputValue(&ZM_rst, D0, LH.LATCH0[0]);
// PIN_setOutputValue(&ZM_rst, D1, LH.LATCH0[1]);
// PIN_setOutputValue(&ZM_rst, D2, LH.LATCH0[2]);
// PIN_setOutputValue(&ZM_rst, D3, LH.LATCH0[3]);
PIN_setOutputValue(pin_handle, D4, LH.LATCH0[4]);
PIN_setOutputValue(pin_handle, D5, LH.LATCH0[5]);
PIN_setOutputValue(pin_handle, D6, LH.LATCH0[6]);
PIN_setOutputValue(pin_handle, D7, LH.LATCH0[7]);
break;
}
case LOAD1: {
PIN_setOutputValue(pin_handle, D0, LH.LATCH1[0]);
PIN_setOutputValue(pin_handle, D1, LH.LATCH1[1]);
PIN_setOutputValue(pin_handle, D2, LH.LATCH1[2]);
PIN_setOutputValue(pin_handle, D3, LH.LATCH1[3]);
PIN_setOutputValue(pin_handle, D4, LH.LATCH1[4]);
PIN_setOutputValue(pin_handle, D5, LH.LATCH1[5]);
PIN_setOutputValue(pin_handle, D6, LH.LATCH1[6]);
PIN_setOutputValue(pin_handle, D7, LH.LATCH1[7]);
break;
}
case LOAD2: {
PIN_setOutputValue(pin_handle, D0, LH.LATCH2[0]);
PIN_setOutputValue(pin_handle, D1, LH.LATCH2[1]);
PIN_setOutputValue(pin_handle, D2, LH.LATCH2[2]);
PIN_setOutputValue(pin_handle, D3, LH.LATCH2[3]);
PIN_setOutputValue(pin_handle, D4, LH.LATCH2[4]);
PIN_setOutputValue(pin_handle, D5, LH.LATCH2[5]);
PIN_setOutputValue(pin_handle, D6, LH.LATCH2[6]);
PIN_setOutputValue(pin_handle, D7, LH.LATCH2[7]);
break;
}
default: {
break;
}
}
CPUdelay(10);
PIN_setOutputValue(&ZM_rst, latch_num, 0); // Turn off latch
remove_elite_pin();
}
static void Init_Elite15_PIN () {
InitLH();
add_elite_pin();
PIN_setOutputValue(pin_handle, LOAD0, 1);
PIN_setOutputValue(pin_handle, LOAD1, 1);
PIN_setOutputValue(pin_handle, LOAD2, 1);
CPUdelay(10);
PIN_setOutputValue(pin_handle, D0, 0);
PIN_setOutputValue(pin_handle, D1, 0);
PIN_setOutputValue(pin_handle, D2, 0);
PIN_setOutputValue(pin_handle, D3, 0);
PIN_setOutputValue(pin_handle, D4, 0);
PIN_setOutputValue(pin_handle, D5, 0);
PIN_setOutputValue(pin_handle, D6, 0);
PIN_setOutputValue(pin_handle, D7, 0);
CPUdelay(10);
PIN_setOutputValue(pin_handle, LOAD0, 0);
PIN_setOutputValue(pin_handle, LOAD1, 0);
PIN_setOutputValue(pin_handle, LOAD2, 0);
remove_elite_pin();
}
#endif
@@ -62,32 +62,71 @@ static void ADC_read(uint8_t *ADCdata){
static void ADCGainControl(uint8_t ADCLevel){
if(ADCLevel == 0){
// ADC gain level = 0, using 200R resister
PIN_setOutputValue(pin_handle, Turnon10K, 0);
PIN_setOutputValue(pin_handle, Turnon100R, 0);
// ADC gain level = 0, using 3M resister
PIN15_setOutputValue(Turnon_I_LARGE, 0);
PIN15_setOutputValue(Turnon_I_MID, 0);
PIN15_setOutputValue(Turnon_I_SMALL, 0);
}
else if(ADCLevel == 1){
// ADC gain level = 1, using 10K resister
PIN_setOutputValue(pin_handle, Turnon10K, 1);
PIN_setOutputValue(pin_handle, Turnon100R, 0);
// ADC gain level = 1, using 100K resister
PIN15_setOutputValue(Turnon_I_LARGE, 0);
PIN15_setOutputValue(Turnon_I_MID, 0);
PIN15_setOutputValue(Turnon_I_SMALL, 1);
}
else if(ADCLevel == 2){
// ADC gain level = 2, using 100R resister
PIN_setOutputValue(pin_handle, Turnon10K, 0);
PIN_setOutputValue(pin_handle, Turnon100R, 1);
// ADC gain level = 2, using 3K resister
PIN15_setOutputValue(Turnon_I_LARGE, 0);
PIN15_setOutputValue(Turnon_I_SMALL, 0);
PIN15_setOutputValue(Turnon_I_MID, 1);
}
else if(ADCLevel == 3){
// ADC gain level = 0, auto gain (using 200R resister)
PIN_setOutputValue(pin_handle, Turnon10K, 0);
PIN_setOutputValue(pin_handle, Turnon100R, 0);
// ADC gain level = 3, using 100R resistor
PIN15_setOutputValue(Turnon_I_LARGE, 1);
PIN15_setOutputValue(Turnon_I_MID, 0);
PIN15_setOutputValue(Turnon_I_SMALL, 0);
}
else if(ADCLevel == 4){
// ADC gain level = 3, auto gain (using 100R resister)
PIN15_setOutputValue(Turnon_I_LARGE, 1);
PIN15_setOutputValue(Turnon_I_MID, 0);
PIN15_setOutputValue(Turnon_I_SMALL, 0);
}
else{
// default using 200R resister
PIN_setOutputValue(pin_handle, Turnon10K, 0);
PIN_setOutputValue(pin_handle, Turnon100R, 0);
// default using 100R resister
PIN15_setOutputValue(Turnon_I_LARGE, 1);
PIN15_setOutputValue(Turnon_I_MID, 0);
PIN15_setOutputValue(Turnon_I_SMALL, 0);
}
}
static void VinADCGainControl(uint8_t VinADCLevel){
if(VinADCLevel == 0){
// Vin ADC gain level = 0, using 1M resister
PIN15_setOutputValue(Turnon_V_SMALL, 0);
PIN15_setOutputValue(Turnon_V_MID, 0);
}
else if(VinADCLevel == 1){
// Vin ADC gain level = 1, using 30K resister
PIN15_setOutputValue(Turnon_V_SMALL, 0);
PIN15_setOutputValue(Turnon_V_MID, 1);
LED_color(DARKLED, 0x00, 0x00, 0x00);
}
else if(VinADCLevel == 2){
// Vin ADC gain level = 2, using 1K resister
PIN15_setOutputValue(Turnon_V_SMALL, 1);
PIN15_setOutputValue(Turnon_V_MID, 0);
}
else if(VinADCLevel == 3){
// Vin ADC gain level = 3, auto gain (using 1K resister)
PIN15_setOutputValue(Turnon_V_SMALL, 1);
PIN15_setOutputValue(Turnon_V_MID, 0);
}
else{
// default using 1K resister
PIN15_setOutputValue(Turnon_V_SMALL, 1);
PIN15_setOutputValue(Turnon_V_MID, 0);
}
}
static void ADCChannelSelect(uint8_t ADCChannel){
// set ADC parameter
@@ -128,6 +167,7 @@ static void ADCChannelSelect(uint8_t ADCChannel){
static void ReadVolt(uint8_t *buf){
// Read data twice since the first data we get is previous data
VinADCGainControl(INSTRUCTION.VinADCGainLevel);
ADCChannelSelect(ADC_CH_VOLT);
CPUdelay(10);
ADC_read(buf);
@@ -137,6 +177,17 @@ static void ReadVolt(uint8_t *buf){
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);
CPUdelay(10);
ADC_read(buf);
ADCChannelSelect(ADC_CH_DAC);
CPUdelay(10);
ADC_read(buf);
}
static void ReadCurrent(uint8_t *buf){
// Read data twice since the first data we get is previous data
ADCGainControl(INSTRUCTION.ADCGainLevel);
@@ -149,29 +200,77 @@ static void ReadCurrent(uint8_t *buf){
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);
CPUdelay(10);
ADC_read(buf);
ADCChannelSelect(ADC_CH_BAT);
CPUdelay(10);
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
static int32_t AutoGainReadCurrent(uint8_t *buf){
int32_t Real_Current = 0;
if(INSTRUCTION.ADCGainLevel == GAIN_AUTO){
INSTRUCTION.ADCGainLevel = GAIN_200R;
// LED_color(DARKLED, 0x00, 0x00, 0xFF);
if(INSTRUCTION.ADCGainLevel == I_GAIN_AUTO){
INSTRUCTION.ADCGainLevel = I_GAIN_100R;
}
if(INSTRUCTION.ADCGainLevel == GAIN_200R){
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
if(INSTRUCTION.ADCGainLevel == I_GAIN_100R){
uint8_t CurrentCount1 = 0;
while(CurrentCount1 < 5){
ReadCurrent(spi_ADC_rxbuf);
CurrentCount1++;
if(CurrentCount1 == 5){
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
break;
}
}
// switch to mid range current
if(Real_Current < GAIN_LARGE_BOUNDARY && Real_Current > -1*GAIN_LARGE_BOUNDARY){
INSTRUCTION.ADCGainLevel = GAIN_10K;
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
uint8_t CurrentCount = 0;
// switch to small range current
if (Real_Current < GAIN_MID_BOUNDARY1 && Real_Current > -1*GAIN_MID_BOUNDARY1){
INSTRUCTION.ADCGainLevel = I_GAIN_3M;
while(CurrentCount < 5){
ReadCurrent(spi_ADC_rxbuf);
CurrentCount++;
if(CurrentCount == 5){
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
break;
}
}
}else{
CurrentCount = 0;
INSTRUCTION.ADCGainLevel = I_GAIN_100K;
while(CurrentCount < 5){
ReadCurrent(spi_ADC_rxbuf);
CurrentCount++;
if(CurrentCount == 5){
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
break;
}
}
}
// LED_color(DARKLED, 0x00, 0xFF, 0x00);
// // switch to small range current
@@ -183,36 +282,91 @@ static int32_t AutoGainReadCurrent(uint8_t *buf){
// }
}
}
else if(INSTRUCTION.ADCGainLevel == GAIN_10K){
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
else if(INSTRUCTION.ADCGainLevel == I_GAIN_100K){
uint8_t CurrentCount1 = 0;
while(CurrentCount1 < 3){
ReadCurrent(spi_ADC_rxbuf);
CurrentCount1++;
if(CurrentCount1 == 3){
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
break;
}
}
// switch to large range current
if(Real_Current > GAIN_MID_BOUNDARY2 || Real_Current < -1*GAIN_MID_BOUNDARY2){
INSTRUCTION.ADCGainLevel = GAIN_200R;
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
// LED_color(DARKLED, 0x00, 0x00, 0xFF);
uint8_t CurrentCount = 0;
INSTRUCTION.ADCGainLevel = I_GAIN_100R;
while(CurrentCount < 3){
ReadCurrent(spi_ADC_rxbuf);
CurrentCount++;
if(CurrentCount == 3){
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
break;
}
}
}
// switch to small range current
else if (Real_Current < GAIN_MID_BOUNDARY1 && Real_Current > -1*GAIN_MID_BOUNDARY1){
INSTRUCTION.ADCGainLevel = GAIN_200K;
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
// LED_color(DARKLED, 0xFF, 0x00, 0x00);
uint8_t CurrentCount = 0;
INSTRUCTION.ADCGainLevel = I_GAIN_3M;
while(CurrentCount < 3){
ReadCurrent(spi_ADC_rxbuf);
CurrentCount++;
if(CurrentCount == 3){
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
break;
}
}
}
}
else if(INSTRUCTION.ADCGainLevel == GAIN_200K){
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
else if(INSTRUCTION.ADCGainLevel == I_GAIN_3M){
uint8_t CurrentCount1 = 0;
while(CurrentCount1 < 5){
ReadCurrent(spi_ADC_rxbuf);
CurrentCount1++;
if(CurrentCount1 == 5){
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
break;
}
}
//Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
// switch to mid range current
if(Real_Current > GAIN_SMALL_BOUNDARY || Real_Current < -1*GAIN_SMALL_BOUNDARY){
INSTRUCTION.ADCGainLevel = GAIN_10K;
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
// LED_color(DARKLED, 0x00, 0xFF, 0x00);
uint8_t CurrentCount = 0;
// switch to large range current
if(Real_Current > GAIN_MID_BOUNDARY2 || Real_Current < -1*GAIN_MID_BOUNDARY2){
INSTRUCTION.ADCGainLevel = I_GAIN_100R;
while(CurrentCount < 5){
ReadCurrent(spi_ADC_rxbuf);
CurrentCount++;
if(CurrentCount == 5){
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
break;
}
}
}else{
CurrentCount = 0;
INSTRUCTION.ADCGainLevel = I_GAIN_100K;
while(CurrentCount < 5){
ReadCurrent(spi_ADC_rxbuf);
CurrentCount++;
if(CurrentCount == 5){
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
break;
}
}
}
// switch to large range current
// if(Real_Current > GAIN_MID_BOUNDARY2 || Real_Current < -1*GAIN_MID_BOUNDARY2){
// INSTRUCTION.ADCGainLevel = GAIN_200R;
@@ -0,0 +1,32 @@
#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,20 +2,23 @@
#ifndef ELITECCMODE
#define ELITECCMODE
static void CCModeDACControl(int32_t IUC_Measure_Difference);
static void CCModeDACControl(CCMode *CC, int32_t IUC_Measure_Difference);
static int32_t CCModeReadCurrent(CCMode *CC){
static bool IVSwitch = false;
static uint8_t VoltCurrentSwitch = 0;
CCModeDACEnable = 1; // This flag will control DAC working
// set current value and ADC gain level
CCCurrent2IUC(CC);
// decode ADC value and put it into notify buffer
if(IVSwitch){
IVSwitch = false;
// Use 5-th measure value as real-measure value
// because some value in the begin are garbage
if(VoltCurrentSwitch < 5){
ReadCurrent(spi_ADC_rxbuf);
VoltCurrentSwitch ++;
}
else if(VoltCurrentSwitch == 5){
// read current
if(INSTRUCTION.AutoGainEnable){
CC->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
}
@@ -23,79 +26,74 @@ static int32_t CCModeReadCurrent(CCMode *CC){
ReadCurrent(spi_ADC_rxbuf);
CC->_MeasureData = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
VoltCurrentSwitch ++;
}
else if(VoltCurrentSwitch <10){
// read volt
ReadVolt(spi_ADC_rxbuf);
VoltCurrentSwitch++;
}
else if(VoltCurrentSwitch == 10){
/** read battery voltage **/
ReadVolt(spi_ADC_rxbuf);
CC->BatteryV = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
// if Iin have a offset if current !=0
CC->BatteryV = CC->BatteryV - (CC->value - CC_ZERO_POINT)*10/1e5; // I_set * 10R = V_Iin2GND (mA * ohm)
VoltCurrentSwitch++;
// NotifyReady = true;
}
else{
IVSwitch = true;
/** read battery voltage **/
// read ADC volt
ReadVolt(spi_ADC_rxbuf);
// decode ADC value and put it into notify buffer
CC->BatteryV = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
VoltCurrentSwitch = 0;
}
NotifyCurrent[0] = (uint8_t) (CC->_MeasureData >> 24);
NotifyCurrent[1] = (uint8_t) ((CC->_MeasureData & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((CC->_MeasureData & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (CC->_MeasureData & 0x000000FF);
NotifyVolt[0] = (uint8_t) (CC->BatteryV >> 24);
NotifyVolt[1] = (uint8_t) ((CC->BatteryV & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((CC->BatteryV & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (CC->BatteryV & 0x000000FF);
return CC->_MeasureData;
}
static int32_t CCModeVoltOut(CCMode *CC){
int32_t MeasureCurrent = 0, IUCCurrent = 0, ADCRealVolt = 0;
int32_t IUCCurrent = 0;
if(!CCModeDACEnable){
// DAC should not work now
return 0;
}
IUCCurrent = CC->_Transform2RealnA( (struct CCModePara *) CC);
IUCCurrent = CC->_Transform2RealnA(CC);
MeasureCurrent = CC->_MeasureData;
CCModeDACControl(IUCCurrent - MeasureCurrent);
// NotifyCurrent[0] = (uint8_t) (IUCCurrent >> 24);
// NotifyCurrent[1] = (uint8_t) ((IUCCurrent & 0x00FF0000) >> 16);
// NotifyCurrent[2] = (uint8_t) ((IUCCurrent & 0x0000FF00) >> 8);
// NotifyCurrent[3] = (uint8_t) (IUCCurrent & 0x000000FF);
//
// NotifyImpedance[0] = (uint8_t) (MeasureCurrent >> 24);
// NotifyImpedance[1] = (uint8_t) ((MeasureCurrent & 0x00FF0000) >> 16);
// NotifyImpedance[2] = (uint8_t) ((MeasureCurrent & 0x0000FF00) >> 8);
// NotifyImpedance[3] = (uint8_t) (MeasureCurrent & 0x000000FF);
// DACCode2Real2Notify(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
// if(IUCCurrent > 1000){
// ADCRealVolt = 2*(INSTRUCTION.VoltConstant - 25000)/10 - IUCCurrent*200/1e6;
// }
// else{
// ADCRealVolt = 2*(INSTRUCTION.VoltConstant - 25000)/10 - IUCCurrent*200/1e7;
// }
CCModeDACControl(CC, IUCCurrent - CC->_MeasureData);
CCModeDACEnable = 0;
return MeasureCurrent;
return CC->_MeasureData;
}
static void CCModeDACControl(int32_t IUC_Measure_Difference){
static void CCModeDACControl(CCMode *CC, int32_t IUC_Measure_Difference){
int32_t step;
if(IUC_Measure_Difference < 100 && IUC_Measure_Difference > -100){
if(IUC_Measure_Difference < 300 && IUC_Measure_Difference > -300){
step = 0;
}
else if( CC->Charge && CC->BatteryV >= ( (int32_t) (CC->VMax - DAC_ZERO)/5 ) ){
CC->value = 0;
step = (IUC_Measure_Difference > 0) ? 1:-1;
}
else if(IUC_Measure_Difference < 1000 && IUC_Measure_Difference > -1000){
step = IUC_Measure_Difference / 100;
}
else if(IUC_Measure_Difference < 10000 && IUC_Measure_Difference > -10000){
step = IUC_Measure_Difference / 1000;
else if( (!CC->Charge) && CC->BatteryV <= ( (int32_t) (CC->VMin - DAC_ZERO)/5 ) ){
// Ignore VMin condition
if(CC->Done < 25000){
CC->Done ++;
step = (IUC_Measure_Difference > 0) ? 2:-2;
}
// after ignore few second, active VMin condition
else{
CC->value = 0;
step = (IUC_Measure_Difference > 0) ? 1:-1;
}
}
else{
step = IUC_Measure_Difference / 1e4;
step = (IUC_Measure_Difference > 0) ? 1:-1;
}
// over/under flow
if( (INSTRUCTION.VoltConstant + step) > MAX_DAC_UC || (INSTRUCTION.VoltConstant + step) < MIN_DAC_UC ){
if(step > 0){
@@ -108,36 +106,14 @@ static void CCModeDACControl(int32_t IUC_Measure_Difference){
else{
INSTRUCTION.VoltConstant = INSTRUCTION.VoltConstant + step;
}
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
// NotifyCurrent[0] = (uint8_t) ( step >> 24);
// NotifyCurrent[1] = (uint8_t) (( step & 0x00FF0000) >> 16);
// NotifyCurrent[2] = (uint8_t) (( step & 0x0000FF00) >> 8);
// NotifyCurrent[3] = (uint8_t) ( step & 0x000000FF);
}
// XXX : should we reset DAC output after STOP?
static void CCModeReverseCurrent(CCMode *CC){
if(CC->StandBy){
if(CT.StandByCounter == CC->StandByTime){
CC->StandBy = false;
CT.StandByCounter = 0;
}
else{
CT.StandByCounter ++;
}
}
else{
// reverse charge/discharge
if(CC->BatteryV == CC->VMax){
CC->StandBy = true;
CC->value = CC->DischargeCurrent;
}
else if(CC->BatteryV == CC->VMin){
CC->StandBy = true;
CC->value = CC->ChargeCurrent;
}
}
// step = CC->Done;
// NotifyImpedance[0] = (uint8_t) (step >> 24);
// NotifyImpedance[1] = (uint8_t) ((step & 0x00FF0000) >> 16);
// NotifyImpedance[2] = (uint8_t) ((step & 0x0000FF00) >> 8);
// NotifyImpedance[3] = (uint8_t) (step & 0x000000FF);
}
/* Transform setting CC into IUC
@@ -151,58 +127,6 @@ static void CCCurrent2IUC(CCMode *CC){
CC->value = INSTRUCTION.ConstantCurrent;
CurrentValue = CC->value - CC_ZERO_POINT;
/* set ADC level */
// largest current
if (CurrentValue > 10000 || CurrentValue < -10000){
CC->lv = GAIN_200R;
}
// mid range current
else if (CurrentValue > 1000 || CurrentValue < -1000){
CC->lv = GAIN_10K;
}
// least range current
else{
CC->lv = GAIN_200K;
}
}
/*********************************************************************
* @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(CCMode *self){
// int32_t IUCReal;
//
// // self->value : 0 ~ 3000000 (which is -1500000 ~ 1500000 (10nA) )
// IUCReal = (self->value - CC_ZERO_POINT) * 10;
// return IUCReal;
//}
//
//static void SetMeasureCurrent(CCMode *self, int32_t current){
// self->_MeasureCurrent = current;
//}
//
//static int32_t GetMeasureCurrent(CCMode *self){
// return self->_MeasureCurrent;
//}
//static CURRENT_USER_CODE *InitCurrentUserCode(){
// CCMode *CurrentUserCode = malloc(sizeof(CCMode));
// CurrentUserCode->value = CC_ZERO_POINT;
// CurrentUserCode->lv = GAIN_AUTO;
// CurrentUserCode->Vmax = MAX_DAC_UC; // max DAC UserCode
// CurrentUserCode->Vmin = MIN_DAC_UC; // min DAC UserCode
// CurrentUserCode-> _MeasureData = 0;
// CurrentUserCode->_Transform2RealnA = &_Transform2RealnA;
// CurrentUserCode->SetMeasureData = &SetMeasureCurrent;
// CurrentUserCode->GetMeasureData = &GetMeasureCurrent;
// return CurrentUserCode;
//}
#endif
@@ -136,11 +136,11 @@ static uint16_t CVCurve(CVMode *CV) {
static uint16_t DACOutCode;
static bool direction_up; // direction_up = true, if Vfinal > Vorigin
static bool current_direction_up; // current_direction_up = true, Vstep => positive. vice versa
static bool firstADCData; //firstADCdata=true,when min<x<max,cyclenumber--
// reset origin volt at the begin
if (DACReset) {
DACUserCode = CV->_VOrigin;
if (INSTRUCTION.VoltFinal > CV->_VOrigin) {
if (CV->_VStop > CV->_VOrigin) {
direction_up = true;
current_direction_up = true;
} else {
@@ -151,95 +151,349 @@ static uint16_t CVCurve(CVMode *CV) {
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
DAC_outputV(DACOutCode); // output VOLT_ORIGIN
DACReset = false;
firstADCData = true;
return DACOutCode;
}
if (CT.StepTimeCounter == CV->_StepTime) {
// Decide next direction
if (direction_up) {
if (DACUserCode >= CV->_VStop) {
current_direction_up = false; // problem occurs when origin == 0000 final == ffff!!!!!!
} else if (DACUserCode <= CV->_VOrigin) {
current_direction_up = true;
if (CV->_CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
if (CV->_VoVi_Switch == 0x00){ //user see Vout
if (direction_up) {
if (DACUserCode >= CV->_VStop) {
current_direction_up = false; // problem occurs when origin == 0000 final == ffff!!!!!!
} else if (DACUserCode <= CV->_VOrigin) {
current_direction_up = true;
if (CV->_CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
}
CV->_CycleNumber--;
}
CV->_CycleNumber--;
}
} else {
if (DACUserCode <= CV->_VStop) {
current_direction_up = true; // problem occurs when origin == 0000 final == ffff!!!!!!
} else if (DACUserCode >= CV->_VOrigin) {
current_direction_up = false;
if (CV->_CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
} else {
if (DACUserCode <= CV->_VStop) {
current_direction_up = true; // problem occurs when origin == 0000 final == ffff!!!!!!
} else if (DACUserCode >= CV->_VOrigin) {
current_direction_up = false;
if (CV->_CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
}
CV->_CycleNumber--;
}
CV->_CycleNumber--;
}
}
else if (CV->_VoVi_Switch == 0x01){ //user see Vin
if (direction_up) {
if (CV->MeasureVolt >= ((int32_t)(CV->_VStop) - DAC_ZERO)/5) {
current_direction_up = false; // problem occurs when origin == 0000 final == ffff!!!!!!
firstADCData = false;
}
else if (CV->MeasureVolt <= ((int32_t)(CV->_VOrigin) - DAC_ZERO)/5) {
current_direction_up = true;
firstADCData = false;
if (CV->_CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
}
CV->_CycleNumber--;
}
else if(current_direction_up){
if(CV->MeasureVolt + ((int32_t)(CV->_Step) - DAC_ZERO)/5 > ((int32_t)(CV->_VStop) - DAC_ZERO)/5){
current_direction_up = false;
}
}
else if(!current_direction_up){
if(CV->MeasureVolt - ((int32_t)(CV->_Step) - DAC_ZERO)/5 < ((int32_t)(CV->_VOrigin) - DAC_ZERO)/5){
current_direction_up = true;
if (CV->_CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
}
CV->_CycleNumber--;
}
}
if (firstADCData){
CV->_CycleNumber--;
firstADCData = false;
}
} else {
if (CV->MeasureVolt <= ((int32_t)(CV->_VStop) - DAC_ZERO)/5) {
current_direction_up = true; // problem occurs when origin == 0000 final == ffff!!!!!!
firstADCData = false;
}
else if (CV->MeasureVolt >= ((int32_t)(CV->_VOrigin) - DAC_ZERO)/5){
current_direction_up = false;
firstADCData = false;
if (CV->_CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
}
CV->_CycleNumber--;
}
else if(current_direction_up){
if(CV->MeasureVolt + ((int32_t)(CV->_Step) - DAC_ZERO)/5 > ((int32_t)(CV->_VOrigin) - DAC_ZERO)/5){
current_direction_up = false;
if (CV->_CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
}
CV->_CycleNumber--;
}
}
else if(!current_direction_up){
if(CV->MeasureVolt - ((int32_t)(CV->_Step) - DAC_ZERO)/5 < ((int32_t)(CV->_VStop) - DAC_ZERO)/5){
current_direction_up = true;
}else if (firstADCData){//first data =2899mv
CV->_CycleNumber--;
firstADCData = false;
}
}
if (firstADCData){
CV->_CycleNumber--;
firstADCData = false;
}
}
}
// if (current_direction_up == true){
// LED_color(DARKLED, 255, 0, 0);
// }
// else if (current_direction_up == false){
// LED_color(DARKLED, 255, 0, 255);
// }
// Next output voltage
if (direction_up) {
if (current_direction_up) {
// DACUserCode overflow ?
if (DACUserCode + CV->_Step < DACUserCode) {
DACUserCode = CV->_VStop;
}
else if (DACUserCode + CV->_Step > CV->_VStop) {
DACUserCode =CV->_VStop;
if (CV->_VoVi_Switch == 0x00){
if (direction_up) {
if (current_direction_up) {
// DACUserCode overflow ?
if (DACUserCode + CV->_Step < DACUserCode) {
DACUserCode = CV->_VStop;
}
// reach Vfinal ?
else if (DACUserCode + CV->_Step > CV->_VStop) {
DACUserCode =CV->_VStop;
}
else {
DACUserCode = DACUserCode + CV->_Step;
}
}
else {
DACUserCode = DACUserCode + CV->_Step;
}
}
else {
// DACUserCode underflow ?
if (DACUserCode - CV->_Step > DACUserCode || DACUserCode > 60000) {
DACUserCode = CV->_VOrigin;
}
// DACUserCode underflow ?
if (DACUserCode - CV->_Step > DACUserCode) {
DACUserCode = CV->_VOrigin;
}
// reach Vorigin ?
else if (DACUserCode - CV->_Step < CV->_VOrigin) {
DACUserCode = CV->_VOrigin;
}
else {
DACUserCode = DACUserCode - CV->_Step;
}
}
}
else {
if (current_direction_up) {
if (DACUserCode + CV->_Step < DACUserCode) {
DACUserCode = CV->_VOrigin;
}
else if (DACUserCode + CV->_Step > CV->_VOrigin) {
DACUserCode = CV->_VOrigin;
}
else {
DACUserCode = DACUserCode + CV->_Step;
// reach Vorigin ?
else if (DACUserCode - CV->_Step < CV->_VOrigin) {
DACUserCode = CV->_VOrigin;
}
else {
DACUserCode = DACUserCode - CV->_Step;
}
}
}
else {
if (DACUserCode - CV->_Step > DACUserCode || DACUserCode > 60000) {
DACUserCode = CV->_VStop ;
}
else if (DACUserCode - CV->_Step < CV->_VStop) {
DACUserCode = CV->_VStop;
if (current_direction_up) {
if (DACUserCode + CV->_Step < DACUserCode) {
DACUserCode = CV->_VOrigin;
}
else if (DACUserCode + CV->_Step > CV->_VOrigin) {
DACUserCode = CV->_VOrigin;
}
else {
DACUserCode = DACUserCode + CV->_Step;
}
}
else {
DACUserCode = DACUserCode - CV->_Step;
if (DACUserCode - CV->_Step > DACUserCode) {
DACUserCode = CV->_VStop ;
}
else if (DACUserCode - CV->_Step < CV->_VStop) {
DACUserCode = CV->_VStop;
}
else {
DACUserCode = DACUserCode - CV->_Step;
}
}
}
}
else if (CV->_VoVi_Switch == 0x01){
if (direction_up) {
if (current_direction_up) {
// DACUserCode overflow ?
if (DACUserCode + CV->_Step < DACUserCode) {
DACUserCode = CV->_VStop;
}
// reach Vfinal ?
else if (CV->MeasureVolt + ((int32_t)(CV->_Step) - DAC_ZERO)/5 > ((int32_t)(CV->_VStop) - DAC_ZERO)/5) {
DACUserCode =CV->_VStop;
}
else if (CV->MeasureVolt >= ((int32_t)(CV->_VStop) - DAC_ZERO)/5){
DACUserCode =CV->_VStop;
}
else {
DACUserCode = DACUserCode + CV->_Step;
}
}
else {
// DACUserCode underflow ?
if (DACUserCode - CV->_Step > DACUserCode) {
DACUserCode = CV->_VOrigin;
}
// reach Vorigin ?
else if (CV->MeasureVolt - ((int32_t)(CV->_Step) - DAC_ZERO)/5 < ((int32_t)(CV->_VOrigin) - DAC_ZERO)/5) {
DACUserCode = CV->_VOrigin;
}
else if (CV->MeasureVolt <= ((int32_t)(CV->_VOrigin) - DAC_ZERO)/5){
DACUserCode = CV->_VOrigin;
}
else {
DACUserCode = DACUserCode - CV->_Step;
}
}
}
else {
if (current_direction_up) {
// DACUserCode overflow ?
if (DACUserCode + CV->_Step < DACUserCode) {
DACUserCode = CV->_VOrigin;
}
// ex:command 3->1V ,when 1 to 3V, 2.99+0.1 > 3V
else if (CV->MeasureVolt + ((int32_t)(CV->_Step) - DAC_ZERO)/5 > ((int32_t)(CV->_VOrigin) - DAC_ZERO)/5) {
DACUserCode = CV->_VOrigin;
}
else if (CV->MeasureVolt >= ((int32_t)(CV->_VOrigin) - DAC_ZERO)/5){
DACUserCode = CV->_VOrigin;
}
else {
DACUserCode = DACUserCode + CV->_Step;
}
}
else {
if (DACUserCode - CV->_Step > DACUserCode) {
DACUserCode = CV->_VStop ;
}
else if (CV->MeasureVolt - ((int32_t)(CV->_Step) - DAC_ZERO)/5 < ((int32_t)(CV->_VStop) - DAC_ZERO)/5) {
DACUserCode = CV->_VStop;
}
else if(CV->MeasureVolt <= ((int32_t)(CV->_VStop) - DAC_ZERO)/5){
DACUserCode = CV->_VStop;
}
else {
DACUserCode = DACUserCode - CV->_Step;
}
}
}
}
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
DAC_outputV(DACOutCode);
}
return DACOutCode;
}
static void CV_Plot(CVMode *CV){
static uint8_t PreviousGain = I_GAIN_100R;
static uint8_t VoltCurrentSwitch = 0;
uint16_t ADC_measure = 0;
if(VoltCurrentSwitch < 5){
ReadCurrent(spi_ADC_rxbuf);
VoltCurrentSwitch ++;
}
else if(VoltCurrentSwitch == 5){
// read current
if(INSTRUCTION.AutoGainEnable){
CV->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
if(PreviousGain != INSTRUCTION.ADCGainLevel){
PreviousGain = INSTRUCTION.ADCGainLevel;
CV->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
CV->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
}
if(PreviousGain != INSTRUCTION.ADCGainLevel){
PreviousGain = INSTRUCTION.ADCGainLevel;
CV->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
CV->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
}
}
else{
ReadCurrent(spi_ADC_rxbuf);
CV->_MeasureData = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
VoltCurrentSwitch ++;
}
// else if(VoltCurrentSwitch < 9){
// // read volt
// ReadVolt(spi_ADC_rxbuf);
// VoltCurrentSwitch++;
// }
// else if(VoltCurrentSwitch == 9){
// /** read battery voltage **/
// ReadVolt(spi_ADC_rxbuf);
// ADC_measure = (uint16_t) (spi_ADC_rxbuf[0] << 8) | (uint16_t) (spi_ADC_rxbuf[1]);
// //CV->MeasureVolt = 20000;
// CV->MeasureVolt = DecodeADCVolt(ADC_measure);
// VoltCurrentSwitch++;
// }
else if(VoltCurrentSwitch < 9){
if(CV->_VoVi_Switch == 0x01){
// read vin volt
ReadVolt(spi_ADC_rxbuf);
}else if(CV->_VoVi_Switch == 0x00){
// read vout volt
ReadVoutVolt(spi_ADC_rxbuf);
}
VoltCurrentSwitch++;
}
else if(VoltCurrentSwitch == 9){
if(CV->_VoVi_Switch == 0x01){
// read vin volt
ReadVolt(spi_ADC_rxbuf);
ADC_measure = (uint16_t) (spi_ADC_rxbuf[0] << 8) | (uint16_t) (spi_ADC_rxbuf[1]);
//CV->MeasureVolt = 20000;
CV->MeasureVolt = DecodeADCVolt(ADC_measure);
}else if(CV->_VoVi_Switch == 0x00){
// read vout volt
ReadVoutVolt(spi_ADC_rxbuf);
ADC_measure = (uint16_t) (spi_ADC_rxbuf[0] << 8) | (uint16_t) (spi_ADC_rxbuf[1]);
CV->MeasureVolt = DecodeADCVoutVolt(ADC_measure);
}
VoltCurrentSwitch++;
}else if (VoltCurrentSwitch < 13){
ReadBatVolt(spi_ADC_rxbuf);
VoltCurrentSwitch ++;
}
else if (VoltCurrentSwitch == 13){
// read battery volt
ReadBatVolt(spi_ADC_rxbuf);
ADC_measure = (uint16_t) (spi_ADC_rxbuf[0] << 8) | (uint16_t) (spi_ADC_rxbuf[1]);
CV->_MeasureBatvolt = DecodeADCBatVolt(ADC_measure);
CV->_MeasureBatvolt = CV->_MeasureBatvolt/10 - 250; // (5.00V) 5000->250 usercode
VoltCurrentSwitch ++;
}
else{
VoltCurrentSwitch = 0;
}
NotifyCurrent[0] = (uint8_t) (CV->_MeasureData >> 24);
NotifyCurrent[1] = (uint8_t) ((CV->_MeasureData & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((CV->_MeasureData & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (CV->_MeasureData & 0x000000FF);
if ((CV->_VoVi_Switch == 0x01) || (CV->_VoVi_Switch == 0x00)){ //user see Vin || user see Vout
NotifyVolt[0] = (uint8_t) (CV->MeasureVolt >> 24);
NotifyVolt[1] = (uint8_t) ((CV->MeasureVolt & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((CV->MeasureVolt & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (CV->MeasureVolt & 0x000000FF);
}
NotifyBatVolt = (uint8_t) (CV->_MeasureBatvolt & 0x000000FF);
}
#endif
@@ -55,6 +55,25 @@ static uint16_t DAC_outputV(uint16_t voltLV) {
return voltLV;
}
static void VoutGainControl(uint8_t VOUTLevel){
if(VOUTLevel == 0){
// VOUT gain level = 0, using 240K resister
PIN15_setOutputValue(Turon_VOUT_SMALL, 0);
}
else if(VOUTLevel == 1){
// VOUT gain level = 1, using 15K resister
PIN15_setOutputValue(Turon_VOUT_SMALL, 1);
}
else if(VOUTLevel == 2){
// VOUT gain level = 2, using 15K resister
PIN15_setOutputValue(Turon_VOUT_SMALL, 1);
}
else{
// default using 15K resister
PIN15_setOutputValue(Turon_VOUT_SMALL, 1);
}
}
#endif
static int32_t User2Real(uint16_t UserCode){
@@ -29,7 +29,7 @@
*/
#define BOARD_EARTH
#define BOARD_C5F3
typedef struct _formula{
@@ -135,17 +135,17 @@ struct _correction{
#ifdef BOARD_TWENTY_ONE
{
.ADC_volt.coeff = (-6258074),
.ADC_volt.offset = 152210580945,
.ADC_volt.coeff = (-6256213),
.ADC_volt.offset = 102974768458,
.ADC_current[0].coeff = 30022512,
.ADC_current[0].offset = -729552647201,
.ADC_current[0].coeff = 31033951,
.ADC_current[0].offset = -510391262009,
.ADC_current[1].coeff = 658398533,
.ADC_current[1].offset = -16001498741131,
.ADC_current[1].coeff = 656911527,
.ADC_current[1].offset = -10810626335997,
.ADC_current[2].coeff = 30908351000,
.ADC_current[2].offset = -746548614824000,
.ADC_current[2].coeff = 31234223317,
.ADC_current[2].offset = -513653236006248,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
@@ -172,8 +172,8 @@ struct _correction{
.ADC_current[1].coeff = 652738209,
.ADC_current[1].offset = -15767733896990,
.ADC_current[2].coeff = 30959456,
.ADC_current[2].offset = -748026885843,
.ADC_current[2].coeff = 30959456000,
.ADC_current[2].offset = -748026885843000,
.DAC2RealV.coeff = (-18880478),
.DAC2RealV.offset = 629012735316,
@@ -266,8 +266,8 @@ struct _correction{
.ADC_current[1].coeff = 657619858,
.ADC_current[1].offset = (-15835988865283),
.ADC_current[2].coeff = 31116362,
.ADC_current[2].offset = (-749402214847),
.ADC_current[2].coeff = 31116362000,
.ADC_current[2].offset = (-749402214847000),
.DAC2RealV.coeff = (-18935149),
.DAC2RealV.offset = 643063752893,
@@ -351,7 +351,7 @@ struct _correction{
.ADC_current[1].offset = (-1123221851971),
.ADC_current[2].coeff = 61882330000,
.ADC_current[2].offset = (-10103859661590),
.ADC_current[2].offset = (-1010385966159000),
.DAC2RealV.coeff = (-18690126),
.DAC2RealV.offset = 564319610294,
@@ -372,14 +372,14 @@ struct _correction{
.ADC_volt.coeff = (-6238112),
.ADC_volt.offset = 101628014509,
.ADC_current[0].coeff = 6087943,
.ADC_current[0].offset = (-99768174580),
.ADC_current[0].coeff = 61842883,
.ADC_current[0].offset = (-1006424716609),
.ADC_current[1].coeff = 68915156,
.ADC_current[1].offset = (-1121470119188),
.ADC_current[1].coeff = 68602677,
.ADC_current[1].offset = (-1117469013718),
.ADC_current[2].coeff = 61800515,
.ADC_current[2].offset = (-1006755993534),
.ADC_current[2].coeff = 12521267000,
.ADC_current[2].offset = (-204009192742000),
.DAC2RealV.coeff = (-18690126),
.DAC2RealV.offset = 564319610294,
@@ -507,34 +507,6 @@ struct _correction{
};
#endif
#ifdef BOARD_WATER_STAR
{
.ADC_volt.coeff = (-6259808),
.ADC_volt.offset = 102009860128,
.ADC_current[0].coeff = 31335917,
.ADC_current[0].offset = (-511426612252),
.ADC_current[1].coeff = 658172815,
.ADC_current[1].offset = (-10738251896209),
.ADC_current[2].coeff = 31482687000,
.ADC_current[2].offset = (-513650531545000),
.DAC2RealV.coeff = (-10548297),
.DAC2RealV.offset = 562611756757,
.Usercode2DAC.coeff = (-10500262),
.Usercode2DAC.offset = 559630236100,
.Gain0Boundary[0] = 0x5D96,
.Gain0Boundary[1] = 0x5DD9,
.Gain1Boundary[0] = 0x57CD,
.Gain1Boundary[1] = 0x639F
};
#endif
#ifdef BOARD_MARS
{
.ADC_volt.coeff = (-6270623),
@@ -546,8 +518,8 @@ struct _correction{
.ADC_current[1].coeff = 655981611,
.ADC_current[1].offset = (-10709717111320),
.ADC_current[2].coeff = 31256968,
.ADC_current[2].offset = (-510275213115),
.ADC_current[2].coeff = 31256968000,
.ADC_current[2].offset = (-510275213115000),
.DAC2RealV.coeff = (-18937347),
.DAC2RealV.offset = 568558163265,
@@ -619,6 +591,427 @@ struct _correction{
};
#endif
#ifdef BOARD_JUPITER
{
.ADC_volt.coeff = (-6269485),
.ADC_volt.offset = 102238333056,
.ADC_current[0].coeff = 31318015,
.ADC_current[0].offset = (-510539199854),
.ADC_current[1].coeff = 657254297,
.ADC_current[1].offset = (-10714778629799),
.ADC_current[2].coeff = 31423827318,
.ADC_current[2].offset = (-512292182160264),
.DAC2RealV.coeff = (-19009388),
.DAC2RealV.offset = 567032653061,
.Usercode2DAC.coeff = (-10474987),
.Usercode2DAC.offset = 560580057382,
.Gain0Boundary[0] = 0x5D96,
.Gain0Boundary[1] = 0x5DD9,
.Gain1Boundary[0] = 0x57CD,
.Gain1Boundary[1] = 0x639F
};
#endif
#ifdef BOARD_SATURN
{
.ADC_volt.coeff = (-6262993),
.ADC_volt.offset = 101996256499,
.ADC_current[0].coeff = 31482854,
.ADC_current[0].offset = (-513080696050),
.ADC_current[1].coeff = 660069824,
.ADC_current[1].offset = (-10757047907091),
.ADC_current[2].coeff = 31599480301,
.ADC_current[2].offset = (-514997796786064),
.DAC2RealV.coeff = (-19009388),
.DAC2RealV.offset = 567032653061,
.Usercode2DAC.coeff = (-10482326),
.Usercode2DAC.offset = 558931155711,
.Gain0Boundary[0] = 0x5D96,
.Gain0Boundary[1] = 0x5DD9,
.Gain1Boundary[0] = 0x57CD,
.Gain1Boundary[1] = 0x639F
};
#endif
#ifdef BOARD_PLUTO
{
.ADC_volt.coeff = (-6234602),
.ADC_volt.offset = 101125467977,
.ADC_current[0].coeff = 31257110,
.ADC_current[0].offset = -507158331398,
.ADC_current[1].coeff = 658056279,
.ADC_current[1].offset = -10678937298845,
.ADC_current[2].coeff = 31453705244,
.ADC_current[2].offset = -510451697841977,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
.Usercode2DAC.coeff = (-10511469),
.Usercode2DAC.offset = 560144103380,
.Gain0Boundary[0] = 0x5ECD,
.Gain0Boundary[1] = 0x5F0D,
.Gain1Boundary[0] = 0x5900,
.Gain1Boundary[1] = 0x64DD
};
#endif
#ifdef BOARD_URANUS
{
.ADC_volt.coeff = (-6288406),
.ADC_volt.offset = 102590185538,
.ADC_current[0].coeff = 31126241,
.ADC_current[0].offset = -507996638504,
.ADC_current[1].coeff = 657161839,
.ADC_current[1].offset = -10726524110539,
.ADC_current[2].coeff = 31389113015,
.ADC_current[2].offset = -512374954780066,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
.Usercode2DAC.coeff = (-10522699),
.Usercode2DAC.offset = 562027015384,
.Gain0Boundary[0] = 0x5ECD,
.Gain0Boundary[1] = 0x5F0D,
.Gain1Boundary[0] = 0x5900,
.Gain1Boundary[1] = 0x64DD
};
#endif
#ifdef BOARD_NEPTUNE
{
.ADC_volt.coeff = (-6238267),
.ADC_volt.offset = 101851442363,
.ADC_current[0].coeff = 31273546,
.ADC_current[0].offset = -510209128923,
.ADC_current[1].coeff = 655098575,
.ADC_current[1].offset = -10688260793525,
.ADC_current[2].coeff = 31427718507,
.ADC_current[2].offset = -512764179259867,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
.Usercode2DAC.coeff = (-10523806),
.Usercode2DAC.offset = 561060090900,
.Gain0Boundary[0] = 0x5ECD,
.Gain0Boundary[1] = 0x5F0D,
.Gain1Boundary[0] = 0x5900,
.Gain1Boundary[1] = 0x64DD
};
#endif
#ifdef BOARD_BIGBROTHER
{
.ADC_volt.coeff = (-6249254),
.ADC_volt.offset = 101825967151,
.ADC_current[0].coeff = 31064047,
.ADC_current[0].offset = -506320666330,
.ADC_current[1].coeff = 656820055,
.ADC_current[1].offset = -10700912340162,
.ADC_current[2].coeff = 31424358846,
.ADC_current[2].offset = -511986603889918,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
.Usercode2DAC.coeff = (-10484132),
.Usercode2DAC.offset = 559642619397,
.Gain0Boundary[0] = 0x5ECD,
.Gain0Boundary[1] = 0x5F0D,
.Gain1Boundary[0] = 0x5900,
.Gain1Boundary[1] = 0x64DD
};
#endif
#ifdef BOARD_KUMA
{
.ADC_volt.coeff = (-6284116),
.ADC_volt.offset = 102151354839,
.ADC_current[0].coeff = 31222344,
.ADC_current[0].offset = -507425541248,
.ADC_current[1].coeff = 657422161,
.ADC_current[1].offset = -10654143756362,
.ADC_current[2].coeff = 31221776879,
.ADC_current[2].offset = -506123984398184,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
.Usercode2DAC.coeff = (-10541828),
.Usercode2DAC.offset = 559483550210,
.Gain0Boundary[0] = 0x5ECD,
.Gain0Boundary[1] = 0x5F0D,
.Gain1Boundary[0] = 0x5900,
.Gain1Boundary[1] = 0x64DD
};
#endif
#ifdef BOARD_MINO
{
.ADC_volt.coeff = (-6242774),
.ADC_volt.offset = 101201319007,
.ADC_current[0].coeff = 31462554,
.ADC_current[0].offset = -509881330352,
.ADC_current[1].coeff = 659514123,
.ADC_current[1].offset = -10687831492393,
.ADC_current[2].coeff = 31535570993,
.ADC_current[2].offset = -511116189463173,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
.Usercode2DAC.coeff = (-10529707),
.Usercode2DAC.offset = 560289198229,
.Gain0Boundary[0] = 0x5ECD,
.Gain0Boundary[1] = 0x5F0D,
.Gain1Boundary[0] = 0x5900,
.Gain1Boundary[1] = 0x64DD
};
#endif
#ifdef BOARD_ANGUS
{
.ADC_volt.coeff = (-6243800),
.ADC_volt.offset = 101198174953,
.ADC_current[0].coeff = 31174733,
.ADC_current[0].offset = -505246715963,
.ADC_current[1].coeff = 655540713,
.ADC_current[1].offset = -10622652066340,
.ADC_current[2].coeff = 31416986708,
.ADC_current[2].offset = -509094727775962,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
.Usercode2DAC.coeff = (-10556932),
.Usercode2DAC.offset = 561269201380,
.Gain0Boundary[0] = 0x5ECD,
.Gain0Boundary[1] = 0x5F0D,
.Gain1Boundary[0] = 0x5900,
.Gain1Boundary[1] = 0x64DD
};
#endif
#ifdef BOARD_C5F3
{
.ADC_volt.coeff = (-6249801),
.ADC_volt.offset = 101577560497,
.ADC_current[0].coeff = 31333145,
.ADC_current[0].offset = -509202021996,
.ADC_current[1].coeff = 655056917,
.ADC_current[1].offset = -10647726030826,
.ADC_current[2].coeff = 31407894492,
.ADC_current[2].offset = -510516121023653,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
.Usercode2DAC.coeff = (-10489696),
.Usercode2DAC.offset = 559743808452,
.Gain0Boundary[0] = 0x5ECD,
.Gain0Boundary[1] = 0x5F0D,
.Gain1Boundary[0] = 0x5900,
.Gain1Boundary[1] = 0x64DD
};
#endif
#ifdef BOARD_C7A7
{
.ADC_volt.coeff = (-6260414),
.ADC_volt.offset = 101368153805,
.ADC_current[0].coeff = 31152640,
.ADC_current[0].offset = -506323045036,
.ADC_current[1].coeff = 653922673,
.ADC_current[1].offset = -10628474486965,
.ADC_current[2].coeff = 31393868429,
.ADC_current[2].offset = -510314295937946,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
.Usercode2DAC.coeff = (-10547274),
.Usercode2DAC.offset = 561050097141,
.Gain0Boundary[0] = 0x5ECD,
.Gain0Boundary[1] = 0x5F0D,
.Gain1Boundary[0] = 0x5900,
.Gain1Boundary[1] = 0x64DD
};
#endif
#ifdef BOARD_POCA
{
.ADC_volt.coeff = (-6241861),
.ADC_volt.offset = 101629864562,
.ADC_current[0].coeff = 31256579,
.ADC_current[0].offset = -508530535142,
.ADC_current[1].coeff = 658820355,
.ADC_current[1].offset = -10720633637013,
.ADC_current[2].coeff = 31445401561,
.ADC_current[2].offset = -511730149870324,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
.Usercode2DAC.coeff = (-10572079),
.Usercode2DAC.offset = 564222895808,
.Gain0Boundary[0] = 0x5ECD,
.Gain0Boundary[1] = 0x5F0D,
.Gain1Boundary[0] = 0x5900,
.Gain1Boundary[1] = 0x64DD
};
#endif
#ifdef BOARD_D429
{
.ADC_volt.coeff = (-6241392),
.ADC_volt.offset = 101665575617,
.ADC_current[0].coeff = 31118362,
.ADC_current[0].offset = -507070231542,
.ADC_current[1].coeff = 653903856,
.ADC_current[1].offset = -10652907999782,
.ADC_current[2].coeff = 31380490401,
.ADC_current[2].offset = -511219632543579,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
.Usercode2DAC.coeff = (-10512540),
.Usercode2DAC.offset = 562273068204,
.Gain0Boundary[0] = 0x5ECD,
.Gain0Boundary[1] = 0x5F0D,
.Gain1Boundary[0] = 0x5900,
.Gain1Boundary[1] = 0x64DD
};
#endif
#ifdef BOARD_C60D
{
.ADC_volt.coeff = (-6257164),
.ADC_volt.offset = 102239515470,
.ADC_current[0].coeff = 31270905,
.ADC_current[0].offset = -510840730706,
.ADC_current[1].coeff = 654407812,
.ADC_current[1].offset = -10691708695136,
.ADC_current[2].coeff = 31370764564,
.ADC_current[2].offset = -512563422208737,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
.Usercode2DAC.coeff = (-10505677),
.Usercode2DAC.offset = 561896606772,
.Gain0Boundary[0] = 0x5ECD,
.Gain0Boundary[1] = 0x5F0D,
.Gain1Boundary[0] = 0x5900,
.Gain1Boundary[1] = 0x64DD
};
#endif
#ifdef BOARD_MILKY
{
.ADC_volt.coeff = (-6245296),
.ADC_volt.offset = 101930135585,
.ADC_current[0].coeff = 31234538,
.ADC_current[0].offset = -510079528824,
.ADC_current[1].coeff = 655637591,
.ADC_current[1].offset = -10704987805680,
.ADC_current[2].coeff = 31674775010,
.ADC_current[2].offset = -517270192436237,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
.Usercode2DAC.coeff = (-10537872),
.Usercode2DAC.offset = 562523723374,
.Gain0Boundary[0] = 0x5ECD,
.Gain0Boundary[1] = 0x5F0D,
.Gain1Boundary[0] = 0x5900,
.Gain1Boundary[1] = 0x64DD
};
#endif
// this function turn ADC measure value (0xXXXX) into real voltage
// unit should be mV
static int32_t DecodeADCVolt(uint16_t ADC_measure){
@@ -630,6 +1023,26 @@ static int32_t DecodeADCVolt(uint16_t ADC_measure){
return (int32_t) (ADCRealVolt);
}
// this function turn ADC measure value (0xXXXX) into Vout voltage
// unit should be mV
static int32_t DecodeADCVoutVolt(uint16_t ADC_measure){
long long ADCVoutVolt = 0;
ADCVoutVolt = ((-62658782380) * ADC_measure + 1020118014900000);
ADCVoutVolt = ADCVoutVolt / 1e11;
return (int32_t) (ADCVoutVolt);
}
// this function turn ADC measure value (0xXXXX) into Battery voltage
// unit should be mV
static int32_t DecodeADCBatVolt(uint16_t ADC_measure){
long long ADCBatVolt = 0;
ADCBatVolt = (12571991860 * ADC_measure + 3314058604700);
ADCBatVolt = ADCBatVolt / 1e11;
return (int32_t) (ADCBatVolt);
}
// this function turn ADC measure value (0xXXXX) into real current
// unit should be pA
static int32_t DecodeADCCurrent(uint8_t ADCGain, uint16_t ADC_measure){
@@ -638,7 +1051,7 @@ static int32_t DecodeADCCurrent(uint8_t ADCGain, uint16_t ADC_measure){
ADCRealCurrent = (Correction.ADC_current[ADCGain].coeff * ADC_measure + Correction.ADC_current[ADCGain].offset)/1e7;
// Current unit is pA;
// If ADCGain is GAIN_200R unit is nA
// If ADCGain is I_GAIN_100R unit is nA
return (int32_t) (ADCRealCurrent);
}
@@ -677,6 +1090,7 @@ static int32_t DecodeResister(uint8_t ADCGainLevel, uint16_t CurrentMeasure, uin
NotifyImpedance[1] = (uint8_t) ((resister_32 & 0x00FF0000) >> 16);
NotifyImpedance[2] = (uint8_t) ((resister_32 & 0x0000FF00) >> 8);
NotifyImpedance[3] = (uint8_t) (resister_32 & 0x000000FF);
// NotifyReady = true;
return resister_32;
}
@@ -685,7 +1099,8 @@ static int32_t DecodeResister(uint8_t ADCGainLevel, uint16_t CurrentMeasure, uin
static int32_t DecodeADCValue(uint8_t ADCGain, uint8_t ADCChannel, uint8_t *ADC_raw){
uint16_t ADC_measure = (uint16_t) (ADC_raw[0] << 8) | (uint16_t) (ADC_raw[1]);
int32_t ADCRealVolt = 0, ret = 0, ADCRealCurrent = 0;
int32_t ADCRealVolt = 0, ret = 0, ADCRealCurrent = 0, ADCVoutVolt = 0, ADCBatVolt = 0;
// return real volt to controller
if(ADCChannel == ADC_CH_VOLT){
@@ -695,55 +1110,71 @@ static int32_t DecodeADCValue(uint8_t ADCGain, uint8_t ADCChannel, uint8_t *ADC_
// return real current to controller
else if(ADCChannel == ADC_CH_CURRENT){
ADCRealCurrent = DecodeADCCurrent(ADCGain, ADC_measure);
NotifyCurrent[0] = (uint8_t) (ADCRealCurrent >> 24);
NotifyCurrent[1] = (uint8_t) ((ADCRealCurrent & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((ADCRealCurrent & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (ADCRealCurrent & 0x000000FF);
ret = ADCRealCurrent;
}
if ( (INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE)) {
// wait 0.1 sec until circuit stable => discard first data means wait 0.1 sec
if(DiscardIVFirstData){
DiscardIVFirstData ++;
DecodeADCCurrent(ADCGain, ADC_measure);
ret = DecodeADCCurrent(ADCGain, ADC_measure);
// return real VoutVolt to controller
else if(ADCChannel == ADC_CH_DAC){
ADCVoutVolt = DecodeADCVoutVolt(ADC_measure);
ret = ADCVoutVolt;
}
// DiscardIVFirstData :1,2; discard two data
// DiscardIVFirstData = 0; recording data
if(DiscardIVFirstData == 3){
DiscardIVFirstData = 0;
}
return ret;
}
// return real Battery Volt to controller
else if(ADCChannel == ADC_CH_BAT){
ADCBatVolt = DecodeADCBatVolt(ADC_measure);
ret = ADCBatVolt;
}
// return a real time current (used for deciding auto gain)
ret = DecodeADCCurrent(ADCGain, ADC_measure);
ADCRealCurrent_long = ADCRealCurrent_long + ret;
avg_number ++;
if (CT.StepTimeCounter == INSTRUCTION.StepTime - 1) {
DiscardIVFirstData = 1;
ADCRealCurrent_long = ADCRealCurrent_long / avg_number;
NotifyCurrent[0] = (uint8_t) (ADCRealCurrent_long >> 24);
NotifyCurrent[1] = (uint8_t) ((ADCRealCurrent_long & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((ADCRealCurrent_long & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (ADCRealCurrent_long & 0x000000FF);
avg_number = 0;
ADCRealCurrent_long = 0;
int32_t G = ADCGain;
NotifyImpedance[0] = (uint8_t) (G >> 24);
NotifyImpedance[1] = (uint8_t) ((G & 0x00FF0000) >> 16);
NotifyImpedance[2] = (uint8_t) ((G & 0x0000FF00) >> 8);
NotifyImpedance[3] = (uint8_t) (G & 0x000000FF);
}
}
// if ( (INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE)) {
// if ( (INSTRUCTION.eliteFxn == CV_CURVE)) {
// // wait 0.1 sec until circuit stable => discard first data means wait 0.1 sec
// if(DiscardIVFirstData){
// DiscardIVFirstData ++;
// DecodeADCCurrent(ADCGain, ADC_measure);
// ret = DecodeADCCurrent(ADCGain, ADC_measure);
//
// // DiscardIVFirstData :1,2; discard two data
// // DiscardIVFirstData = 0; recording data
// if(DiscardIVFirstData == 3){
// DiscardIVFirstData = 0;
// }
// return ret;
// }
//
// // return a real time current (used for deciding auto gain)
// ret = DecodeADCCurrent(ADCGain, ADC_measure);
// ADCRealCurrent_long = ADCRealCurrent_long + ret;
// avg_number ++;
//
// if (CT.StepTimeCounter == INSTRUCTION.StepTime - 1) {
// DiscardIVFirstData = 1;
// ADCRealCurrent_long = ADCRealCurrent_long / avg_number;
// NotifyCurrent[0] = (uint8_t) (ADCRealCurrent_long >> 24);
// NotifyCurrent[1] = (uint8_t) ((ADCRealCurrent_long & 0x00FF0000) >> 16);
// NotifyCurrent[2] = (uint8_t) ((ADCRealCurrent_long & 0x0000FF00) >> 8);
// NotifyCurrent[3] = (uint8_t) (ADCRealCurrent_long & 0x000000FF);
// avg_number = 0;
// ADCRealCurrent_long = 0;
//// NotifyReady = true;
// }
// }
// IT curve
else {
ADCRealCurrent = DecodeADCCurrent(ADCGain, ADC_measure);
NotifyCurrent[0] = (uint8_t) (ADCRealCurrent >> 24);
NotifyCurrent[1] = (uint8_t) ((ADCRealCurrent & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((ADCRealCurrent & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (ADCRealCurrent & 0x000000FF);
ret = ADCRealCurrent;
}
}
// else {
// ADCRealCurrent = DecodeADCCurrent(ADCGain, ADC_measure);
// NotifyCurrent[0] = (uint8_t) (ADCRealCurrent >> 24);
// NotifyCurrent[1] = (uint8_t) ((ADCRealCurrent & 0x00FF0000) >> 16);
// NotifyCurrent[2] = (uint8_t) ((ADCRealCurrent & 0x0000FF00) >> 8);
// NotifyCurrent[3] = (uint8_t) (ADCRealCurrent & 0x000000FF);
// ret = ADCRealCurrent;
// }
// }
else{
// not support AIN2 / AIN3 yet
@@ -762,7 +1193,7 @@ static void ADC_overflow(uint8_t gain, uint8_t *rawdata){
uint16_t U16Rawdata = 0;
U16Rawdata = (((uint16_t) (rawdata[0]))<<8) | ((uint16_t) (rawdata[1]));
if(gain == GAIN_200K){
if(gain == I_GAIN_3M){
if( U16Rawdata <= Correction.Gain0Boundary[0]){
rawdata[0] = Correction.Gain0Boundary[0] >> 4;
rawdata[1] = (uint8_t) (Correction.Gain0Boundary[0] & 0x00FF);
@@ -772,7 +1203,7 @@ static void ADC_overflow(uint8_t gain, uint8_t *rawdata){
rawdata[1] = (uint8_t) (Correction.Gain0Boundary[1] & 0x00FF);
}
}
else if(gain == GAIN_10K){
else if(gain == I_GAIN_100K){
if( U16Rawdata <= Correction.Gain1Boundary[0]){
rawdata[0] = Correction.Gain1Boundary[0] >> 4;
rawdata[1] = (uint8_t) (Correction.Gain1Boundary[0] & 0x00FF);
@@ -15,6 +15,7 @@ static void InitFlag(){
DACReset = true;
CCModeDACEnable = 0; // to make sure DAC work after ADC
Free_Work_Mode = true; // Free(WorkModeData)
// NotifyReady = false;
// DiscardIVFirstData = 0;
}
@@ -38,37 +38,46 @@ static int32_t IT_Plot(WorkMode *WorkModeData) {
break;
}
default: {
#define CURRENT_MODE WorkModeData->IV
#define CURRENT_MODE WorkModeData->IT
break;
}
}
// read ADC current
int32_t Real_Current = 0;
int32_t RealCurrent = 0, RealVolt = 0;
static uint8_t PreviousGain = I_GAIN_100R;
if(INSTRUCTION.AutoGainEnable){
Real_Current = AutoGainReadCurrent(spi_ADC_rxbuf);
RealCurrent = AutoGainReadCurrent(spi_ADC_rxbuf);
if(PreviousGain != INSTRUCTION.ADCGainLevel){
PreviousGain = INSTRUCTION.ADCGainLevel;
CURRENT_MODE->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
CURRENT_MODE->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
}
if(PreviousGain != INSTRUCTION.ADCGainLevel){
PreviousGain = INSTRUCTION.ADCGainLevel;
CURRENT_MODE->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
CURRENT_MODE->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
}
}
else{
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
RealCurrent = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
// IT->SetMeasureData((struct Measure *) IT, Real_Current);
// Real_Current = IT->GetMeasureData((struct Measure *) IT);
CURRENT_MODE->_MeasureData = Real_Current;
CURRENT_MODE->_MeasureData = RealCurrent;
// if(INSTRUCTION.eliteFxn == IV_CURVE){
// if(absolute(Real_Current) > CURRENT_MODE->_LimitValue){
//// PeriodicEvent = false; //Real current exceed expected limit value, force stop
//// DACReset = true;
// reset();
// }
// }
return Real_Current;
// if(INSTRUCTION.eliteFxn == IV_CURVE){
// // RealVo = Vo - RealCurrent * 100R
// RealVolt = (INSTRUCTION.VoltConstant - DAC_ZERO)/5 - 200*(RealCurrent/1e6);
//
// NotifyVolt[0] = (uint8_t) (RealVolt >> 24);
// NotifyVolt[1] = (uint8_t) ((RealVolt & 0x00FF0000) >> 16);
// NotifyVolt[2] = (uint8_t) ((RealVolt & 0x0000FF00) >> 8);
// NotifyVolt[3] = (uint8_t) (RealVolt & 0x000000FF);
// }
return RealCurrent;
}
@@ -26,13 +26,13 @@ static uint16_t VoltScan(WorkMode *WorkModeData) {
}
static uint16_t OneWayVoltScan(IVMode *IV) {
static uint16_t DACOutCode;
uint16_t DACOutCode;
// reset origin volt at the begin
if (DACReset) {
// DACUserCode = IV->GetVOrigin((struct VoltOutPara *) IV);
DACUserCode = IV->_VOrigin;
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
INSTRUCTION.VoltConstant = IV->_VOrigin;
DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant);
DACReset = false;
// output VOLT_ORIGIN
@@ -43,44 +43,178 @@ static uint16_t OneWayVoltScan(IVMode *IV) {
if (CT.StepTimeCounter == IV->_StepTime){
if (IV->_VOrigin < IV->_VStop) {
// output the next output volt
DACUserCode = DACUserCode + IV->_Step;
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
INSTRUCTION.VoltConstant = INSTRUCTION.VoltConstant + IV->_Step;
// Only used in two-wire IV
// if(INSTRUCTION.VoltConstant > IV->_VStop){
// INSTRUCTION.VoltConstant = IV->_VStop;
// }
DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant);
DAC_outputV(DACOutCode);
// end IV task if we reach INSTRUCTION.VoltFinal
if (DACUserCode >= IV->_VStop) {
PeriodicEvent = false;
DACReset = true;
}
// if (INSTRUCTION.VoltConstant >= IV->_VStop) {
// PeriodicEvent = false;
// DACReset = true;
// }
} else {
DACUserCode = DACUserCode - IV->_Step;
INSTRUCTION.VoltConstant = INSTRUCTION.VoltConstant - IV->_Step;
// check if DACUserCode underflow
if(DACUserCode >= 60000){
// LED_color(DARKLED, 0xFF, 0x00, 0x00);
DACUserCode = IV->_VStop;
if(INSTRUCTION.VoltConstant >= 60000){
INSTRUCTION.VoltConstant = IV->_VStop;
}
// int32_t DACUC = DACUserCode;
// NotifyImpedance[0] = (uint8_t) (DACUC >> 24);
// NotifyImpedance[1] = (uint8_t) ((DACUC & 0x00FF0000) >> 16);
// NotifyImpedance[2] = (uint8_t) ((DACUC & 0x0000FF00) >> 8);
// NotifyImpedance[3] = (uint8_t) (DACUC & 0x000000FF);
// output the next output volt
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant);
DAC_outputV(DACOutCode);
// end IV task if we reach INSTRUCTION.VoltFinal
if (DACUserCode <= IV->_VStop){
PeriodicEvent = false;
DACReset = true;
// reset();
// if (INSTRUCTION.VoltConstant <= IV->_VStop){
// PeriodicEvent = false;
// DACReset = true;
//// reset();
// }
}
if (IV->_VoVi_Switch == 0x00){ //user see Vout
if (IV->_VOrigin < IV->_VStop) {
if(INSTRUCTION.VoltConstant >= IV->_VStop){
PeriodicEvent = false;
DACReset = true;
}
}
else{
if(INSTRUCTION.VoltConstant <= IV->_VStop){
PeriodicEvent = false;
DACReset = true;
}
}
}
int32_t RealV;
RealV = DAC_to_realV(DACOutCode);
NotifyVolt[0] = (uint8_t)((RealV & 0xFF000000) >> 24);
NotifyVolt[1] = (uint8_t)((RealV & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t)((RealV & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t)(RealV & 0x000000FF);
}
return DACOutCode;
}
static void IV_Plot(IVMode *IV) {
static uint8_t VoltCurrentSwitch = 0;
static uint8_t PreviousGain = I_GAIN_100R;
uint16_t ADC_measure = 0;
if(VoltCurrentSwitch < 5){
ReadCurrent(spi_ADC_rxbuf);
VoltCurrentSwitch ++;
}
else if(VoltCurrentSwitch == 5){
// read current
if(INSTRUCTION.AutoGainEnable){
IV->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
if(PreviousGain != INSTRUCTION.ADCGainLevel){
PreviousGain = INSTRUCTION.ADCGainLevel;
IV->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
IV->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
}
if(PreviousGain != INSTRUCTION.ADCGainLevel){
PreviousGain = INSTRUCTION.ADCGainLevel;
IV->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
IV->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
}
}
else{
ReadCurrent(spi_ADC_rxbuf);
IV->_MeasureData = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
VoltCurrentSwitch ++;
}
// else if(VoltCurrentSwitch < 9){
// // read volt
// ReadVolt(spi_ADC_rxbuf);
// VoltCurrentSwitch++;
// }
// else if(VoltCurrentSwitch == 9){
// /** read battery voltage **/
// ReadVolt(spi_ADC_rxbuf);
// ADC_measure = (uint16_t) (spi_ADC_rxbuf[0] << 8) | (uint16_t) (spi_ADC_rxbuf[1]);
// IV->MeasureVolt = DecodeADCVolt(ADC_measure);
// VoltCurrentSwitch++;
// }
else if(VoltCurrentSwitch < 9){
if(IV->_VoVi_Switch == 0x01){
// read vin volt
ReadVolt(spi_ADC_rxbuf);
}else if(IV->_VoVi_Switch == 0x00){
// read vout volt
ReadVoutVolt(spi_ADC_rxbuf);
}
VoltCurrentSwitch++;
}
else if(VoltCurrentSwitch == 9){
if(IV->_VoVi_Switch == 0x01){
// read vin volt
ReadVolt(spi_ADC_rxbuf);
ADC_measure = (uint16_t) (spi_ADC_rxbuf[0] << 8) | (uint16_t) (spi_ADC_rxbuf[1]);
IV->MeasureVolt = DecodeADCVolt(ADC_measure);
}else if(IV->_VoVi_Switch == 0x00){
// read vout volt
ReadVoutVolt(spi_ADC_rxbuf);
ADC_measure = (uint16_t) (spi_ADC_rxbuf[0] << 8) | (uint16_t) (spi_ADC_rxbuf[1]);
IV->MeasureVolt = DecodeADCVoutVolt(ADC_measure);
}
VoltCurrentSwitch++;
}
else if (VoltCurrentSwitch < 13){
ReadBatVolt(spi_ADC_rxbuf);
VoltCurrentSwitch ++;
}
else if (VoltCurrentSwitch == 13){
// read battery volt
ReadBatVolt(spi_ADC_rxbuf);
ADC_measure = (uint16_t) (spi_ADC_rxbuf[0] << 8) | (uint16_t) (spi_ADC_rxbuf[1]);
IV->_MeasureBatvolt = DecodeADCBatVolt(ADC_measure);
IV->_MeasureBatvolt = IV->_MeasureBatvolt/10 - 250; // (5.00V) 5000->250 usercode
VoltCurrentSwitch ++;
}
else{
VoltCurrentSwitch = 0;
}
NotifyCurrent[0] = (uint8_t) (IV->_MeasureData >> 24);
NotifyCurrent[1] = (uint8_t) ((IV->_MeasureData & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((IV->_MeasureData & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (IV->_MeasureData & 0x000000FF);
if((IV->_VoVi_Switch == 0x01) || (IV->_VoVi_Switch == 0x00)){ //user see Vin || user see Vout
NotifyVolt[0] = (uint8_t) (IV->MeasureVolt >> 24);
NotifyVolt[1] = (uint8_t) ((IV->MeasureVolt & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((IV->MeasureVolt & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (IV->MeasureVolt & 0x000000FF);
if (IV->_VOrigin < IV->_VStop) {
if(IV->MeasureVolt >= ((int32_t) (IV->_VStop) - DAC_ZERO)/5){
PeriodicEvent = false;
DACReset = true;
}
}
else{
if(IV->MeasureVolt <= ((int32_t) (IV->_VStop) - DAC_ZERO)/5){
PeriodicEvent = false;
DACReset = true;
}
}
}
NotifyBatVolt = (uint8_t) (IV->_MeasureBatvolt & 0x000000FF);
}
#endif
@@ -2,11 +2,29 @@
#ifndef ELITEINSTRUCTION
#define ELITEINSTRUCTION
/** ADC gain level **/
#define GAIN_200K 0x00 // largest gain
#define GAIN_10K 0x01
#define GAIN_200R 0x02 // the least gain
#define GAIN_AUTO 0x03
/** Iin, Vin, Vout **/
#define IIN_ADC 0x00
#define VIN_ADC 0x01
#define VOUT_DAC 0x02
#define HIGH_Z 0x03
/** ADC Iin gain level **/
#define I_GAIN_3M 0x00 // largest gain
#define I_GAIN_100K 0x01
#define I_GAIN_3K 0x02
#define I_GAIN_100R 0x03 // the least gain
#define I_GAIN_AUTO 0x04
/** ADC Vin gain level **/
#define VIN_GAIN_1M 0x00
#define VIN_GAIN_30K 0x01
#define VIN_GAIN_1K 0x02
#define VIN_GAIN_AUTO 0x03
/** Vout gain level **/
#define VOUT_GAIN_240K 0x00
#define VOUT_GAIN_15K 0x01
#define VOUT_GAIN_AUTO 0x02
/** Resister meter **/
#define RESISTER_METER_SMALL 0x00
@@ -47,21 +65,28 @@ struct HEADSTAGE_INSTRUCTION {
uint16_t VoltOrigin;
uint16_t VoltFinal;
uint16_t Step;
uint16_t StepTime;
uint16_t StepTime;
// constant volt
// which is used in CC mode as VMax and VMin
uint16_t VoltConstant;
// voltage output gain
uint16_t VoutGainLevel;
/** ADC parameter **/
uint8_t ADCGainLevel;
uint8_t VinADCGainLevel;
uint8_t AutoGainEnable;
/** Notify parameter **/
uint16_t NotifyRate;
/** Constant Current Parameter **/
// Charge is a bool; true => current > 0, vice versa
uint8_t Charge;
int32_t ConstantCurrent;
uint16_t VoltLimit;
/** Resister Measure **/
uint8_t ResisterMeter;
@@ -71,6 +96,8 @@ struct HEADSTAGE_INSTRUCTION {
uint8_t CycleNumber;
uint8_t VoVi_Switch;
} INSTRUCTION = {0};
/*********************************************************************
@@ -89,15 +116,20 @@ static void InitEliteInstruction(){
INSTRUCTION.VoltOrigin = DAC_ZERO;
INSTRUCTION.VoltFinal = DAC_ZERO;
INSTRUCTION.Step = 0x0005; // 0x0005 = 1mV
INSTRUCTION.StepTime = STEPTIME_HALF_SEC; // about 0.5 sec
INSTRUCTION.StepTime = STEPTIME_ONE_SEC; // about 0.5 sec
INSTRUCTION.VoltConstant = DAC_ZERO; // is about 0V
INSTRUCTION.ADCGainLevel = GAIN_AUTO;
INSTRUCTION.VoutGainLevel = VOUT_GAIN_AUTO;
INSTRUCTION.ADCGainLevel = I_GAIN_AUTO;
INSTRUCTION.VinADCGainLevel = VIN_GAIN_AUTO;
INSTRUCTION.AutoGainEnable = 1;
INSTRUCTION.NotifyRate = STEPTIME_ONE_SEC/10;
INSTRUCTION.ResisterMeter = RESISTER_METER_LARGE;
INSTRUCTION.Charge = 1;
INSTRUCTION.ConstantCurrent = 0x00000000;
INSTRUCTION.VoltLimit = 0x0000;
INSTRUCTION.eliteFxn = 0; // default is a null event
INSTRUCTION.CycleNumber = 0;
INSTRUCTION.VoVi_Switch = 0x01; //VoVi_Switch == 0 => user see Vo / VoVi_Switch == 1 => user see Vi
}
/*********************************************************************
@@ -10,7 +10,7 @@ static bool TurnOnElite(uint8_t key) {
if (key == 0) {
// press 1 sec, power on LED
if (TurnOnCounter >= CLOCK_ONE_SECOND) {
PIN_setOutputValue(pin_handle, enable_5v, 1); // enable 5V
PIN15_setOutputValue(enable_5v, 1); // enable 5V
TurnOn10V();
LEDPowerON();
return true;
@@ -20,7 +20,7 @@ static bool TurnOnElite(uint8_t key) {
}
} else {
TurnOnCounter = 0;
PIN_setOutputValue(pin_handle, enable_5v, 0); // enable 5V
PIN15_setOutputValue(enable_5v, 0); // enable 5V
return false;
}
}
@@ -40,7 +40,7 @@ static void EliteKeyPress(uint8_t key) {
// press 3~4 sec, shutdown 2650
else if (ShutDownCounter > (CLOCK_ONE_SECOND*3) ) {
LED_color(DARKLED, 0xFF, 0xFF, 0x00);
PIN_setOutputValue(pin_handle, enable_5v, 0); // disable 5V
PIN15_setOutputValue(enable_5v, 0); // disable 5V
}
ShutDownCounter ++;
} else {
@@ -63,7 +63,7 @@ static void EliteKeyPress(uint8_t key) {
static void TurnOn10V() {
If10Von = true;
PIN_setOutputValue(pin_handle, enable_10v, 1);
PIN15_setOutputValue(enable_10v, 1);
CPUdelay(8000);
}
@@ -69,6 +69,10 @@ static void WorkModeLED() {
WORKLED();
break;
}
case READ_VOUT_VALUE: {
WORKLED();
break;
}
default: {
LEDPowerON();
@@ -0,0 +1,16 @@
#ifndef ELITE_LATCH_INIT
#define ELITE_LATCH_INIT
static void InitLH() {
for (int i=0; i<LATCH_BUFF_SIZE; i++) {
LH.LATCH0[i] = 0;
LH.LATCH1[i] = 0;
LH.LATCH2[i] = 0;
}
LH.LoadState = 0;
}
#endif
@@ -24,6 +24,7 @@ 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 NotifyBatVolt = 0;
/**
* counter of notify send.
@@ -106,6 +107,35 @@ static void SendNotify() {
// cyclic voltametry cycle number
not_buf[17] = INSTRUCTION.CycleNumber;
//battery volt
not_buf[18] = NotifyBatVolt;
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
}
static void FlushNotify(){
not_buf[0] = INSTRUCTION.chip_id;
for (int i = 0; i < 4; i++) {
not_buf[i + 1] = 0;
not_buf[i + 5] = 0;
not_buf[i + 9] = 0;
}
// 1 Timestamp = 32 usec; 31 Timestamp ~= 1 msec
not_time_stamp = 0; // msec
not_buf[13] = not_time_stamp & 0xff;
not_buf[14] = (not_time_stamp >> 8) & 0xff;
not_buf[15] = (not_time_stamp >> 16) & 0xff;
not_buf[16] = (not_time_stamp >> 24) & 0xff;
// cyclic voltametry cycle number
not_buf[17] = 0x00;
//battery volt
not_buf[18] = 0x00;
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
}
@@ -0,0 +1,22 @@
#ifndef ELITERVout
#define ELITERVout
static void RVout_Plot(RVoutMode *RVout) {
// ADC gain is don't care when measuring voltage
INSTRUCTION.ADCGainLevel = I_GAIN_100R;
ADCGainControl(INSTRUCTION.ADCGainLevel);
// read ADC VoutVolt
ReadVoutVolt(spi_ADC_rxbuf);
// decode ADC value and put it into notify buffer
RVout->_MeasureData = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_DAC, spi_ADC_rxbuf);
NotifyVolt[0] = (uint8_t) (RVout->_MeasureData >> 24);
NotifyVolt[1] = (uint8_t) ((RVout->_MeasureData & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((RVout->_MeasureData & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (RVout->_MeasureData & 0x000000FF);
}
#endif
@@ -5,6 +5,7 @@
static void reset() {
InitFlag();
InitCT();
InitLH();
// IV/CV mode reset
DiscardIVFirstData = 0;
@@ -43,21 +44,24 @@ static void reset() {
not_buf[i] = 0;
}
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
PIN15_setOutputValue(ADC_CS, 1); // ADC_CS HIGH
PIN15_setOutputValue(DAC_CS, 1); // DAC_CS HIGH
CPUdelay(1600);
}
static void Eliteinterrupt() {
InitFlag();
InitCT();
InitLH();
// IV/CV mode reset
DiscardIVFirstData = 0;
avg_number = 0;
ADCRealCurrent_long = 0;
// ADCGainControl(INSTRUCTION.ADCGainLevel);
// DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
ADCGainControl(I_GAIN_AUTO);
VinADCGainControl(VIN_GAIN_AUTO);
VoutGainControl(VOUT_GAIN_15K);
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
LEDPowerON();
for (int i = 0; i < BLE_INS_BUFF_SIZE; i++) {
@@ -83,8 +87,8 @@ static void Eliteinterrupt() {
not_buf[i] = 0;
}
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
PIN15_setOutputValue(ADC_CS, 1); // ADC_CS HIGH
PIN15_setOutputValue(DAC_CS, 1); // DAC_CS HIGH
CPUdelay(8000);
}
@@ -92,6 +96,7 @@ static void CleanBuffer() {
InitFlag();
InitEliteInstruction();
InitCT();
InitLH();
DiscardIVFirstData = 0;
avg_number = 0;
ADCRealCurrent_long = 0;
@@ -115,8 +120,8 @@ static void CleanBuffer() {
not_buf[i] = 0;
}
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
PIN15_setOutputValue(ADC_CS, 1); // ADC_CS HIGH
PIN15_setOutputValue(DAC_CS, 1); // DAC_CS HIGH
CPUdelay(8000);
}
@@ -36,6 +36,8 @@ static SPI_Params spiParams1;
static SPI_Transaction LED_transaction;
static SPI_Transaction ADC_DAC_transaction;
static void ELITE15_SPI_HOLD();
static void ELITE15_SPI_CLOSE();
static void Elite_SPI_init(){
SPI_init();
@@ -55,34 +57,65 @@ static void Elite_SPI_init(){
}
static void LED_SPI(uint8_t length, uint16_t *spi_txbuf, uint16_t *spi_rxbuf) {
ELITE15_SPI_HOLD();
LED_transaction.count = length;
LED_transaction.txBuf = spi_txbuf;
LED_transaction.rxBuf = spi_rxbuf;
SPI_transfer(spiHandle0, &LED_transaction);
ELITE15_SPI_CLOSE();
}
static void ADC_SPI(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
ELITE15_SPI_HOLD();
PIN_setOutputValue(pin_handle, D6, 0); // CS_ADC
ADC_DAC_transaction.count = length;
ADC_DAC_transaction.txBuf = spi_txbuf;
ADC_DAC_transaction.rxBuf = spi_rxbuf;
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
PIN_setOutputValue(pin_handle, ADC_CS, 0); // ADC_CS LOW
SPI_transfer(spiHandle1, &ADC_DAC_transaction);
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
PIN_setOutputValue(pin_handle, D6, 1); // CS_ADC
ELITE15_SPI_CLOSE();
}
static void DAC_SPI(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
ADC_DAC_transaction.count = length;
ADC_DAC_transaction.txBuf = spi_txbuf;
ADC_DAC_transaction.rxBuf = spi_rxbuf;
ELITE15_SPI_HOLD();
PIN_setOutputValue(pin_handle, D7, 0); // CD_DAC
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
PIN_setOutputValue(pin_handle, DAC_CS, 0); // DAC_CS LOW
SPI_transfer(spiHandle1, &ADC_DAC_transaction);
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
ADC_DAC_transaction.count = length;
ADC_DAC_transaction.txBuf = spi_txbuf;
ADC_DAC_transaction.rxBuf = spi_rxbuf;
SPI_transfer(spiHandle1, &ADC_DAC_transaction);
PIN_setOutputValue(pin_handle, D7, 1); // CD_DAC
ELITE15_SPI_CLOSE();
}
static void ELITE15_SPI_HOLD() {
PIN_setOutputValue(pin_handle, LOAD0, 1);
PIN_setOutputValue(pin_handle, LOAD1, 0);
PIN_setOutputValue(pin_handle, LOAD2, 0);
PIN_setOutputValue(pin_handle, D4, 1); // HOLD_MEM
PIN_setOutputValue(pin_handle, D5, 1); // CS_MEM
PIN_setOutputValue(pin_handle, D6, 1); // CS_ADC
PIN_setOutputValue(pin_handle, D7, 1); // CD_DAC
Elite_SPI_init();
}
static void ELITE15_SPI_CLOSE() {
PIN_setOutputValue(pin_handle, D4, 1); // HOLD_MEM
PIN_setOutputValue(pin_handle, D5, 1); // CS_MEM
PIN_setOutputValue(pin_handle, D6, 1); // CS_ADC
PIN_setOutputValue(pin_handle, D7, 1); // CD_DAC
PIN_setOutputValue(pin_handle, LOAD0, 0);
PIN_setOutputValue(pin_handle, LOAD1, 0);
PIN_setOutputValue(pin_handle, LOAD2, 0);
SPI_close(spiHandle0);
SPI_close(spiHandle1);
}
#endif // ELITE_SPI
@@ -4,19 +4,19 @@
static void VT_Plot(VTMode *VT) {
// ADC gain is don't care when measuring voltage
uint8_t ADCGain = 0;
INSTRUCTION.ADCGainLevel = I_GAIN_100R;
ADCGainControl(INSTRUCTION.ADCGainLevel);
// read ADC volt
ReadVolt(spi_ADC_rxbuf);
// decode ADC value and put it into notify buffer
VT->SetMeasureData((struct Measure *) VT, DecodeADCValue(ADCGain, ADC_CH_VOLT, spi_ADC_rxbuf));
VT->_MeasureData = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
int32_t ADCRealVolt = VT->GetMeasureData((struct Measure *) VT);
NotifyVolt[0] = (uint8_t) (ADCRealVolt >> 24);
NotifyVolt[1] = (uint8_t) ((ADCRealVolt & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((ADCRealVolt & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (ADCRealVolt & 0x000000FF);
NotifyVolt[0] = (uint8_t) (VT->_MeasureData >> 24);
NotifyVolt[1] = (uint8_t) ((VT->_MeasureData & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((VT->_MeasureData & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (VT->_MeasureData & 0x000000FF);
}
#endif
@@ -46,21 +46,22 @@
#define VT_CURVE 0b01010000
#define IT_CURVE 0b01100000
#define SET_SAMPLE_RATE 0b01110000
#define SET_ADC_GAIN 0b10000000
#define SET_VIN_ADC_GAIN 0b10010000
#define DIFFERENTIAL_PULSE_VOLTAMMETRY 0b10100000
#define SQUARE_WAVE_VOLTAMMETRY 0b10110000
#define POTENTIAL_STATE 0b11000000
#define CONSTANT_CURRENT 0b11010000
#define SET_RESISTER_LEVEL 0b11100000
#define READ_VOUT_VALUE 0b11100000
static bool Free_Work_Mode = false;
typedef void (*InitWorkData) ();
/***** Template of Measure and VoltOut parameter *****/
#define MEASURE \
int32_t _MeasureData; \
void (*SetMeasureData) (struct Measure *, int32_t); \
int32_t (*GetMeasureData) (struct Measure *)
int32_t _MeasureData; \
uint16_t _VoVi_Switch
// void (*SetMeasureData) (struct Measure *, int32_t); \
// int32_t (*GetMeasureData) (struct Measure *)
/* VoltOut is an UserCode */
/* VOrigin, VStop, Step are all UserCode */
@@ -84,6 +85,35 @@ typedef void (*InitWorkData) ();
// void (*SetCycleNumber) (struct VoltOutPara *, uint16_t); \
// uint16_t (*GetCycleNumber) (struct VoltOutPara *)
/* 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 \
MEASURE; \
uint8_t Charge; \
int32_t BatteryV; \
int32_t value; \
uint16_t Done; \
uint16_t VMax; \
uint16_t VMin; \
int32_t (*_Transform2RealnA)(struct CCModePara *)
#define LIMIT \
uint32_t _LimitValue; \
void (*SetLimitValue) (struct Limit *, uint32_t); \
@@ -100,17 +130,21 @@ struct VoltOutPara{
struct Limit{
LIMIT;
};
struct CCModePara{
CC_PARA;
};
/***** End of Measure and VoltOut parameter *****/
/***** Measure Only Mode *****/
void _SetMeasureData(struct Measure *self, int32_t Data){
self->_MeasureData = Data;
}
int32_t _GetMeasureData(struct Measure *self){
return self->_MeasureData;
}
//void _SetMeasureData(struct Measure *self, int32_t Data){
// self->_MeasureData = Data;
//}
//
//int32_t _GetMeasureData(struct Measure *self){
// return self->_MeasureData;
//}
/**** Limit Mode ****/
@@ -131,8 +165,8 @@ typedef struct _ITMode{
ITMode * InitITMode(){
ITMode *ret = malloc(sizeof(ITMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
// ret->SetMeasureData = &_SetMeasureData;
// ret->GetMeasureData = &_GetMeasureData;
ret->_LimitValue = 0;
@@ -150,62 +184,76 @@ typedef struct _VTMode{
VTMode * InitVTMode(){
VTMode *ret = malloc(sizeof(VTMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
// ret->SetMeasureData = &_SetMeasureData;
// ret->GetMeasureData = &_GetMeasureData;
return ret;
}
/* End of VT Mode Data */
/* ReadVOut Mode Data */
typedef struct _RVoutMode{
MEASURE;
}RVoutMode;
RVoutMode * InitRVoutMode(){
RVoutMode *ret = malloc(sizeof(RVoutMode));
ret->_MeasureData = 0;
// ret->SetMeasureData = &_SetMeasureData;
// ret->GetMeasureData = &_GetMeasureData;
return ret;
}
/* End of ReadVOut Mode Data */
/***** End of Measure Only Mode *****/
/**** VoltOut Only Mode ****/
// VoltOut
void _SetVoltOut(struct VoltOutPara *self, uint16_t VoltOut){
self->_VoltOut = VoltOut;
}
uint16_t _GetVoltOut(struct VoltOutPara *self){
return self->_VoltOut;
}
// VOrigin
void _SetVOrigin(struct VoltOutPara *self, uint16_t VOrigin){
self->_VOrigin = VOrigin;
}
uint16_t _GetVOrigin(struct VoltOutPara *self){
return self->_VOrigin;
}
// VStop
void _SetVStop(struct VoltOutPara *self, uint16_t VStop){
self->_VStop = VStop;
}
uint16_t _GetVStop(struct VoltOutPara *self){
return self->_VStop;
}
// Step
void _SetStep(struct VoltOutPara *self, uint16_t Step){
self->_Step = Step;
}
uint16_t _GetStep(struct VoltOutPara *self){
return self->_Step;
}
// StepTime
void _SetStepTime(struct VoltOutPara *self, uint16_t StepTime){
self->_StepTime = StepTime;
}
uint16_t _GetStepTime(struct VoltOutPara *self){
return self->_StepTime;
}
// CycleNumber
void _SetCycleNumber(struct VoltOutPara *self, uint16_t CycleNumber){
self->_CycleNumber = CycleNumber;
}
uint16_t _GetCycleNumber(struct VoltOutPara *self){
return self->_CycleNumber;
}
//// VoltOut
//void _SetVoltOut(struct VoltOutPara *self, uint16_t VoltOut){
// self->_VoltOut = VoltOut;
//}
//uint16_t _GetVoltOut(struct VoltOutPara *self){
// return self->_VoltOut;
//}
//
//// VOrigin
//void _SetVOrigin(struct VoltOutPara *self, uint16_t VOrigin){
// self->_VOrigin = VOrigin;
//}
//uint16_t _GetVOrigin(struct VoltOutPara *self){
// return self->_VOrigin;
//}
//
//// VStop
//void _SetVStop(struct VoltOutPara *self, uint16_t VStop){
// self->_VStop = VStop;
//}
//uint16_t _GetVStop(struct VoltOutPara *self){
// return self->_VStop;
//}
//
//// Step
//void _SetStep(struct VoltOutPara *self, uint16_t Step){
// self->_Step = Step;
//}
//uint16_t _GetStep(struct VoltOutPara *self){
// return self->_Step;
//}
//
//// StepTime
//void _SetStepTime(struct VoltOutPara *self, uint16_t StepTime){
// self->_StepTime = StepTime;
//}
//uint16_t _GetStepTime(struct VoltOutPara *self){
// return self->_StepTime;
//}
//
//// CycleNumber
//void _SetCycleNumber(struct VoltOutPara *self, uint16_t CycleNumber){
// self->_CycleNumber = CycleNumber;
//}
//uint16_t _GetCycleNumber(struct VoltOutPara *self){
// return self->_CycleNumber;
//}
/* VoltOut Mode Data */
@@ -244,15 +292,17 @@ VoltOutMode *InitVoltOutMode(){
/* IV Mode Data */
typedef struct _IVMode{
MEASURE;
int32_t MeasureVolt;
VOUT_PARA;
LIMIT;
int32_t _MeasureBatvolt;
}IVMode;
IVMode *InitIVMode(){
IVMode *ret = malloc(sizeof(IVMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
ret->MeasureVolt = (INSTRUCTION.VoltOrigin - DAC_ZERO)/5;
ret->_VoVi_Switch = INSTRUCTION.VoVi_Switch;
ret->_VoltOut = DAC_ZERO;
ret->_VOrigin = INSTRUCTION.VoltOrigin;
@@ -260,6 +310,8 @@ IVMode *InitIVMode(){
ret->_Step = INSTRUCTION.Step;
ret->_StepTime = INSTRUCTION.StepTime;
ret->_CycleNumber = 1;
ret->_MeasureBatvolt = 0;
// ret->SetVoltOut = &_SetVoltOut;
// ret->GetVoltOut = &_GetVoltOut;
@@ -291,8 +343,8 @@ typedef struct _RTMode{
RTMode * InitRTMode(){
RTMode *ret = malloc(sizeof(RTMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
// ret->SetMeasureData = &_SetMeasureData;
// ret->GetMeasureData = &_GetMeasureData;
ret->_VoltOut = DAC_ZERO; // 25000 is DAC_ZERO
ret->_VOrigin = DAC_ZERO;
@@ -320,14 +372,17 @@ RTMode * InitRTMode(){
/* CV Mode*/
typedef struct _CVMode{
MEASURE;
int32_t MeasureVolt;
VOUT_PARA;
int32_t _MeasureBatvolt;
}CVMode;
CVMode * InitCVMode(){
CVMode *ret = malloc(sizeof(CVMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
ret->_MeasureData = (INSTRUCTION.VoltOrigin- DAC_ZERO)/5;
// ret->SetMeasureData = &_SetMeasureData;
// ret->GetMeasureData = &_GetMeasureData;
ret->MeasureVolt = 20000;
ret->_VoltOut = DAC_ZERO; // 25000 is DAC_ZERO
ret->_VOrigin = INSTRUCTION.VoltOrigin;
@@ -335,7 +390,8 @@ CVMode * InitCVMode(){
ret->_Step = INSTRUCTION.Step;
ret->_StepTime = INSTRUCTION.StepTime; // STEPTIME_ONE_SEC
ret->_CycleNumber = INSTRUCTION.CycleNumber;
ret->_VoVi_Switch = INSTRUCTION.VoVi_Switch;
ret->_MeasureBatvolt = 0;
// ret->SetVoltOut = &_SetVoltOut;
// ret->GetVoltOut = &_GetVoltOut;
// ret->SetVOrigin = &_SetVOrigin;
@@ -353,11 +409,9 @@ CVMode * InitCVMode(){
/*End of CV Mode*/
/* Const Current Mode */
#define CC_ZERO_POINT 1500000
#define CC_ZERO_POINT 0
#define MAX_DAC_UC 50000
#define MIN_DAC_UC 0
#define CURRENT_LV_ONE 1
#define CURRENT_LV_ZERO 0
/*********************************************************************
* @struct Constant Current Code
@@ -365,40 +419,7 @@ CVMode * InitCVMode(){
* @brief A struct to handle CC mode command
*/
typedef struct _CCMode{
// measure value
MEASURE; // current
int32_t BatteryV;
/** Experience Setting **/
/** current value **/
// current value divide current level into 3,000,001 pieces
// 1,500,000 is zero point
int32_t value;
/** ADC level range: 0-2 **/
// constant current value will decide ADC gain level
// if |1500000 - value| > 10000 (+-100 uA) => lv = GAIN_200R
// else if |1500000 - valule| > 1000 (+-10 uA) => lv = GAIN_10K
// else lv = GAIN_200K
uint8_t lv;
/* Vmax and Vmin */
// Vmax protect battery charge
// Vmin protect battery discharge
// uint = mV
uint16_t VMax;
uint16_t VMin;
/* Charge/Discharge Current */
int32_t ChargeCurrent;
int32_t DischargeCurrent;
uint8_t CycleNumber;
bool StandBy;
uint32_t StandByTime;
/** transform a current user code (IUC) to real current in nA **/
int32_t (*_Transform2RealnA)(struct _CCMode *);
CC_PARA;
}CCMode;
/*********************************************************************
@@ -410,23 +431,58 @@ typedef struct _CCMode{
*
* @return an int32_t current value in nA
*/
int32_t _Transform2RealnA(CCMode *self){
int32_t _Transform2RealnA(struct CCModePara *self){
int32_t IUCReal;
// self->value : 0 ~ 3000000 (which is -1500000 ~ 1500000 (10nA) )
IUCReal = (self->value - CC_ZERO_POINT) * 10;
// 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;
}
CCMode * InitCCMode(){
CCMode *ret = malloc(sizeof(CCMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
ret->Charge = INSTRUCTION.Charge;
ret->BatteryV = 0;
ret->Done = 0;
ret->value = INSTRUCTION.ConstantCurrent;
ret->VMax = INSTRUCTION.VoltLimit + DAC_ZERO;
ret->VMin = INSTRUCTION.VoltLimit + DAC_ZERO;
ret->_Transform2RealnA = &_Transform2RealnA;
return ret;
}
/*End of Const Current Mode Mode*/
/* Cycle CC Mode */
typedef struct _CCCMode{
CC_PARA;
/* 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->_MeasureData = 0;
ret->Charge = 1;
ret->BatteryV = 0;
ret->value = CC_ZERO_POINT;
ret->lv = INSTRUCTION.ADCGainLevel;
ret->VMax = MAX_DAC_UC; // max DAC UserCode
ret->VMin = MIN_DAC_UC; // min DAC UserCode
ret->ChargeCurrent = 0;
@@ -437,23 +493,25 @@ CCMode * InitCCMode(){
ret->_Transform2RealnA = &_Transform2RealnA;
return ret;
}
/*End of Const Current Mode Mode*/
/* End of Cycle CC Mode */
/** Potential State Mode **/
typedef struct _PS{
// measure
MEASURE; // circuit current
int32_t ReferenceVolt;
int32_t _MeasureVolt;
VOUT_PARA;
}PSMode;
PSMode *InitPSMode(){
PSMode *ret = malloc(sizeof(PSMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
// ret->SetMeasureData = &_SetMeasureData;
// ret->GetMeasureData = &_GetMeasureData;
ret->ReferenceVolt = 0;
ret->_MeasureVolt = INSTRUCTION.VoltOrigin;
ret->_VoltOut = DAC_ZERO; // 25000 is DAC_ZERO
ret->_VOrigin = INSTRUCTION.VoltOrigin;
@@ -479,7 +537,11 @@ typedef union _WorkMode{
CVMode *CV;
RTMode *RT;
CCMode *CC;
// CCCMode *CCC;
PSMode *PS;
//test mode
RVoutMode *RVout;
}WorkMode;
WorkMode *CreateWorkMode(){
@@ -510,7 +572,12 @@ void InitWorkMode(WorkMode *WM){
case CONSTANT_CURRENT:
WM->CC = InitCCMode();
break;
// case CYCLE_CONSTANT_CURRENT:
// WM->CCC = InitCCCMode();
// break;
case READ_VOUT_VALUE:
WM->RVout = InitRVoutMode();
break;
default:
WM->VT = InitVTMode();
break;
@@ -561,6 +628,20 @@ void FreeWorkMode(WorkMode *WM){
WM->CC = NULL;
}
break;
case READ_VOUT_VALUE:
if(WM->RVout != NULL){
free(WM->RVout);
WM->RVout = NULL;
}
break;
// case CYCLE_CONSTANT_CURRENT:
// if(WM->CCC != NULL){
// free(WM->CCC);
// WM->CCC = NULL;
// }
// break;
default:
if(WM->IV != NULL){
free(WM->IV);
@@ -11,16 +11,16 @@ static void ZT_notify(int32_t impedance);
// => get a R-T curve (with resolution = 1 sample/volt step )
static void ZT_Plot(RTMode *RT) {
// 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 uint16_t CurrentMeasure=0, VoltMeasure=0;
// uint8_t SPICurrent[SPI_ADC_SIZE]={0}, SPIVolt[SPI_ADC_SIZE]={0};
// static uint8_t VoltCurrentSwitch = 0;
int32_t volt_32 = 0;
int32_t current_32 = 0;
int32_t resister_32 = 0;
if(INSTRUCTION.AutoGainEnable){
current_32 = AutoGainReadCurrent(SPICurrent);
current_32 = AutoGainReadCurrent(spi_ADC_rxbuf);
}
else{
ReadCurrent(spi_ADC_rxbuf);
@@ -33,6 +33,7 @@ static void ZT_Plot(RTMode *RT) {
// VoltMeasure = (uint16_t) (SPIVolt[0] << 8) | (uint16_t) (SPIVolt[1]);
// volt_32 = DecodeADCVolt(VoltMeasure)*1e4;
resister_32 = volt_32 / current_32;
volt_32 = volt_32 / 1e4;
NotifyVolt[0] = (uint8_t) (volt_32 >> 24);
NotifyVolt[1] = (uint8_t) ((volt_32 & 0x00FF0000) >> 16);
@@ -8,50 +8,102 @@
/* SPI Board */
#define Board_SPI0_MISO PIN_UNASSIGNED
#define Board_SPI0_MOSI IOID_1
#define Board_SPI0_CLK IOID_0
#define Board_SPI0_MOSI D1
#define Board_SPI0_CLK D0
#define Board_SPI0_CS PIN_UNASSIGNED
#define Board_SPI1_MISO IOID_3
#define Board_SPI1_MOSI IOID_2
#define Board_SPI1_CLK IOID_4
#define Board_SPI1_MISO IOID_1
#define Board_SPI1_MOSI D3
#define Board_SPI1_CLK D2
#define Board_SPI1_CS PIN_UNASSIGNED
#define ADC_CS IOID_8
#define DAC_CS IOID_9
#define D0 IOID_3
#define D1 IOID_4
#define D2 IOID_5
#define D3 IOID_6
#define D4 IOID_7
#define D5 IOID_8
#define D6 IOID_9
#define D7 IOID_10
#define Turnon100R IOID_5
#define Turnon10K IOID_6
#define LOAD0 IOID_13
#define LOAD1 IOID_12
#define LOAD2 IOID_11
#define ADC_CS LOAD0, D6
#define DAC_CS LOAD0, D7
#define ADC_DAC_SPI_MOSI LOAD0, D3
#define ADC_DAC_SPI_CLK LOAD0, D2
#define LED_MOSI LOAD0, D1
#define LED_CLK LOAD0, D0
#define MEM_HOLD LOAD0, D4
#define MEM_CS LOAD0, D5
#define Turnon_I_MID LOAD2, D0
#define Turnon_I_SMALL LOAD2, D4
#define Turnon_I_LARGE LOAD2, D1
#define Turnon_V_SMALL LOAD2, D2
#define Turnon_V_MID LOAD2, D3
#define Turon_VOUT_SMALL LOAD2, D7
//#define Turnon10K Turnon_I_MID
//#define Turnon200R Turnon_I_LARGE
/* I2C */
#ifdef ELITE_VERSION_1_4
#define Board_I2C0_SCL0 IOID_7
#define Board_I2C0_SDA0 IOID_1
#define Board_I2C0_SCL0 PIN_UNASSIGNED
#define Board_I2C0_SDA0 PIN_UNASSIGNED
#endif
#define shutdown_6994 IOID_10
#define switch_on IOID_11
#define enable_10v IOID_12
#define enable_5v IOID_13
#define shutdown_6994 LOAD2, D6
#define switch_on IOID_14
#define HIGH_Z_MODE LOAD2, D5
#define enable_10v LOAD1, D5
#define enable_5v LOAD1, D6
PIN_Handle pin_handle;
static PIN_State ZM_rst;
const PIN_Config BLE_IO[] = {
//
ADC_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // ADC_CS
DAC_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // DAC_CS
// D0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
// D1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
// D2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
// D3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
D4 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
D5 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
D6 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
D7 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
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
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,
LOAD0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
LOAD1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
LOAD2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
switch_on | PIN_INPUT_EN | PIN_PULLDOWN, // to sense switch
PIN_TERMINATE
};
static void add_elite_pin() {
// PIN_Status elite15_status;
PIN_add(pin_handle,
D0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL);
PIN_add(pin_handle,
D1 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL);
PIN_add(pin_handle,
D2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL);
PIN_add(pin_handle,
D3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL);
// if(elite15_status != PIN_SUCCESS) {
// LED_color(DARKLED, 0x0F, 0x0F, 0x0F);
// }
}
static void remove_elite_pin() {
PIN_close(pin_handle);
pin_handle = PIN_open(&ZM_rst, BLE_IO);
}
/*!
* @def BOOSTXL_CC2650MA_SPIName
* @brief Enum of SPI names on the CC2650 Booster Pack
@@ -59,7 +59,7 @@ VIS_FUH = 0b1001_0000 # 9x flush
VIS_INT = 0b0110_0000 # 6x interrupt
VIS_SHIFT_200K = 0b1010_0000 # Ax shift gear to 200K
VIS_SHIFT_10K = 0b1110_0000 # Ex shift gear to 10K
VIS_SHIFT_100R = 0b1000_0000 # 8x shift gear to 100R
VIS_SHIFT_200R = 0b1000_0000 # 8x shift gear to 100R
=========================
@@ -374,7 +374,7 @@ characteristic change event
#define HEADSTAGE_H
// product information
#define DEVICE_NAME "Elite-ZM-v1.4-re"
#define DEVICE_NAME "Elite-ZM-v1.5"
#define MAJOR_PRODUCT_NUMBER 0
#define MINOR_PRODUCT_NUMBER 2
#define MAJOR_VERSION_NUMBER 1
@@ -493,6 +493,18 @@ static uint8 channel_table[CHANNEL_COUNT] = {0};
static int8 channel_pointer = -1;
static uint8_t not_buf[BLE_DAT_BUFF_SIZE] = {0};
/**
* Latch initialize
*/
#define LATCH_BUFF_SIZE 8 // define latch
struct _LH{
bool LATCH0[LATCH_BUFF_SIZE];
bool LATCH1[LATCH_BUFF_SIZE];
bool LATCH2[LATCH_BUFF_SIZE];
uint8_t LoadState;
} LH= {0};
static void InitLH();
static void Init_Elite15_PIN();
/*=====================================
==== headstage function prototype ====
====================================*/
@@ -534,8 +546,10 @@ static void ADC_read(uint8_t *ADCdata);
static void ADC_test_read(uint8_t *ADCdata); // for auto shifting
static void ADCGainControl(uint8_t ADCLevel);
static void VinADCGainControl(uint8_t VinADCLevel);
static void ADCChannelSelect(uint8_t ADCChannel);
static int32_t DecodeADCVolt(uint16_t ADC_measure);
static int32_t DecodeADCVoutVolt(uint16_t ADC_measure);
static int32_t DecodeADCCurrent(uint8_t ADCGain, uint16_t ADC_measure);
static void Impedance_Calculate(uint16_t Voltage, int32_t Current);
static int32_t DecodeADCValue(uint8_t ADCGain, uint8_t ADCChannel, uint8_t *ADC_raw);
@@ -543,6 +557,7 @@ static void ADC_overflow(uint8_t gain, uint8_t *rawdata);
// DAC function
static uint16_t Usercode_Correction_to_DAC(uint16_t usercode);
static void VoutGainControl(uint8_t VOUTLevel);
// Elite key detection & turn on/ shutdown function
static void EliteKeyPress(uint8_t key);
@@ -576,7 +591,7 @@ static void set_update_instruction_callback(update_instruction_callback_type cal
#define VIS_INT 0b01100000
#define VIS_SHIFT_200K 0b10100000
#define VIS_SHIFT_10K 0b11100000
#define VIS_SHIFT_100R 0b10000000
#define VIS_SHIFT_200R 0b10000000
// real instruction
#define IV_CURVE 0b00010000
@@ -586,12 +601,13 @@ static void set_update_instruction_callback(update_instruction_callback_type cal
#define VT_CURVE 0b01010000
#define IT_CURVE 0b01100000
#define SET_SAMPLE_RATE 0b01110000
#define SET_ADC_GAIN 0b10000000
#define SET_ADC_DAC_GAIN 0b10000000
#define DIFFERENTIAL_PULSE_VOLTAMMETRY 0b10100000
#define SQUARE_WAVE_VOLTAMMETRY 0b10110000
#define POTENTIAL_STATE 0b11000000
#define CONSTANT_CURRENT 0b11010000
#define SET_RESISTER_LEVEL 0b11100000
#define READ_VOUT_VALUE 0b11100000
#define CYCLE_CONSTANT_CURRENT 0b11110000
// CIS instruction
@@ -604,7 +620,7 @@ static int32_t DAC_to_realV(uint16_t DACcode);
static uint16_t DACUserCode = 0x0000;
static uint32_t SampleRateTable[6] = {100, 1000, 10000, 50000, 100000, 1000000}; // 1 =>100 Hz, 10000=>0.01 Hz
static uint32_t SampleRateTable[6] = {100, 1000, 10000, 50000, 100000, 1000000}; // 100 =>100 Hz, 1000000=>0.01 Hz
// record value for IV curve to calculate average current
static uint8_t DiscardIVFirstData = 1;
@@ -624,16 +640,18 @@ static uint16_t PulseWidth_16;
static uint8_t PulsePeriod;
static uint16_t PulsePeriod_16;
// counter
struct _CT{
uint32_t SampleRate_counter;
uint16_t StepTimeCounter;
uint16_t NotifyCounter;
uint32_t StandByCounter;
}CT = {0};
static void InitFlag();
static void InitCT();
//static bool NotifyReady = false;
static void InitFlag();
#include "EliteWorkData.h"
// real instruction fxn
static uint16_t VoltScan(WorkMode *WorkModeData); // used in I-V and cyclic
@@ -643,6 +661,7 @@ static void DACCode2Real2Notify(uint16_t DACcode); // send notify voltage a
static void ZT_Plot(RTMode *RT);
static void VT_Plot(VTMode *VT);
static int32_t IT_PlotIT_Plot(WorkMode *WorkModeData);
static void RVout_Plot(RVoutMode *RVout);
// the following fxn do the same thing
// IVCurve_T is called if Vorigin > Vfinal, vice versa
@@ -658,6 +677,8 @@ static uint16_t DPVCurve(WorkMode *WorkModeData);
static uint16_t CVCurve(CVMode *CV);
static uint16_t SWVCurve(WorkMode *WorkModeData);
static void PIN15_setOutputValue (uint32_t latch_num, uint32_t pin_num, bool highlow);
static void reset();
static void Eliteinterrupt();
static void CleanBuffer();
@@ -673,6 +694,7 @@ static void TurnOn10V();
#include "EliteDAC.h"
#include "EliteSPI.h"
#include "Elite_PIN.h"
#include "Elite15_PIN.h"
#ifdef ELITE_VERSION_1_4
#include "EliteI2C.h"
@@ -681,6 +703,7 @@ static void TurnOn10V();
#include "EliteDeviceCorrection.h"
#include "EliteNotify.h"
#include "EliteFlagCTInit.h"
#include "EliteLatchInit.h"
#include "EliteReset.h"
#include "EliteLED.h"
#include "EliteKeyDetect.h"
@@ -690,7 +713,9 @@ static void TurnOn10V();
#include "EliteITCurve.h"
#include "EliteVTCurve.h"
#include "EliteZTCurve.h"
#include "EliteCCCMode.h"
#include "impedance_meter.h"
#include "EliteReadVout.h"
// update instruction for Z meter
static void update_ZM_instruction(uint8 *ins) {
@@ -713,25 +738,29 @@ static void update_ZM_instruction(uint8 *ins) {
// CleanBuffer();
INSTRUCTION.eliteFxn = IV_CURVE;
DACReset = true;
INSTRUCTION.SampleRate = 1000;
INSTRUCTION.SampleRate = 100;
if (ins[3] | ins[4]) {
// if (ins[3] | ins[4]) {
INSTRUCTION.VoltOrigin = ((uint16_t)(ins[3]) << 8) | (uint16_t)(ins[4]);
// INSTRUCTION.VoltOrigin = Usercode_Correction_to_DAC(INSTRUCTION.VoltOrigin);
}
if (ins[5] | ins[6]) {
// }
// if (ins[5] | ins[6]) {
INSTRUCTION.VoltFinal = ((uint16_t)(ins[5]) << 8) | (uint16_t)(ins[6]);
// INSTRUCTION.VoltFinal = Usercode_Correction_to_DAC(INSTRUCTION.VoltFinal);
}
// }
if (ins[7] | ins[8]) {
INSTRUCTION.Step = ((uint16_t)(ins[7]) << 8) | (uint16_t)(ins[8]);
INSTRUCTION.Step = StepCode2DACcode(INSTRUCTION.Step);
}
if (ins[9]) {
// if (ins[9]) {
INSTRUCTION.StepTime = ins[9];
INSTRUCTION.StepTime = OldStep2NewStepTime(INSTRUCTION.StepTime);
}
// }
// if(ins[10]) {
//INSTRUCTION.VoVi_Switch = ins[10];
INSTRUCTION.VoVi_Switch = 0x01;
// }
break;
}
@@ -767,6 +796,9 @@ static void update_ZM_instruction(uint8 *ins) {
if (ins[13]) {
PulseWidth = ins[13];
}
if(ins[14]) {
INSTRUCTION.VoVi_Switch = ins[14];
}
break;
}
@@ -798,6 +830,9 @@ static void update_ZM_instruction(uint8 *ins) {
if (ins[12]) {
PulseWidth = ins[12];
}
if ( ins[13]) {
INSTRUCTION.VoVi_Switch = ins[13];
}
break;
}
@@ -805,28 +840,32 @@ static void update_ZM_instruction(uint8 *ins) {
// CleanBuffer();
INSTRUCTION.eliteFxn = CV_CURVE;
DACReset = true;
INSTRUCTION.SampleRate = 1000;
INSTRUCTION.SampleRate = 500;
if (ins[3] | ins[4]) {
// if (ins[3] | ins[4]) {
INSTRUCTION.VoltOrigin = ((uint16_t)(ins[3]) << 8) | (uint16_t)(ins[4]);
// INSTRUCTION.VoltOrigin = Usercode_Correction_to_DAC(INSTRUCTION.VoltOrigin);
}
if (ins[5] | ins[6]) {
// }
// if (ins[5] | ins[6]) {
INSTRUCTION.VoltFinal = ((uint16_t)(ins[5]) << 8) | (uint16_t)(ins[6]);
// INSTRUCTION.VoltFinal = Usercode_Correction_to_DAC(INSTRUCTION.VoltFinal);
}
// }
if (ins[7] | ins[8]) {
INSTRUCTION.Step = ((uint16_t)(ins[7]) << 8) | (uint16_t)(ins[8]);
INSTRUCTION.Step = StepCode2DACcode(INSTRUCTION.Step);
}
if (ins[9]) {
// if (ins[9]) {
INSTRUCTION.StepTime = ins[9];
INSTRUCTION.StepTime = OldStep2NewStepTime(INSTRUCTION.StepTime);
}
// }
if (ins[10]) {
INSTRUCTION.CycleNumber = ins[10];
}
// if(ins[11]) {
//INSTRUCTION.VoVi_Switch = ins[11];
INSTRUCTION.VoVi_Switch = 0x01;
// }
break;
}
@@ -879,36 +918,70 @@ static void update_ZM_instruction(uint8 *ins) {
case CONSTANT_CURRENT:{
INSTRUCTION.eliteFxn = CONSTANT_CURRENT;
INSTRUCTION.SampleRate = 10;
INSTRUCTION.ConstantCurrent = ( (uint32_t) (ins[3])<<24 | (uint32_t) (ins[4])<<16 | (uint32_t) (ins[5])<<8 | (uint32_t) (ins[6]) );
INSTRUCTION.SampleRate = 2;
INSTRUCTION.Charge = ins[3];
INSTRUCTION.VoltLimit = ((uint16_t) ins[4] << 8) | ((uint16_t) ins[5]);
INSTRUCTION.ConstantCurrent = ( (uint32_t) (ins[6])<<24 | (uint32_t) (ins[7])<<16 | (uint32_t) (ins[8])<<8 | (uint32_t) (ins[9]) );
INSTRUCTION.NotifyRate = 1000;
// if(!INSTRUCTION.Charge){
// INSTRUCTION.VoltConstant = 50000;
// }
// GetInstructionParameter(ins+2);
// CCCurrent2IUC();
break;
}
case SET_ADC_GAIN: {
INSTRUCTION.ADCGainLevel = ins[3];
if(INSTRUCTION.ADCGainLevel != GAIN_AUTO){
INSTRUCTION.AutoGainEnable = 0;
}
else{
INSTRUCTION.AutoGainEnable = 1;
}
// if(INSTRUCTION.ADCGainLevel == GAIN_200R){
// LED_color(DARKLED, 0x0F, 0x00, 0x00);
// }
// else if(INSTRUCTION.ADCGainLevel == GAIN_10K){
// LED_color(DARKLED, 0x0F, 0x00, 0x0F);
// }
// else if(INSTRUCTION.ADCGainLevel == GAIN_200K){
// LED_color(DARKLED, 0x0F, 0x02, 0xFF);
// }
case CYCLE_CONSTANT_CURRENT:{
break;
}
case SET_ADC_DAC_GAIN: {
switch(ins[3]){
case IIN_ADC :{
INSTRUCTION.ADCGainLevel = ins[4];
if(INSTRUCTION.ADCGainLevel != I_GAIN_AUTO){
INSTRUCTION.AutoGainEnable = 0;
}
else{
INSTRUCTION.AutoGainEnable = 1;
}
break;
}
case VIN_ADC :{
INSTRUCTION.VinADCGainLevel = ins[4];
if(INSTRUCTION.ADCGainLevel != VIN_GAIN_AUTO){
INSTRUCTION.AutoGainEnable = 0;
}
else{
INSTRUCTION.AutoGainEnable = 1;
}
break;
}
case VOUT_DAC :{
INSTRUCTION.VoutGainLevel = ins[4];
if(INSTRUCTION.ADCGainLevel != VOUT_GAIN_AUTO){
INSTRUCTION.AutoGainEnable = 0;
}
else{
INSTRUCTION.AutoGainEnable = 1;
}
break;
}
default :{
break;
}
}
break;
}
case READ_VOUT_VALUE:{
// INSTRUCTION.ResisterMeter = ins[3];
INSTRUCTION.eliteFxn = READ_VOUT_VALUE;
/*uint8_t ReadVoutBuf[2] = {0};
case SET_RESISTER_LEVEL:{
INSTRUCTION.ResisterMeter = ins[3];
ADC_write(0xA4);
ADC_read(ReadVoutBuf);
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, 2, ReadVoutBuf);*/
break;
}
@@ -917,9 +990,41 @@ static void update_ZM_instruction(uint8 *ins) {
int32_t ADCRealValue = 0;
uint8_t CIS_buf[9] = {0};
switch(ins[3]) {
case IIN_ADC :{ // 0x00
ADCGainControl(ins[4]);
break;
}
case VIN_ADC :{ // 0x01
VinADCGainControl(ins[4]);
break;
}
case VOUT_DAC :{ // 0x02
VoutGainControl(ins[4]);
break;
}
case HIGH_Z :{ // 0x03
switch(ins[4]) {
case 0x00 :{
PIN15_setOutputValue(HIGH_Z_MODE, 0);
break;
}
case 0x01 :{
PIN15_setOutputValue(HIGH_Z_MODE, 1);
break;
}
default :{
break;
}
}
break;
}
default :{
break;
}
}
// for(int i=0 ; i<10 ; i++){
ADCGainControl(ins[3]);
ADCChannelSelect(ins[4]);
ADCChannelSelect(ins[3]);
CPUdelay(10);
ADC_read(spi_ADC_rxbuf);
// CPUdelay(10);
@@ -940,16 +1045,16 @@ static void update_ZM_instruction(uint8 *ins) {
// CIS_buf[4] = spi_ADC_rxbuf[3];
// decode ADC measure value
ADCRealValue = DecodeADCValue(ins[3], ins[4], spi_ADC_rxbuf);
ADCRealValue = DecodeADCValue(ins[4], ins[3], spi_ADC_rxbuf);
// test ADC output through CIS
if (ins[4] == ADC_CH_VOLT) {
if (ins[3] == ADC_CH_VOLT) {
// return ADC volt measure
CIS_buf[5] = (uint8_t)(ADCRealValue >> 24);
CIS_buf[6] = (uint8_t)((ADCRealValue & 0x00FF0000) >> 16);
CIS_buf[7] = (uint8_t)((ADCRealValue & 0x0000FF00) >> 8);
CIS_buf[8] = (uint8_t)(ADCRealValue & 0x000000FF);
} else if (ins[4] == ADC_CH_CURRENT) {
} else if (ins[3] == ADC_CH_CURRENT) {
// return ADC current measure
CIS_buf[5] = (uint8_t)(ADCRealValue >> 24);
CIS_buf[6] = (uint8_t)((ADCRealValue & 0x00FF0000) >> 16);
@@ -998,6 +1103,9 @@ static void update_ZM_instruction(uint8 *ins) {
}
case VIS_STI: {
for(int i=0 ; i<12 ; i++){
FlushNotify();
}
PeriodicEvent = true;
break;
}
@@ -1009,29 +1117,32 @@ static void update_ZM_instruction(uint8 *ins) {
case VIS_INT: {
Eliteinterrupt();
for(int i=0 ; i<12 ; i++){
FlushNotify();
}
break;
}
case VIS_SHIFT_200K: {
PIN_setOutputValue(pin_handle, Turnon10K, 0);
PIN_setOutputValue(pin_handle, Turnon100R, 0);
LED_color(DARKLED, 0xFF, 0xB4, 0x00);
break;
}
case VIS_SHIFT_10K: {
PIN_setOutputValue(pin_handle, Turnon10K, 1);
PIN_setOutputValue(pin_handle, Turnon100R, 0);
LED_color(DARKLED, 0x14, 0xC8, 0xFF);
break;
}
case VIS_SHIFT_100R: {
PIN_setOutputValue(pin_handle, Turnon10K, 0);
PIN_setOutputValue(pin_handle, Turnon100R, 1);
LED_color(DARKLED, 0xFF, 0xFF, 0xFF);
break;
}
// case VIS_SHIFT_200K: {
// PIN_setOutputValue(pin_handle, Turnon10K, 0);
// PIN_setOutputValue(pin_handle, Turnon200R, 0);
// LED_color(DARKLED, 0xFF, 0xB4, 0x00);
// break;
// }
//
// case VIS_SHIFT_10K: {
// PIN_setOutputValue(pin_handle, Turnon10K, 1);
// PIN_setOutputValue(pin_handle, Turnon200R, 0);
// LED_color(DARKLED, 0x14, 0xC8, 0xFF);
// break;
// }
//
// case VIS_SHIFT_200R: {
// PIN_setOutputValue(pin_handle, Turnon10K, 0);
// PIN_setOutputValue(pin_handle, Turnon200R, 1);
// LED_color(DARKLED, 0xFF, 0xFF, 0xFF);
// break;
// }
default: {
break;
@@ -41,18 +41,22 @@ static void ZM_update_instruction_callback(uint8_t ins_type, uint8_t chip_ID, ui
static void ZM_init() {
set_update_instruction_callback(ZM_update_instruction_callback);
// initialize
pin_handle = PIN_open(&ZM_rst, BLE_IO);
Init_Elite15_PIN();
PIN_setOutputValue(pin_handle, shutdown_6994, 1); // OFF = 1 => turn off 6994
PIN_setOutputValue(pin_handle, enable_10v, 0); // enable 10V
PIN15_setOutputValue(shutdown_6994, 1); // OFF = 1 => turn off 6994
PIN15_setOutputValue(enable_10v, 0); // enable 10V
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
PIN15_setOutputValue(ADC_CS, 1); // ADC_CS HIGH
PIN15_setOutputValue(DAC_CS, 1); // DAC_CS HIGH
PIN15_setOutputValue(MEM_CS, 1); // MEM_CS HIGH
PIN15_setOutputValue(HIGH_Z_MODE, 0); // HIGH Z MODE
InitEliteInstruction();
ADCGainControl(GAIN_AUTO);
ADCGainControl(I_GAIN_AUTO);
VinADCGainControl(VIN_GAIN_AUTO);
VoutGainControl(VOUT_GAIN_240K);
elite_gptimer_open();
// PIN_registerIntCb(pin_handle, switch_on_callback);
@@ -78,7 +82,8 @@ static void DACCode2Real2Notify(uint16_t DACcode) {
(INSTRUCTION.eliteFxn == IT_CURVE) || \
(INSTRUCTION.eliteFxn == VT_CURVE) || \
(INSTRUCTION.eliteFxn == ZT_CURVE) || \
(INSTRUCTION.eliteFxn == CONSTANT_CURRENT) \
(INSTRUCTION.eliteFxn == CONSTANT_CURRENT) || \
(INSTRUCTION.eliteFxn == READ_VOUT_VALUE) \
)
/*********************************************************************
@@ -131,14 +136,15 @@ static void SimpleBLEPeripheral_performPeriodicTask(WorkMode *WorkModeData) {
// Notify control, check if we need to send notify
EliteNotifyControl();
}
else if(INSTRUCTION.eliteFxn == VOLT_OUTPUT){
// assign WorkModeData->VO = INSTRUCTION.VoltConstant
WorkModeData->VO->_VoltOut = INSTRUCTION.VoltConstant;
// UserCode -> DAC code -> DAC out
DAC_outputV(Usercode_Correction_to_DAC(WorkModeData->VO->_VoltOut));
// DAC_outputV(Usercode_Correction_to_DAC(WorkModeData->VO->_VoltOut));
DAC_outputV(WorkModeData->VO->_VoltOut); // for voltage output calibration
FreeWorkMode(WorkModeData);
PeriodicEvent = false;
InitPeriodicEvent = true;
@@ -149,11 +155,26 @@ static void SimpleBLEPeripheral_performPeriodicTask(WorkMode *WorkModeData) {
}
static void EliteDACControl(WorkMode *WorkModeData) {
if ((INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE)) {
if (INSTRUCTION.eliteFxn == IV_CURVE) {
// output a certain voltage and put it into NotifyVolt
DACCode2Real2Notify(VoltScan(WorkModeData));
if(WorkModeData->IV->_VoVi_Switch == 0x00){ //user see Vout
//DACCode2Real2Notify(VoltScan(WorkModeData));
uint16_t DACcode;
DACcode = VoltScan(WorkModeData);
}
else if (WorkModeData->IV->_VoVi_Switch == 0x01){ //user see Vin
VoltScan(WorkModeData);
}
}
else if(INSTRUCTION.eliteFxn == CV_CURVE){
if (WorkModeData->CV->_VoVi_Switch == 0x00){
DACCode2Real2Notify(VoltScan(WorkModeData));
}
else if (WorkModeData->CV->_VoVi_Switch == 0x01){
VoltScan(WorkModeData);
}
}
else if (INSTRUCTION.eliteFxn == ZT_CURVE){
if(INSTRUCTION.ResisterMeter == RESISTER_METER_SMALL){
// output 1V
@@ -190,33 +211,48 @@ static void EliteADCControl(WorkMode *WorkModeData) {
if (CT.SampleRate_counter == INSTRUCTION.SampleRate - 1) {
switch (INSTRUCTION.eliteFxn) {
case IV_CURVE:{
IT_Plot(WorkModeData);
IV_Plot(WorkModeData->IV);
// IT_Plot(WorkModeData);
break;
}
case CV_CURVE:{
IT_Plot(WorkModeData);
CV_Plot(WorkModeData->CV);
break;
}
case IT_CURVE:{
IT_Plot(WorkModeData);
// NotifyReady = true;
break;
}
case VT_CURVE:{
// read volt through ADC and put it into notify buffer
VT_Plot(WorkModeData->VT);
// NotifyReady = true;
break;
}
case ZT_CURVE:{
ZT_Plot(WorkModeData->RT);
// NotifyReady = true;
break;
}
case CONSTANT_CURRENT:{
CCModeReadCurrent(WorkModeData->CC);
CCModeReverseCurrent(WorkModeData->CC);
// CCModeReverseCurrent(WorkModeData->CC);
break;
}
case READ_VOUT_VALUE:{
RVout_Plot(WorkModeData->RVout);
/*uint8_t ReadVoutBuf[2] = {0};
ADC_write(0xA4);
ADC_read(ReadVoutBuf);
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, 2, ReadVoutBuf);*/
break;
}
default:{
IT_Plot(WorkModeData);
// NotifyReady = true;
break;
}
}
@@ -229,7 +265,7 @@ static void EliteNotifyControl() {
if (!PeriodicEvent) {
SendNotify();
reset();
} else if (CT.StepTimeCounter == INSTRUCTION.StepTime - 1) {
} else if (CT.StepTimeCounter == INSTRUCTION.StepTime/2) {
SendNotify();
}
}
@@ -254,7 +290,6 @@ static uint16_t OldStep2NewStepTime(uint8_t StepTime) {
switch (StepTimeLevel) {
case 0: { //0.5 sec
LED_color(LIGHTLED, 0xFF, 0xFF, 0xFF);
return STEPTIME_HALF_SEC;
}
case 1: { //1 sec
@@ -548,9 +548,8 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
// Initialize application
SimpleBLEPeripheral_init();
headstage_init_device_info();
ZM_init();
Elite_SPI_init();
// Elite_SPI_init();
WorkMode *WorkModeData = CreateWorkMode();
uint8_t key = 0;
@@ -617,7 +616,7 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
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
PIN15_setOutputValue(shutdown_6994, 1); // OFF = 1 => turn off 6994
// #ifdef ELITE_VERSION_1_4
// SPI_close(spiHandle0);
// I2Cinit();
@@ -681,6 +680,7 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
}
#endif // FEATURE_OAD
}
}
/*********************************************************************