Compare commits

..

189 Commits

Author SHA1 Message Date
YiChin 6fae1f65a1 fix bug 2019-11-15 17:15:29 +08:00
YiChin 34355a1a4a fix bug 2019-11-15 17:01:03 +08:00
105042004 2e4a260e17 update PSCurve 2019-11-15 16:09:28 +08:00
105042004 c3f19359f1 temp save 2019-11-15 14:25:24 +08:00
105042004 bb28a594f3 temp save 2019-11-15 14:07:14 +08:00
105042004 8216bb7a70 temp save 2019-11-15 13:54:46 +08:00
105042004 ef920851db add PSCurve 2019-11-08 22:24:16 +08:00
weiting2 e1aa33e6cb [CC mode] read Vin 2019-11-08 13:34:32 +08:00
YiChin fb3060a220 [VT, IT] default sample rate 100
[CC] notify rate 10
2019-11-08 13:09:07 +08:00
weiting2 be40ac25dc [CC mode] read Vin 2019-11-08 12:44:39 +08:00
YiChin 5a29b161ac [CC mode] return Vin has trouble 2019-11-08 11:24:56 +08:00
weiting2 caee6602a8 add potential state mode 2019-11-07 15:15:50 +08:00
weiting2 12c4908881 [CC mode] Vmax, Vmin
[headstage] flag, counter init function
2019-11-07 14:30:26 +08:00
YiChin cb0b0fafd0 [CC mode] return Vout - I*R 2019-11-07 10:58:57 +08:00
YiChin 633b3424e1 CC mode can work with little error 2019-11-06 20:24:46 +08:00
weiting2 c75a147392 CC mode return Vin 2019-11-06 12:17:41 +08:00
YiChin 1e71de284c try to return Vin 2019-11-06 12:11:44 +08:00
weiting2 3bfadb0ea5 CC mode notify gone 2019-11-06 11:15:12 +08:00
YiChin a22a1aa656 Vout bug solved; no notify in CC 2019-11-06 11:05:22 +08:00
weiting2 ac8f1af1cc try fix Vout mode bug 2019-11-06 10:30:20 +08:00
YiChin 42b5edd2bf find error 2019-11-06 10:14:25 +08:00
weiting2 cafa70e740 try fix Vout mode bug 2019-11-06 10:01:58 +08:00
alan576 7ecc6063ac [CCMode] TODO list :VMax & VMin 2019-11-05 23:57:27 +08:00
alan576 1c5e586bd9 [CCMode] return Vin instead of VOut 2019-11-05 23:55:47 +08:00
alan576 9861067a17 [CCMode] check IUC-Measure value (step value) 2019-11-05 23:46:44 +08:00
alan576 295abacf7c Add notify counter 2019-11-05 23:40:56 +08:00
YiChin 6b5dfcc12a James test CCmode 2019-11-05 19:23:35 +08:00
weiting2 8aab5b5aab IV/CV mode current auto gain problem 2019-11-05 18:51:07 +08:00
YiChin 776e40b639 James test CCmode 2019-11-05 18:39:46 +08:00
weiting2 a97909625d IV/CV mode current auto gain problem 2019-11-05 17:18:37 +08:00
YiChin 259170af20 James test CCmode 2019-11-05 17:05:28 +08:00
YiChin b929433eef James test CCmode 2019-11-05 11:52:59 +08:00
weiting2 b166235c21 IV/CV mode current auto gain problem 2019-11-05 10:26:19 +08:00
YiChin 37ad0160d0 IV/CV auto gain should more smooth 2019-11-04 18:23:31 +08:00
weiting2 d40891396d IV/CV mode current auto gain problem 2019-11-04 17:21:29 +08:00
weiting2 4f31028d1a VO free WMD bug 2019-11-04 17:19:35 +08:00
weiting2 8727b7d2eb try to fix IV mode 2019-11-04 17:09:32 +08:00
weiting2 39e012de64 try to fix IV mode 2019-11-04 16:54:41 +08:00
weiting2 48e566dea4 try to fix IV mode 2019-11-04 13:27:44 +08:00
weiting2 3f617786ef try to fix IV mode 2019-11-04 12:11:13 +08:00
YiChin 080ca80f2b IV/CV has an auto gain prob 2019-11-04 11:47:16 +08:00
weiting2 4875bb271a try to fix IV mode 2019-11-04 11:43:31 +08:00
YiChin b0ac5bb6e6 IV/CV has an auto gain prob 2019-11-04 11:25:09 +08:00
YiChin 8b6a402d47 error fix 2019-11-04 10:11:56 +08:00
weiting2 aefb2cffbb Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-11-04 09:44:21 +08:00
weiting2 6934d858fe free WMD and NULL it 2019-11-04 09:44:07 +08:00
YiChin bc28dedc64 IVmode stop and call reset() 2019-11-01 19:30:30 +08:00
105042004 92b81cb47f check limit 2019-11-01 18:47:01 +08:00
105042004 e9b5414ab0 set _LimitVlaue to 1e5 2019-11-01 18:28:06 +08:00
YiChin d3f6a6521a fix ITmode bug 2019-11-01 18:23:58 +08:00
105042004 13efb6c32a add limit to IVmode 2019-11-01 17:35:04 +08:00
YiChin 18e4cac845 all mode can work 2019-11-01 14:07:04 +08:00
YiChin f6a474e537 error fix 2019-11-01 12:17:28 +08:00
weiting2 311bbdd809 test CCMode 2019-11-01 12:05:25 +08:00
weiting2 e47cf7c3db test CCMode 2019-11-01 11:57:09 +08:00
YiChin b27718a30f error fix 2019-11-01 11:46:12 +08:00
YiChin be79bec5e0 error fix 2019-11-01 11:28:14 +08:00
weiting2 a551eb1143 delete Set & Get QQQ 2019-11-01 11:21:03 +08:00
weiting2 ddc51481b8 Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-11-01 10:16:23 +08:00
weiting2 d8a567c607 WHY VStop so many problem?!!!!! 2019-11-01 10:16:07 +08:00
YiChin 776d8074b1 what's wrong with IV->SetVStop ? 2019-10-31 19:24:24 +08:00
YiChin e0f937be45 what's wrong with IV->SetVStop ? 2019-10-31 18:23:40 +08:00
weiting2 2d7bbb74aa WHY VStop so many problem?!!!!! 2019-10-31 18:02:20 +08:00
weiting2 03367a76cf set init value by SetValue fxn 2019-10-31 17:40:45 +08:00
YiChin 8fffec3116 debug Set & Get Fxn in IV 2019-10-31 16:46:16 +08:00
weiting2 d7210e3b5a set init value by SetValue fxn 2019-10-31 16:41:57 +08:00
weiting2 82834f30b0 remove static in union 2019-10-31 16:10:06 +08:00
weiting2 50fbaa5bc7 remove static in union 2019-10-31 16:02:51 +08:00
weiting2 696f6447dc debug IVMode DAC out 2019-10-31 15:51:39 +08:00
weiting2 60734c69b4 debug IVMode DAC out 2019-10-31 15:37:30 +08:00
weiting2 ddf22de09b Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-10-31 14:22:48 +08:00
weiting2 e169ed1d44 check IV init 2019-10-31 14:22:37 +08:00
YiChin 55759938da Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-10-31 13:47:06 +08:00
YiChin 45de2e6825 do not free WM 2019-10-31 13:46:54 +08:00
weiting2 4c0e7e2149 IT support both auto/non-auto mode 2019-10-31 13:46:15 +08:00
weiting2 b63989ca78 remember to free memory 2019-10-31 11:26:33 +08:00
weiting2 c2df81dd3b remember to free memory 2019-10-31 11:26:23 +08:00
YiChin 7d6a0ce845 error fix 2019-10-31 11:16:29 +08:00
weiting2 2c9105eb0a remember to free memory 2019-10-31 10:44:06 +08:00
weiting2 0d705b7d28 Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-10-30 19:03:17 +08:00
weiting2 266e597e19 add CCMode in OOC struct 2019-10-30 19:02:58 +08:00
105042004 92d49c1f93 change CV IV curve function 2019-10-30 19:00:54 +08:00
weiting2 c40adb3b64 add CCMode in OOC struct 2019-10-30 18:49:01 +08:00
weiting2 44e5f54c50 using union 2019-10-30 16:50:20 +08:00
weiting2 c642325859 using union 2019-10-30 16:35:57 +08:00
weiting2 c3adc55aec using union 2019-10-30 16:24:21 +08:00
weiting2 8700625d69 using union 2019-10-30 16:18:35 +08:00
weiting2 bc4dcfbe7d using union 2019-10-30 16:17:06 +08:00
weiting2 43170a4282 using union 2019-10-30 16:14:22 +08:00
weiting2 3652e19a3d using union 2019-10-30 16:03:27 +08:00
weiting2 36e6a47472 using union 2019-10-30 15:31:18 +08:00
weiting2 c71c55ecf1 using union 2019-10-30 14:48:00 +08:00
weiting2 57a5b2b4f5 Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-10-30 14:38:48 +08:00
weiting2 0da311941b malloc only once 2019-10-30 14:38:27 +08:00
105042004 7965a4cc1d rewrite small error 2019-10-30 14:32:18 +08:00
105042004 551f9de36b add LIMIT to IV mode 2019-10-30 14:29:34 +08:00
weiting2 fa8f0202e9 malloc only once 2019-10-30 12:23:08 +08:00
YiChin ee35c54dec should be stable 2019-10-29 14:58:24 +08:00
weiting2 031b98a6d5 VT/IT/VOut using OOC struct 2019-10-29 14:54:40 +08:00
weiting2 82ab990f0b VT/IT/VOut using OOC struct 2019-10-29 14:19:11 +08:00
weiting2 38774d9201 VT/IT/VOut using OOC struct 2019-10-29 14:14:34 +08:00
YiChin 6845963c8b should be stable 2019-10-29 12:30:28 +08:00
YiChin 4e4ce66318 bug fix 2019-10-29 12:26:26 +08:00
YiChin 6fe44a536f bug fix 2019-10-29 12:14:20 +08:00
YiChin 07272963bf bug fix 2019-10-29 12:14:04 +08:00
weiting2 80dbc64452 VT/IT/VOut using OOC struct 2019-10-29 12:04:49 +08:00
weiting2 3a8c5d843a VT/IT/VOut using OOC struct 2019-10-29 11:58:50 +08:00
weiting2 bf4baa8200 VT/IT/VOut using OOC struct 2019-10-29 11:53:34 +08:00
YiChin bf2b1b9d3e error fix 2019-10-29 11:52:22 +08:00
weiting2 03391b4fb3 VT/IT/VOut using OOC struct with unknown error 2019-10-29 11:43:33 +08:00
YiChin 9040e85dbb error fix 2019-10-29 11:39:23 +08:00
YiChin 85021a88b0 error fix 2019-10-29 11:34:55 +08:00
weiting2 a5df1c227e VT/IT/VOut using OOC struct 2019-10-29 11:18:16 +08:00
weiting2 8213d9fb19 VT/IT/VOut using OOC struct 2019-10-29 11:01:57 +08:00
YiChin 14c424571a Merge remote-tracking branch 'origin/Elite_OBJ_Version' into Elite_OBJ_Version 2019-10-29 09:57:26 +08:00
YiChin 8a94a57843 error fix 2019-10-29 09:56:50 +08:00
weiting2 a58f787253 VT/IT using OOC struct 2019-10-28 19:00:09 +08:00
weiting2 6c839b22d9 VT/IT using OOC struct 2019-10-28 17:53:49 +08:00
YiChin c086de7cf4 OOC compile pass 2019-10-28 17:31:25 +08:00
YiChin 3c5f4d9bb4 OOC error fix 2019-10-28 16:51:48 +08:00
weiting2 f3037c7959 OOC struct 2019-10-28 16:09:33 +08:00
YiChin 5a519d5fb5 OOC error fix 2019-10-28 16:07:06 +08:00
weiting2 a16543ee57 OOC struct 2019-10-28 12:41:59 +08:00
YiChin 9d281ce999 error fix 2019-10-28 12:06:44 +08:00
weiting2 d97b3ad6b0 OOC struct 2019-10-28 11:59:03 +08:00
YiChin cad1763981 error fix 2019-10-28 11:52:05 +08:00
weiting2 092c02940d OOC struct 2019-10-28 11:20:44 +08:00
weiting2 0a19abd0e8 first attempt to pointer of pointer 2019-10-24 12:10:08 +08:00
YiChin 284cfe6d05 double pointer attempt 2019-10-24 11:52:34 +08:00
weiting2 3298b6226b first attempt to pointer of pointer 2019-10-24 11:48:19 +08:00
YiChin dfcaf2d908 double pointer attempt 2019-10-24 11:45:00 +08:00
weiting2 d517318a67 first attempt to pointer of pointer 2019-10-24 11:36:59 +08:00
weiting2 d0aa520329 Merge branch 'Elite_master' of https://gitlab.com/bioproscientific/bioprocc2650 into Elite_master 2019-10-24 11:02:41 +08:00
weiting2 9a875b8459 first attempt to pointer of pointer 2019-10-24 10:59:19 +08:00
YiChin 73ac2f5c90 should be a stable version 2019-10-24 10:17:24 +08:00
YiChin efcb1132de auto gain seems done
need more test
2019-10-23 18:42:17 +08:00
YiChin 7492ed161d auto gain prob 2019-10-23 17:05:25 +08:00
YiChin ae7ec2e5ce auto gain prob 2019-10-23 16:42:28 +08:00
weiting2 63fde4bdbc TODO: IV CV add Imax 2019-10-23 14:04:35 +08:00
YiChin 32ccb8838f add water star data 2019-10-23 11:14:00 +08:00
YiChin 5b6fd53830 CV underflow done? 2019-10-23 10:42:53 +08:00
YiChin 86eef98b13 CV still underflow, implement auto gain on IV CV IT RT 2019-10-22 18:15:35 +08:00
YiChin 3fdbfcf39f CV still underflow 2019-10-22 15:25:41 +08:00
weiting2 847ea9f3c0 IV underflow 2019-10-22 14:56:01 +08:00
weiting2 25bd5b5ebe auto gain 2019-10-22 14:27:27 +08:00
YiChin 335fe6a9a4 IV CV still underflow 2019-10-22 12:28:48 +08:00
YiChin 6a0480613c fix CC mode feedback bug 2019-10-22 11:55:16 +08:00
YiChin 300fb9a44c fix IV CV underflow if Vfinal = -5V 2019-10-22 11:41:38 +08:00
weiting2 4fac2aa380 update board 21 2019-10-22 10:11:44 +08:00
YiChin d2ab4c1fe8 RT done, UI should X1e5 for every resister value 2019-10-21 19:01:24 +08:00
YiChin 6048e10ab7 RT done, UI should X1e5 for every resister value 2019-10-21 18:28:00 +08:00
weiting2 6bd94e3f73 gain switch in RT mode 2019-10-21 17:52:22 +08:00
YiChin fc302d4c75 should modify DAC usercode 2019-10-21 16:53:49 +08:00
weiting2 26a35a1446 gain switch in RT mode 2019-10-21 14:45:53 +08:00
YiChin 8f2eda7281 The least gain can not witch to max gain in one step 2019-10-21 12:20:44 +08:00
weiting2 e26a97a32f Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-10-21 11:38:49 +08:00
weiting2 5bdb0b04da gain switch in one cycle, debug 2019-10-21 11:38:31 +08:00
YiChin 8f8407601e error fix 2019-10-21 11:31:47 +08:00
YiChin 4c6dbcf98d error fix 2019-10-21 11:26:40 +08:00
weiting2 20ccd5de56 gain switch in one cycle 2019-10-21 11:24:59 +08:00
weiting2 3c3ad8ccc7 Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve
# Conflicts:
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteITCurve.h
2019-10-21 11:21:42 +08:00
weiting2 1030d6625b TODO: gain switch in one cycle 2019-10-21 11:20:46 +08:00
weiting2 326f3eb6b6 LED shows ADC gain state 2019-10-21 10:57:26 +08:00
YiChin 9dd7228eb5 clean warning 2019-10-21 10:51:13 +08:00
weiting2 59ac6b9909 add ReadCurrent() 2019-10-21 10:37:33 +08:00
YiChin e24ce8e5d5 auto gain done 2019-10-21 10:26:52 +08:00
weiting2 8720300bfc small-mid range gain switch test 2019-10-21 10:11:10 +08:00
weiting2 23fc75a236 small-mid range gain switch test 2019-10-18 18:06:13 +08:00
weiting2 80c25267cb all range auto scale 2019-10-18 17:49:31 +08:00
YiChin 81d1aff615 maybe auto gain should read data after circuit stable 2019-10-18 16:27:00 +08:00
weiting2 3221fe6492 largest and mid gain switch, considering negative current 2019-10-18 16:07:22 +08:00
weiting2 4ca7d5b681 try easy auto-scale ADC gain 2019-10-18 15:55:23 +08:00
weiting2 49677aa5b1 try easy auto-scale ADC gain 2019-10-18 15:30:46 +08:00
YiChin bbfef99a65 maybe auto gain should read data after circuit stable 2019-10-18 15:12:20 +08:00
weiting2 05f11fd147 try easy auto-scale ADC gain 2019-10-18 14:26:40 +08:00
YiChin f0aedf786d CC mode done 2019-10-17 18:15:37 +08:00
weiting2 a12146a479 CC mode bug fix 2019-10-17 16:26:55 +08:00
weiting2 410bef2e23 CC mode bug fix 2019-10-17 16:03:15 +08:00
YiChin 17c6a506cb error fix 2019-10-17 15:42:38 +08:00
weiting2 0b9c945aee change IUC and CC mode BT instruction 2019-10-17 15:08:31 +08:00
YiChin 53ef219d6e [CC] battery test perfect, should add +- current in UI 2019-10-17 11:38:53 +08:00
YiChin a14b2480db [CC] battery test perfect, should add +- current in UI 2019-10-17 11:11:25 +08:00
YiChin 89368d5352 CC mode mA done 2019-10-16 17:36:48 +08:00
YiChin f7903a0a31 CC mode earth 2019-10-16 17:03:24 +08:00
YiChin 56f42d21c5 CC mode earth 2019-10-16 17:01:15 +08:00
YiChin 52a8baad08 CC mode mA 2019-10-16 15:01:05 +08:00
YiChin 7acdbf6e78 [CC] seems done 2019-10-16 14:10:10 +08:00
YiChin 393394be6f [CC] seems done 2019-10-16 12:25:30 +08:00
YiChin b7f305e378 [CC] discharge fine, charge doesn't work 2019-10-16 11:50:26 +08:00
38 changed files with 2521 additions and 1674 deletions
@@ -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.1186623850" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.90032441">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.25923151" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.1369151231" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.223507680">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.732777020" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.CC2650F128"/>
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
@@ -34,17 +34,17 @@
<listOptionValue builtIn="false" value="LINK_ORDER=TOOLS/ccs_linker_defines.cmd;TOOLS/cc26xx_app.cmd;"/>
<listOptionValue builtIn="false" value="RTSC_MBS_VERSION=2.2.0"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.1274638070" 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.1583866282" 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.1059282767" 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.1196688968" 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.457970119" 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.1884400605" 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.1388030727" 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.1955817222" 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.1322087609" 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.1900105735" 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.1761118836" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.579299287" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="18.1.4.LTS" valueType="string"/>
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug.2112816025" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug"/>
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug.1418617668" name="GNU Make.FlashROM" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.1368914557" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.872349905" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.7M3" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.1023813954" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.16" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.1674413144" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.eabi" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN.184317276" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.1068578615" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.1943600764" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH.644525479" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
<listOptionValue builtIn="false" value="C:\ti\simplelink\ble_sdk_2_02_02_25\src\examples\simple_peripheral\cc26xx\app\headstage"/>
<listOptionValue builtIn="false" value="${SRC_EX}/examples/simple_peripheral/cc26xx/app"/>
@@ -70,7 +70,7 @@
<listOptionValue builtIn="false" value="${SRC_BLE_CORE}/rom"/>
<listOptionValue builtIn="false" value="${CC26XXWARE}"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.1111983062" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.1330623088" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
<listOptionValue builtIn="false" value="BOARD_DISPLAY_EXCLUDE_UART"/>
<listOptionValue builtIn="false" value="POWER_SAVING"/>
<listOptionValue builtIn="false" value="BOOSTXL_CC2650MA"/>
@@ -86,71 +86,71 @@
<listOptionValue builtIn="false" value="xdc_runtime_Assert_DISABLE_ALL"/>
<listOptionValue builtIn="false" value="xdc_runtime_Log_DISABLE_ALL"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.150230280" 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.2124166047" 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.1531734966" 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.1843067675" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.1308360247" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.504235202" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.C99" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GCC.105967788" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GCC" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS.698913237" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS" valueType="stringList">
<listOptionValue builtIn="false" value="48"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.1095395954" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.1399241416" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING" valueType="stringList">
<listOptionValue builtIn="false" value="225"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.654804449" 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.31374450" 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.1727784462" 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.1267949125" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.867926379" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER.980626282" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS.374992114" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE.1890491357" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE" valueType="stringList">
<listOptionValue builtIn="false" value="${SRC_EX}/config/build_components.opt"/>
<listOptionValue builtIn="false" value="${ORG_PROJ_DIR}/build_config.opt"/>
<listOptionValue builtIn="false" value="${ORG_PROJ_DIR}/../../ccs/config/ccs_compiler_defines.bcfg"/>
</option>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.1716338669" 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.1116649612" 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.1248249991" 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.1787451610" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.263445006" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.1235873701" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.207268648" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.1068957263" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.90032441" 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.678020131" 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.714199963" 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.514448618" 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.371673032" 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.670216381" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY" valueType="libs">
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.223507680" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE.698430423" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE" value="256" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE.402182782" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE" value="0" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE.1628689699" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE" value="&quot;${ProjName}.map&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE.2141951901" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY.679112687" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY" valueType="libs">
<listOptionValue builtIn="false" value="libc.a"/>
<listOptionValue builtIn="false" value="${CC26XXWARE}/driverlib/bin/ccs/driverlib.lib"/>
<listOptionValue builtIn="false" value="${ROM}/common_rom_releases/03282014/common_rom.symbols"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.799498475" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH" valueType="libPaths">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.650613345" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH" valueType="libPaths">
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/lib"/>
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.878791489" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.782343525" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS" valueType="stringList">
<listOptionValue builtIn="false" value="10247-D"/>
<listOptionValue builtIn="false" value="16002-D"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1596376977" 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.1952641404" 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.2105328132" 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.597099306" 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.2031149449" 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.1635732611" 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.538779003" 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.2040762360" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1555270082" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER.16105060" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO.1713299511" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO" value="&quot;${ProjName}_linkInfo.xml&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.68776981" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.on" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.1860389255" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.on" valueType="enumerated"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS.152379533" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS.158095632" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS.978853236" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.809761366" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.1676895422" 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.2121665528" 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.1080654307" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.INTEL" valueType="enumerated"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.2015106526" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.1270425102" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH" value="8" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH.16813235" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH" value="8" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.318851558" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.INTEL" valueType="enumerated"/>
</tool>
<tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.332020998" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.669594991" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">
<tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.927640565" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.1908494509" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">
<listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_REPOS}"/>
<listOptionValue builtIn="false" value="${TARGET_CONTENT_BASE}"/>
</option>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.1674192526" 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.1574179765" 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.1927118034" 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.280895421" 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.1769581507" 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.216428433" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS" value="&quot;${COMPILER_FLAGS}&quot;" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.1746187707" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.arm.elf.M3" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.884959194" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="ti.platforms.simplelink:CC2640F128" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.943624305" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW" value="ti.platforms.simplelink:CC2640F128" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.1521167272" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="release" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.1901654533" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value="${CG_TOOL_ROOT}" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS.138005453" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS" value="&quot;${COMPILER_FLAGS}&quot;" valueType="string"/>
</tool>
</toolChain>
</folderInfo>
@@ -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 ?= ../../config/src
GEN_SRC_DIR ?= ../../../../../ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/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_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
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
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_02_25_core/packages/
vpath %.c C:/ti/xdctools_3_32_00_06_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_02_25_core/packages/
XDC_ROOT = C:/ti/xdctools_3_32_00_06_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.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/
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/
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
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
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
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
define RM
$(if $(wildcard $1),$(DEL) $1,:)
@@ -9,6 +9,6 @@
<linkerCommandFile value="cc26x0f128.cmd"/>
<rts value="libc.a"/>
<createSlaveProjects value=""/>
<connection value="common/targetdb/connections/TIXDS110_Connection.xml"/>
<connection value="common/targetdb/connections/TIXDS100v3_Dot7_Connection.xml"/>
<isTargetManual value="false"/>
</projectOptions>
@@ -15,8 +15,8 @@
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Default.1209999684" name="FlashROM" parent="com.ti.ccstudio.buildDefinitions.TMS470.Default" postannouncebuildStep="" postbuildStep="${CG_TOOL_HEX} -order MS --memwidth=8 --romwidth=8 --intel -o ${ProjName}.hex ${ProjName}.out;${TOOLS_BLE}/frontier/frontier.exe ccs ${PROJECT_LOC}/${ConfigName}/${ProjName}_linkInfo.xml ${ORG_PROJ_DIR}/../../ccs/config/ccs_compiler_defines.bcfg ${ORG_PROJ_DIR}/../../ccs/config/ccs_linker_defines.cmd" preannouncebuildStep="" prebuildStep="&quot;${TOOLS_BLE}/lib_search/lib_search.exe&quot; ${ORG_PROJ_DIR}/build_config.opt &quot;${TOOLS_BLE}/lib_search/params_split_cc2640.xml&quot; ${SRC_BLE_CORE}/../blelib &quot;${ORG_PROJ_DIR}/../../ccs/config/lib_linker.cmd&quot;">
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Default.1209999684." name="/" resourcePath="">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.850849537" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.331655106">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1724835356" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.929750171" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.1008890994">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1479696404" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.CC2650F128"/>
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
<listOptionValue builtIn="false" value="OUTPUT_FORMAT=ELF"/>
@@ -26,17 +26,17 @@
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE="/>
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.666327966" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="18.1.3.LTS" valueType="string"/>
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug.1673392813" 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.1688981434" 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.2002014507" 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.928057445" 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.363491606" 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.443895835" 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.1375674256" 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.1533411472" 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.1721351354" 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.1719259893" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.201372544" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="18.1.4.LTS" valueType="string"/>
<targetPlatform id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug.1951196199" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug"/>
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug.20903631" name="GNU Make.FlashROM" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.1176131016" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.647279085" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.7M3" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.1443871767" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.16" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.227818129" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.eabi" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN.784155377" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.494285153" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.581550859" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH.1288777730" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
<listOptionValue builtIn="false" value="${SRC_EX}/examples/simple_peripheral/cc26xx/stack"/>
<listOptionValue builtIn="false" value="${SRC_EX}/common/cc26xx"/>
@@ -60,7 +60,7 @@
<listOptionValue builtIn="false" value="${SRC_EX}/profiles/roles"/>
<listOptionValue builtIn="false" value="${CC26XXWARE}"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.1107811589" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.986125825" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
<listOptionValue builtIn="false" value="CC26XX"/>
<listOptionValue builtIn="false" value="POWER_SAVING"/>
<listOptionValue builtIn="false" value="CC26XXWARE"/>
@@ -81,60 +81,60 @@
<listOptionValue builtIn="false" value="xTESTMODES"/>
<listOptionValue builtIn="false" value="xTEST_BLEBOARD"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.1674781048" 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.1197031762" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.372638078" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.C99" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS.201347726" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS" valueType="stringList">
<listOptionValue builtIn="false" value="48"/>
<listOptionValue builtIn="false" value="16004"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.1813719590" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.73314177" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING" valueType="stringList">
<listOptionValue builtIn="false" value="225"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.2006801438" 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.1274302360" 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.48398547" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.1126279750" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER.1492280006" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE.538453952" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE" valueType="stringList">
<listOptionValue builtIn="false" value="${SRC_EX}/config/build_components.opt"/>
<listOptionValue builtIn="false" value="${ORG_PROJ_DIR}/build_config.opt"/>
</option>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.492800473" 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.768144029" 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.1389861753" 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.386445499" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.313905687" name="C Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.1129729173" name="C++ Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.156783227" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.538375181" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.331655106" 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.1381036144" 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.168506890" 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.1212672730" 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.943483147" 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.1640345534" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY" valueType="libs">
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.1008890994" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE.1873600405" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE" value="256" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE.1359172875" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE" value="0" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE.1355177509" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE" value="&quot;${ProjName}.map&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE.829303802" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY.1078356909" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY" valueType="libs">
<listOptionValue builtIn="false" value="libc.a"/>
<listOptionValue builtIn="false" value="${ORG_PROJ_DIR}/../../ccs/config/lib_linker.cmd"/>
<listOptionValue builtIn="false" value="${ROM}/ble_rom_releases/04242014/ble_rom_patch.symbols"/>
<listOptionValue builtIn="false" value="${CC26XXWARE}/driverlib/bin/ccs/driverlib.lib"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.1254215569" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH" valueType="libPaths">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.1707930214" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH" valueType="libPaths">
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/lib"/>
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.2091600131" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.59164041" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS" valueType="stringList">
<listOptionValue builtIn="false" value="16002-D"/>
<listOptionValue builtIn="false" value="10247-D"/>
<listOptionValue builtIn="false" value="10325-D"/>
<listOptionValue builtIn="false" value="10229-D"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1553293947" 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.122135915" 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.170909146" 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.77470480" 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.24377159" 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.666479043" 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.799367454" 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.784739363" 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.1832938351" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.11567165" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER.1727810233" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO.1385277262" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO" value="&quot;${ProjName}_linkInfo.xml&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.ENTRY_POINT.1153340314" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.ENTRY_POINT" value="startup_entry" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.450995330" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.on" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.1827942626" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.on" valueType="enumerated"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS.1279238428" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS.526125450" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS.581803256" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.1558403974" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.486753383" 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.2140626646" 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.1451244882" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.INTEL" valueType="enumerated"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.947560992" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.1295209583" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH" value="8" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH.110293046" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH" value="8" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.1122561921" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.INTEL" valueType="enumerated"/>
</tool>
</toolChain>
</folderInfo>
@@ -12,7 +12,6 @@
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${target_config_active_default:simple_peripheral_cc2650em_stack}"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS100v3 USB Debug Probe_0/Cortex_M3_0" value="C:/ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\FlashROM\simple_peripheral_cc2650em_stack.out"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe/Cortex_M3_0" value="C:/ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\FlashROM\simple_peripheral_cc2650em_stack.out"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe_0/Cortex_M3_0" value="C:/ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\FlashROM\simple_peripheral_cc2650em_stack.out"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/simple_peripheral_cc2650em_stack"/>
</listAttribute>
@@ -1,20 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configurations XML_version="1.2" id="configurations_0">
<configuration XML_version="1.2" id="Texas Instruments XDS110 USB Debug Probe_0">
<instance XML_version="1.2" desc="Texas Instruments XDS110 USB Debug Probe_0" href="connections/TIXDS110_Connection.xml" id="Texas Instruments XDS110 USB Debug Probe_0" xml="TIXDS110_Connection.xml" xmlpath="connections"/>
<connection XML_version="1.2" id="Texas Instruments XDS110 USB Debug Probe_0">
<instance XML_version="1.2" href="drivers/tixds510icepick_c.xml" id="drivers" xml="tixds510icepick_c.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds510cs_dap.xml" id="drivers" xml="tixds510cs_dap.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds510cortexM.xml" id="drivers" xml="tixds510cortexM.xml" xmlpath="drivers"/>
<property Type="choicelist" Value="1" id="Power Selection">
<choice Name="Probe supplied power" value="1">
<property Type="stringfield" Value="3.3" id="Voltage Level"/>
</choice>
</property>
<property Type="choicelist" Value="0" id="JTAG Signal Isolation"/>
<property Type="choicelist" Value="4" id="SWD Mode Settings">
<choice Name="cJTAG (1149.7) 2-pin advanced modes" value="enable">
<property Type="choicelist" Value="1" id="XDS110 Aux Port"/>
<configuration XML_version="1.2" id="Texas Instruments XDS100v3 USB Debug Probe_0">
<instance XML_version="1.2" desc="Texas Instruments XDS100v3 USB Debug Probe_0" href="connections/TIXDS100v3_Dot7_Connection.xml" id="Texas Instruments XDS100v3 USB Debug Probe_0" xml="TIXDS100v3_Dot7_Connection.xml" xmlpath="connections"/>
<connection XML_version="1.2" id="Texas Instruments XDS100v3 USB Debug Probe_0">
<instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
<instance XML_version="1.2" href="drivers/tixds100v2cortexM.xml" id="drivers" xml="tixds100v2cortexM.xml" xmlpath="drivers"/>
<property Type="choicelist" Value="2" id="The Converter Usage">
<choice Name="Generate 1149.7 2-pin advanced modes" value="enable">
<property Type="choicelist" Value="1" id="The Converter 1149.7 Frequency">
<choice Name="Overclock with user specified value" value="unused">
<property Type="choicelist" Value="5" id="-- Choose a value from 1.0MHz to 50.0MHz"/>
</choice>
</property>
<property Type="choicelist" Value="5" id="The Target Scan Format"/>
</choice>
</property>
<platform XML_version="1.2" id="platform_0">
@@ -1,10 +1,9 @@
/*
** Stack Frontier Generator 1.1.0 (2019-10-25 12:10:03.055000)
** Stack Frontier Generator 1.1.0 (2016-03-28 14:11:07.308000)
**
** WARNING - Auto-generated file. Modifications could be lost!
*/
--define=ICALL_STACK0_ADDR=0xf001
--define=ICALL_STACK0_START=0xf000
--define=ICALL_RAM0_START=0x20004320
--define=ICALL_STACK0_ADDR=0xe001
--define=ICALL_STACK0_START=0xe000
--define=ICALL_RAM0_START=0x20004368
@@ -1,10 +1,9 @@
/*
** Stack Frontier Generator 1.1.0 (2019-10-25 12:10:03.055000)
** Stack Frontier Generator 1.1.0 (2016-03-28 14:11:07.308000)
**
** WARNING - Auto-generated file. Modifications could be lost!
*/
--define=ICALL_RAM0_START=0x20004320
--define=ICALL_STACK0_START=0xf000
--define=ICALL_STACK0_ADDR=0xf001
--define=ICALL_RAM0_START=0x20004368
--define=ICALL_STACK0_START=0xe000
--define=ICALL_STACK0_ADDR=0xe001
@@ -4,5 +4,5 @@
*/
"C:\ti\simplelink\ble_sdk_2_02_02_25\blelib\host\host_pxxx.a"
"C:\ti\simplelink\ble_sdk_2_02_02_25\blelib\ctrl\cc2640\cc2640_ctrl_pxxx.a"
"C:\ti\simplelink\ble_sdk_2_02_02_25\blelib\hci_tl\cc26xx\cc26xx_hci_tl_none.a"
"C:\ti\simplelink\ble_sdk_2_02_02_25\blelib\ctrl\cc2640\cc2640_ctrl_pxxx_ext.a"
"C:\ti\simplelink\ble_sdk_2_02_02_25\blelib\hci_tl\cc26xx\cc26xx_hci_tl_none_v41_v42.a"
File diff suppressed because it is too large Load Diff
@@ -76,6 +76,11 @@ static void ADCGainControl(uint8_t ADCLevel){
PIN_setOutputValue(pin_handle, Turnon10K, 0);
PIN_setOutputValue(pin_handle, Turnon100R, 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);
}
else{
// default using 200R resister
PIN_setOutputValue(pin_handle, Turnon10K, 0);
@@ -121,4 +126,102 @@ static void ADCChannelSelect(uint8_t ADCChannel){
}
}
static void ReadVolt(uint8_t *buf){
// Read data twice since the first data we get is previous data
ADCChannelSelect(ADC_CH_VOLT);
CPUdelay(10);
ADC_read(buf);
ADCChannelSelect(ADC_CH_VOLT);
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);
ADCChannelSelect(ADC_CH_CURRENT);
CPUdelay(10);
ADC_read(buf);
ADCChannelSelect(ADC_CH_CURRENT);
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
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 == GAIN_200R){
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
// 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);
// LED_color(DARKLED, 0x00, 0xFF, 0x00);
// // switch to small range current
// 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);
// }
}
}
else if(INSTRUCTION.ADCGainLevel == GAIN_10K){
ReadCurrent(spi_ADC_rxbuf);
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
// 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);
}
// 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);
}
}
else if(INSTRUCTION.ADCGainLevel == GAIN_200K){
ReadCurrent(spi_ADC_rxbuf);
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);
// 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);
// }
}
}
return Real_Current;
}
#endif
@@ -2,242 +2,169 @@
#ifndef ELITECCMODE
#define ELITECCMODE
#define CURRENT_LV_FOUR 4
#define CURRENT_LV_THREE 3
#define CURRENT_LV_TWO 2
#define CURRENT_LV_ONE 1
#define CURRENT_LV_ZERO 0
static void CCModeDACControl(int32_t IUC_Measure_Difference);
/*********************************************************************
* @struct Constant Current Code
*
* @brief A struct to handle CC mode command
*/
typedef struct _CURRENT_USER_CODE {
/** current level range: 0-4 **/
// current level = 0 => 0-499 nA => ADCGainLevel = 200K
// current level = 1 => 500-999 nA => ADCGainLevel = 10K
// current level = 2 => 0-499 uA => ADCGainLevel = 10K
// current level = 3 => 500-999 uA => ADCGainLevel = 200R
// current level = 4 => 0-499 mA => ADCGainLevel = 200R
uint8_t lv;
static int32_t CCModeReadCurrent(CCMode *CC){
/** current value **/
// current value divide current level into 50000 pieces
uint16_t value;
static bool IVSwitch = false;
/** transform a current user code (IUC) to real current in pA **/
// handle current lv 0~2
int32_t (*_Transform2RealpA)(struct _CURRENT_USER_CODE *);
CCModeDACEnable = 1; // This flag will control DAC working
/** transform an IUC to real current in nA **/
// handle current lv 3~4
int32_t (*_Transform2RealnA)(struct _CURRENT_USER_CODE *);
/** Measure Current **/
int32_t _MeasureCurrent;
/** MeasureCurrent operation **/
void (*SetMeasureCurrent)(struct _CURRENT_USER_CODE *, int32_t);
int32_t (*GetMeasureCurrent)(struct _CURRENT_USER_CODE *);
}CURRENT_USER_CODE;
//static CURRENT_USER_CODE CurrentUserCode;
static int32_t CCModeReadCurrent(CURRENT_USER_CODE *CurrentUserCode){
int32_t Real_Current = 0;
CCModeReset = 0; // This flag will control DAC working
CCCurrent2IUC(CurrentUserCode);
// if(CurrentUserCode->lv == CURRENT_LV_FOUR){
// Real_Current = CurrentUserCode->_Transform2RealnA(CurrentUserCode);
// }
// else{
// Real_Current = CurrentUserCode->_Transform2RealpA(CurrentUserCode);
// }
// set ADC gain according to constant current value
SetCCModeGain(CurrentUserCode);
// read ADC current
ADCGainControl(INSTRUCTION.ADCGainLevel);
ADCChannelSelect(ADC_CH_CURRENT);
CPUdelay(10);
ADC_read(spi_ADC_rxbuf);
// set current value and ADC gain level
CCCurrent2IUC(CC);
// decode ADC value and put it into notify buffer
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
CurrentUserCode->SetMeasureCurrent(CurrentUserCode, Real_Current);
if(IVSwitch){
IVSwitch = false;
if(INSTRUCTION.AutoGainEnable){
CC->_MeasureData = AutoGainReadCurrent(spi_ADC_rxbuf);
}
else{
ReadCurrent(spi_ADC_rxbuf);
CC->_MeasureData = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
}
else{
IVSwitch = true;
/** read battery voltage **/
// read ADC volt
ReadVolt(spi_ADC_rxbuf);
// Real_Current = CurrentUserCode->_Transform2RealpA(CurrentUserCode);
// NotifyVolt[0] = (uint8_t) (Real_Current >> 24);
// NotifyVolt[1] = (uint8_t) ((Real_Current & 0x00FF0000) >> 16);
// NotifyVolt[2] = (uint8_t) ((Real_Current & 0x0000FF00) >> 8);
// NotifyVolt[3] = (uint8_t) (Real_Current & 0x000000FF);
//
// NotifyCurrent[0] = (uint8_t) (Real_Current >> 24);
// NotifyCurrent[1] = (uint8_t) ((Real_Current & 0x00FF0000) >> 16);
// NotifyCurrent[2] = (uint8_t) ((Real_Current & 0x0000FF00) >> 8);
// NotifyCurrent[3] = (uint8_t) (Real_Current & 0x000000FF);
return Real_Current;
// decode ADC value and put it into notify buffer
CC->BatteryV = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
}
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(CURRENT_USER_CODE *CurrentUserCode){
int32_t MeasureCurrent = 0, IUCCurrent = 0;
static int32_t CCModeVoltOut(CCMode *CC){
int32_t MeasureCurrent = 0, IUCCurrent = 0, ADCRealVolt = 0;
if(CCModeReset){
if(!CCModeDACEnable){
// DAC should not work now
return 0;
}
IUCCurrent = CurrentUserCode->_Transform2RealpA(CurrentUserCode);
MeasureCurrent = CurrentUserCode->GetMeasureCurrent(CurrentUserCode) * 1000;
IUCCurrent = CC->_Transform2RealnA(CC);
if(CurrentUserCode->lv != CURRENT_LV_FOUR && CurrentUserCode->lv != CURRENT_LV_THREE ){
// if( IUCCurrent > MeasureCurrent){
// INSTRUCTION.VoltConstant = INSTRUCTION.VoltConstant + (IUCCurrent - MeasureCurrent)/1e5;
// }
// else{
// INSTRUCTION.VoltConstant = INSTRUCTION.VoltConstant + (IUCCurrent - MeasureCurrent)/1e5;
// }
// CCModeDACControl(IUCCurrent - MeasureCurrent);
}
NotifyVolt[0] = (uint8_t) (IUCCurrent >> 24);
NotifyVolt[1] = (uint8_t) ((IUCCurrent & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((IUCCurrent & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (IUCCurrent & 0x000000FF);
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;
// }
CCModeDACEnable = 0;
return MeasureCurrent;
}
static void CCModeDACControl(int32_t IUC_Measure_Difference){
INSTRUCTION.VoltConstant = INSTRUCTION.VoltConstant + IUC_Measure_Difference;
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
}
static void SetCCModeGain(CURRENT_USER_CODE *CurrentUserCode){
switch(CurrentUserCode->lv){
case CURRENT_LV_FOUR:{
INSTRUCTION.ADCGainLevel = GAIN_200R;
break;
}
case CURRENT_LV_THREE:{
INSTRUCTION.ADCGainLevel = GAIN_200R;
break;
}
case CURRENT_LV_TWO:{
INSTRUCTION.ADCGainLevel = GAIN_10K;
break;
}
case CURRENT_LV_ONE:{
INSTRUCTION.ADCGainLevel = GAIN_200K;
break;
}
case CURRENT_LV_ZERO:{
INSTRUCTION.ADCGainLevel = GAIN_200K;
break;
}
default :{
INSTRUCTION.ADCGainLevel = GAIN_200R;
break;
}
int32_t step;
if(IUC_Measure_Difference < 100 && IUC_Measure_Difference > -100){
step = (IUC_Measure_Difference > 0) ? 1:-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);
// }
}
static void CCCurrent2IUC(CURRENT_USER_CODE *CurrentUserCode){
if (INSTRUCTION.CurrentLV == CURRENT_LV_MA){
// largest current ( 0~500 mA)
CurrentUserCode->lv = CURRENT_LV_FOUR;
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent);
else if(IUC_Measure_Difference < 1000 && IUC_Measure_Difference > -1000){
step = IUC_Measure_Difference / 100;
}
else if (INSTRUCTION.CurrentLV == CURRENT_LV_UA){
if(INSTRUCTION.ConstantCurrent >= 50000){
// mid range current ( 500 uA ~ 999 uA)
CurrentUserCode->lv = CURRENT_LV_THREE;
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent - 50000);
else if(IUC_Measure_Difference < 10000 && IUC_Measure_Difference > -10000){
step = IUC_Measure_Difference / 1000;
}
else{
step = IUC_Measure_Difference / 1e4;
}
// over/under flow
if( (INSTRUCTION.VoltConstant + step) > MAX_DAC_UC || (INSTRUCTION.VoltConstant + step) < MIN_DAC_UC ){
if(step > 0){
INSTRUCTION.VoltConstant = (INSTRUCTION.VoltConstant + MAX_DAC_UC)/2;
}
else{
// mid range current ( 0 uA ~ 499 uA)
CurrentUserCode->lv = CURRENT_LV_TWO;
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent);
INSTRUCTION.VoltConstant = (INSTRUCTION.VoltConstant + MIN_DAC_UC)/2;
}
}
else{
if(INSTRUCTION.ConstantCurrent >= 50000){
// mid range current ( 500 nA ~ 999 nA)
CurrentUserCode->lv = CURRENT_LV_ONE;
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent - 50000);
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{
// mid range current ( 0 nA ~ 499 nA)
CurrentUserCode->lv = CURRENT_LV_ZERO;
CurrentUserCode->value = (uint16_t) (INSTRUCTION.ConstantCurrent);
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;
}
}
}
//static int32_t IUC2RealnA(){
//
//}
//
//static int32_t IUC2RealpA{
//
//}
/*********************************************************************
* @fn Transform2RealpA
*
* @brief transform an IUC into real current value in pA.
*
* @param self, which is an IUC
*
* @return an int32_t current value in pA
*/
static int32_t _Transform2RealpA(CURRENT_USER_CODE *self){
int32_t IUCReal;
/** current level range: 0-4 **/
// current level = 0 => 0-499 nA => ADCGainLevel = 200K
// current level = 1 => 500-999 nA => ADCGainLevel = 10K
// current level = 2 => 0-499 uA => ADCGainLevel = 10K
// current level = 3 => 500-999 uA => ADCGainLevel = 200R
// current level = 4 => 0-499 mA => ADCGainLevel = 200R
/* Transform setting CC into IUC
*
* User code in CC mode : 0 ~ 3000000
* Real current value : -15.00000 ~ 15.00000 mA
* => user code = 1500000 mapping to 0.00000 mA
*/
static void CCCurrent2IUC(CCMode *CC){
int32_t CurrentValue = 0;
// Saturate if current > 500 uA
if (self->lv == CURRENT_LV_FOUR){
return 0xFFFFFFFF;
CC->value = INSTRUCTION.ConstantCurrent;
CurrentValue = CC->value - CC_ZERO_POINT;
/* set ADC level */
// largest current
if (CurrentValue > 10000 || CurrentValue < -10000){
CC->lv = GAIN_200R;
}
if (self->lv == CURRENT_LV_THREE){
return 0xFFFFFFFF;
// mid range current
else if (CurrentValue > 1000 || CurrentValue < -1000){
CC->lv = GAIN_10K;
}
// 0-499 nA
if (self->lv == CURRENT_LV_ZERO){
IUCReal = (int32_t) (self->value) * 10;
// least range current
else{
CC->lv = GAIN_200K;
}
// 500-999 nA
else if (self->lv == CURRENT_LV_ONE){
IUCReal = ((int32_t) (self->value + 50000) * 10);
}
// 0-499 uA
else if (self->lv == CURRENT_LV_TWO){
IUCReal = (int32_t) (self->value) * 1e4;
}
return IUCReal;
}
/*********************************************************************
@@ -249,89 +176,34 @@ static int32_t _Transform2RealpA(CURRENT_USER_CODE *self){
*
* @return an int32_t current value in nA
*/
static int32_t _Transform2RealnA(CURRENT_USER_CODE *self){
int32_t IUCReal;
// Saturate if current < 500 uA
if (self->lv == CURRENT_LV_ZERO | self->lv == CURRENT_LV_ONE | self->lv == CURRENT_LV_TWO){
return 0;
}
// 500-999 uA
if (self->lv == CURRENT_LV_THREE){
IUCReal = (int32_t) (self->value + 50000) * 10;
}
// 0-499 mA
else if (self->lv == 4){
IUCReal = (int32_t) (self->value) * 1e4;
}
return IUCReal;
}
/*********************************************************************
* @fn CompareCurrent
*
* @brief compare an int32 current with CURRENT_USER_CODE (IUC) type current.
*
* @param unit is current unit (0 = pA, 1 = nA)
* value is current value
*
* @return 0 if equal
* 1 if IUC is larger
* 2 if int32 current is larger.
*/
static uint8_t CompareCurrent(CURRENT_USER_CODE *self, uint8_t unit, int32_t value){
int32_t ErrorRangeIUCReal;
// unit = pA
if (unit == 0){
if (self->_Transform2RealpA(self) > value){
return 1;
}
else if (self->_Transform2RealpA(self) < value){
return 2;
}
else{
return 0;
}
}
// unit = nA
else if (unit == 1){
if (self->_Transform2RealnA(self) > value){
return 1;
}
else if (self->_Transform2RealnA(self) < value){
return 2;
}
else{
return 0;
}
}
}
static void SetMeasureCurrent(CURRENT_USER_CODE *self, int32_t current){
self->_MeasureCurrent = current;
}
static int32_t GetMeasureCurrent(CURRENT_USER_CODE *self){
int32_t ret;
ret = self->_MeasureCurrent;
return ret;
}
static CURRENT_USER_CODE *InitCurrentUserCode(){
CURRENT_USER_CODE *CurrentUserCode = malloc(sizeof(CURRENT_USER_CODE));
CurrentUserCode->lv = 0;
CurrentUserCode->value = 0;
CurrentUserCode-> _MeasureCurrent = 0;
CurrentUserCode->_Transform2RealnA = &_Transform2RealnA;
CurrentUserCode->_Transform2RealpA = &_Transform2RealpA;
CurrentUserCode->SetMeasureCurrent = &SetMeasureCurrent;
CurrentUserCode->GetMeasureCurrent = &GetMeasureCurrent;
return CurrentUserCode;
}
//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
@@ -2,7 +2,7 @@
#ifndef ELITECV
#define ELITECV
static uint16_t SWVCurve() {
static uint16_t SWVCurve(WorkMode *WorkModeData) {
static uint8_t counter;
static uint16_t outputV;
static uint16_t Volt;
@@ -57,7 +57,7 @@ static uint16_t SWVCurve() {
return outputV;
}
static uint16_t DPVCurve() {
static uint16_t DPVCurve(WorkMode *WorkModeData) {
static uint8_t counter;
static uint16_t Volt1;
static uint16_t Volt2;
@@ -132,15 +132,15 @@ static uint16_t DPVCurve() {
}
}
static uint16_t CVCurve() {
static uint16_t CVCurve(CVMode *CV) {
static uint16_t DACOutCode;
static bool direction_up;
static bool current_direction_up;
static bool direction_up; // direction_up = true, if Vfinal > Vorigin
static bool current_direction_up; // current_direction_up = true, Vstep => positive. vice versa
// reset origin volt at the begin
if (DACReset) {
DACUserCode = INSTRUCTION.VoltOrigin;
if (INSTRUCTION.VoltFinal > INSTRUCTION.VoltOrigin) {
DACUserCode = CV->_VOrigin;
if (INSTRUCTION.VoltFinal > CV->_VOrigin) {
direction_up = true;
current_direction_up = true;
} else {
@@ -155,79 +155,83 @@ static uint16_t CVCurve() {
return DACOutCode;
}
if (StepTimeCounter == INSTRUCTION.StepTime) {
if (CT.StepTimeCounter == CV->_StepTime) {
//Decide next direction
// Decide next direction
if (direction_up) {
if (DACUserCode >= INSTRUCTION.VoltFinal) {
if (DACUserCode >= CV->_VStop) {
current_direction_up = false; // problem occurs when origin == 0000 final == ffff!!!!!!
} else if (DACUserCode <= INSTRUCTION.VoltOrigin) {
} else if (DACUserCode <= CV->_VOrigin) {
current_direction_up = true;
if (INSTRUCTION.CycleNumber == 0) {
if (CV->_CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
}
INSTRUCTION.CycleNumber--;
CV->_CycleNumber--;
}
} else {
if (DACUserCode <= INSTRUCTION.VoltFinal) {
if (DACUserCode <= CV->_VStop) {
current_direction_up = true; // problem occurs when origin == 0000 final == ffff!!!!!!
} else if (DACUserCode >= INSTRUCTION.VoltOrigin) {
} else if (DACUserCode >= CV->_VOrigin) {
current_direction_up = false;
if (INSTRUCTION.CycleNumber == 0) {
if (CV->_CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
}
INSTRUCTION.CycleNumber--;
CV->_CycleNumber--;
}
}
// Next output voltage
if (direction_up) {
if (current_direction_up) {
if (DACUserCode + INSTRUCTION.Step < DACUserCode) {
DACUserCode = 0xffff;
// DACUserCode overflow ?
if (DACUserCode + CV->_Step < DACUserCode) {
DACUserCode = CV->_VStop;
}
else if (DACUserCode + INSTRUCTION.Step > INSTRUCTION.VoltFinal) {
DACUserCode = INSTRUCTION.VoltFinal;
else if (DACUserCode + CV->_Step > CV->_VStop) {
DACUserCode =CV->_VStop;
}
else {
DACUserCode = DACUserCode + INSTRUCTION.Step;
DACUserCode = DACUserCode + CV->_Step;
}
}
else {
if (DACUserCode - INSTRUCTION.Step > DACUserCode) {
DACUserCode = 0x0000;
// DACUserCode underflow ?
if (DACUserCode - CV->_Step > DACUserCode || DACUserCode > 60000) {
DACUserCode = CV->_VOrigin;
}
else if (DACUserCode + INSTRUCTION.Step < INSTRUCTION.VoltOrigin) {
DACUserCode = INSTRUCTION.VoltOrigin;
// reach Vorigin ?
else if (DACUserCode - CV->_Step < CV->_VOrigin) {
DACUserCode = CV->_VOrigin;
}
else {
DACUserCode = DACUserCode - INSTRUCTION.Step;
DACUserCode = DACUserCode - CV->_Step;
}
}
}
else {
if (current_direction_up) {
if (DACUserCode + INSTRUCTION.Step < DACUserCode) {
DACUserCode = 0xffff;
if (DACUserCode + CV->_Step < DACUserCode) {
DACUserCode = CV->_VOrigin;
}
else if (DACUserCode + INSTRUCTION.Step > INSTRUCTION.VoltOrigin) {
DACUserCode = INSTRUCTION.VoltOrigin;
else if (DACUserCode + CV->_Step > CV->_VOrigin) {
DACUserCode = CV->_VOrigin;
}
else {
DACUserCode = DACUserCode + INSTRUCTION.Step;
DACUserCode = DACUserCode + CV->_Step;
}
}
else {
if (DACUserCode - INSTRUCTION.Step > DACUserCode) {
DACUserCode = 0x0000; //
if (DACUserCode - CV->_Step > DACUserCode || DACUserCode > 60000) {
DACUserCode = CV->_VStop ;
}
else if (DACUserCode + INSTRUCTION.Step < INSTRUCTION.VoltFinal) {
DACUserCode = INSTRUCTION.VoltFinal;
else if (DACUserCode - CV->_Step < CV->_VStop) {
DACUserCode = CV->_VStop;
}
else {
DACUserCode = DACUserCode - INSTRUCTION.Step;
DACUserCode = DACUserCode - CV->_Step;
}
}
}
@@ -47,39 +47,7 @@ static uint16_t DAC_outputV(uint16_t voltLV) {
v1 = (uint8_t) ((voltLV & 0xFF00) >> 8);
v2 = (uint8_t) (voltLV & 0x00FF);
spi_DACtxbuf[0] = DACOUT;
spi_DACtxbuf[1] = v1;
spi_DACtxbuf[2] = v2;
DAC_SPI(SPI_DAC_SIZE, spi_DACtxbuf, spi_rxbuf);
return voltLV;
}
#endif
#ifdef ELITE_VERSION_BAT
#define DACCLS 0x02 // clear DAC software
#define DACOUT0 0x31 // DAC0 channel output
#define DACOUT1 0x32 // DAC1 channel output
static uint16_t DAC_outputV(uint16_t voltLV) {
// C = command, X = don't care, D = data
// CCCC CCCC = command
// DDDD DDDD = v1
// DDDD DDDD = v2
// command
// 0x02 = clear
// 0x31 = output voltage
uint8_t v1, v2 = 0;
v1 = (uint8_t) ((voltLV & 0xFF00) >> 8);
v2 = (uint8_t) (voltLV & 0x00FF);
spi_DACtxbuf[0] = DACOUT1;
spi_DACtxbuf[1] = v1;
spi_DACtxbuf[2] = v2;
@@ -89,33 +57,9 @@ static uint16_t DAC_outputV(uint16_t voltLV) {
#endif
static uint16_t DAC_outputCV(uint16_t voltLV) {
uint8_t v1, v2 = 0;
v1 = (uint8_t) ((voltLV & 0xFF00) >> 8);
v2 = (uint8_t) (voltLV & 0x00FF);
spi_DACtxbuf[0] = DACOUT0;
spi_DACtxbuf[1] = v1;
spi_DACtxbuf[2] = v2;
DAC_SPI(SPI_DAC_SIZE, spi_DACtxbuf, spi_rxbuf);
return voltLV;
static int32_t User2Real(uint16_t UserCode){
/* transfer usercode to real voltage value (mV) */
return (int32_t) ((UserCode - 25000)*2)/10;
}
static uint16_t DAC_outputCC(uint16_t voltLV) {
uint8_t v1, v2 = 0;
v1 = (uint8_t) ((voltLV & 0xFF00) >> 8);
v2 = (uint8_t) (voltLV & 0x00FF);
spi_DACtxbuf[0] = DACOUT1;
spi_DACtxbuf[1] = v1;
spi_DACtxbuf[2] = v2;
DAC_SPI(SPI_DAC_SIZE, spi_DACtxbuf, spi_rxbuf);
return voltLV;
}
#endif
@@ -29,7 +29,7 @@
*/
#define BOARD_SATURN
#define BOARD_EARTH
typedef struct _formula{
@@ -144,8 +144,8 @@ struct _correction{
.ADC_current[1].coeff = 658398533,
.ADC_current[1].offset = -16001498741131,
.ADC_current[2].coeff = 30908351,
.ADC_current[2].offset = -746548614824,
.ADC_current[2].coeff = 30908351000,
.ADC_current[2].offset = -746548614824000,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
@@ -350,8 +350,8 @@ struct _correction{
.ADC_current[1].coeff = 68760643,
.ADC_current[1].offset = (-1123221851971),
.ADC_current[2].coeff = 61882330,
.ADC_current[2].offset = (-1010385966159),
.ADC_current[2].coeff = 61882330000,
.ADC_current[2].offset = (-10103859661590),
.DAC2RealV.coeff = (-18690126),
.DAC2RealV.offset = 564319610294,
@@ -372,14 +372,14 @@ struct _correction{
.ADC_volt.coeff = (-6238112),
.ADC_volt.offset = 101628014509,
.ADC_current[0].coeff = 6184288,
.ADC_current[0].offset = (-100642471661),
.ADC_current[0].coeff = 6087943,
.ADC_current[0].offset = (-99768174580),
.ADC_current[1].coeff = 68602677,
.ADC_current[1].offset = (-1117469013718),
.ADC_current[1].coeff = 68915156,
.ADC_current[1].offset = (-1121470119188),
.ADC_current[2].coeff = 12521267,
.ADC_current[2].offset = (-204009192742),
.ADC_current[2].coeff = 61800515,
.ADC_current[2].offset = (-1006755993534),
.DAC2RealV.coeff = (-18690126),
.DAC2RealV.offset = 564319610294,
@@ -462,8 +462,8 @@ struct _correction{
.ADC_current[1].coeff = 656423459,
.ADC_current[1].offset = (-10660544072862),
.ADC_current[2].coeff = 31414514,
.ADC_current[2].offset = (-510185549182),
.ADC_current[2].coeff = 31414514000,
.ADC_current[2].offset = (-510185549182000),
.DAC2RealV.coeff = (-18990774),
.DAC2RealV.offset = 570886531263,
@@ -490,14 +490,42 @@ struct _correction{
.ADC_current[1].coeff = 659931818,
.ADC_current[1].offset = (-10729666444387),
.ADC_current[2].coeff = 31485559,
.ADC_current[2].offset = (-511907957163),
.ADC_current[2].coeff = 31485559000,
.ADC_current[2].offset = (-511907957163000),
.DAC2RealV.coeff = (-19047143),
.DAC2RealV.offset = 565935714286,
.Usercode2DAC.coeff = (-10500262),
.Usercode2DAC.offset = 559619735831,
.Usercode2DAC.offset = 559630236100,
.Gain0Boundary[0] = 0x5D96,
.Gain0Boundary[1] = 0x5DD9,
.Gain1Boundary[0] = 0x57CD,
.Gain1Boundary[1] = 0x639F
};
#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,
@@ -546,8 +574,8 @@ struct _correction{
.ADC_current[1].coeff = 654620883,
.ADC_current[1].offset = (-10668953588943),
.ADC_current[2].coeff = 31245260,
.ADC_current[2].offset = (-509181085054),
.ADC_current[2].coeff = 31245260000,
.ADC_current[2].offset = (-509181085054000),
.DAC2RealV.coeff = (-19009388),
.DAC2RealV.offset = 567032653061,
@@ -591,62 +619,6 @@ struct _correction{
};
#endif
#ifdef BOARD_JUPITER
{
.ADC_volt.coeff = (-6269507),
.ADC_volt.offset = 102248973021,
.ADC_current[0].coeff = 62606101,
.ADC_current[0].offset = (-1020702772438),
.ADC_current[1].coeff = 31499422396,
.ADC_current[1].offset = (-513648914536877),
.ADC_current[2].coeff = 567312273129,
.ADC_current[2].offset = (-9251161237908370),
.DAC2RealV.coeff = (-19009388),
.DAC2RealV.offset = 567032653061,
.Usercode2DAC.coeff = (-10475808),
.Usercode2DAC.offset = 560591538462,
.Gain0Boundary[0] = 0x5D96,
.Gain0Boundary[1] = 0x5DD9,
.Gain1Boundary[0] = 0x57CD,
.Gain1Boundary[1] = 0x639F
};
#endif
#ifdef BOARD_SATURN
{
.ADC_volt.coeff = (-6266426),
.ADC_volt.offset = 102071252282,
.ADC_current[0].coeff = 62606101,
.ADC_current[0].offset = (-1020702772438),
.ADC_current[1].coeff = 31581169256,
.ADC_current[1].offset = (-514718756925423),
.ADC_current[2].coeff = 567519654107,
.ADC_current[2].offset = (-9249719082466730),
.DAC2RealV.coeff = (-19009388),
.DAC2RealV.offset = 567032653061,
.Usercode2DAC.coeff = (-10475385),
.Usercode2DAC.offset = 558776923077,
.Gain0Boundary[0] = 0x5D96,
.Gain0Boundary[1] = 0x5DD9,
.Gain1Boundary[0] = 0x57CD,
.Gain1Boundary[1] = 0x639F
};
#endif
// this function turn ADC measure value (0xXXXX) into real voltage
// unit should be mV
static int32_t DecodeADCVolt(uint16_t ADC_measure){
@@ -671,34 +643,35 @@ static int32_t DecodeADCCurrent(uint8_t ADCGain, uint16_t ADC_measure){
}
static int32_t DecodeResister(uint8_t ADCGainLevel, uint16_t CurrentMeasure, uint16_t VoltMeasure){
long long ADCRealResister = 0, ADCRealCurrent=0, ADCRealVolt=0;
int32_t current_32, volt_32, resister_32;
long long ADCRealCurrent=0, ADCRealVolt=0;
int32_t resister_32;
// get measure current
ADCRealCurrent = (Correction.ADC_current[ADCGainLevel].coeff * CurrentMeasure + Correction.ADC_current[ADCGainLevel].offset)/1e7;
current_32 = (int32_t) (ADCRealCurrent);
// get measure volt
// This step is necessary, if the measure resister !>> 10 ohm
ADCRealVolt = (Correction.ADC_volt.coeff * VoltMeasure + Correction.ADC_volt.offset);
ADCRealVolt = ADCRealVolt / 1e4;
volt_32 = (int32_t) (ADCRealVolt);
if (INSTRUCTION.ADCGainLevel == GAIN_200R){
resister_32 = (int32_t) ((ADCRealVolt) / (ADCRealCurrent/1e3)); // nV / uA = mV
}
else{
resister_32 = (int32_t) ((ADCRealVolt) / (ADCRealCurrent/1e6)); // nV / uA = mV
}
// NotifyVolt[0] = (uint8_t) (volt_32 >> 24);
// NotifyVolt[1] = (uint8_t) ((volt_32 & 0x00FF0000) >> 16);
// NotifyVolt[2] = (uint8_t) ((volt_32 & 0x0000FF00) >> 8);
// NotifyVolt[3] = (uint8_t) (volt_32 & 0x000000FF);
//
// NotifyCurrent[0] = (uint8_t) (current_32 >> 24);
// NotifyCurrent[1] = (uint8_t) ((current_32 & 0x00FF0000) >> 16);
// NotifyCurrent[2] = (uint8_t) ((current_32 & 0x0000FF00) >> 8);
// NotifyCurrent[3] = (uint8_t) (current_32 & 0x000000FF);
// if (INSTRUCTION.ADCGainLevel == GAIN_200R){
resister_32 = (int32_t) ((ADCRealVolt) / (ADCRealCurrent/1e3)); // nV / uA = mV
// }
// else{
// resister_32 = (int32_t) ((ADCRealVolt) / (ADCRealCurrent/1e6)); // nV / uA = mV
// }
int32_t volt_32 = (int32_t) (ADCRealVolt);
int32_t current_32 = (int32_t) (ADCRealCurrent);
NotifyVolt[0] = (uint8_t) (volt_32 >> 24);
NotifyVolt[1] = (uint8_t) ((volt_32 & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((volt_32 & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (volt_32 & 0x000000FF);
NotifyCurrent[0] = (uint8_t) (current_32 >> 24);
NotifyCurrent[1] = (uint8_t) ((current_32 & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((current_32 & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (current_32 & 0x000000FF);
NotifyImpedance[0] = (uint8_t) (resister_32 >> 24);
NotifyImpedance[1] = (uint8_t) ((resister_32 & 0x00FF0000) >> 16);
@@ -712,15 +685,11 @@ 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, ADCRealResister = 0;
int32_t ADCRealVolt = 0, ret = 0, ADCRealCurrent = 0;
// return real volt to controller
if(ADCChannel == ADC_CH_VOLT){
ADCRealVolt = DecodeADCVolt(ADC_measure);
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);
ret = ADCRealVolt;
}
@@ -730,13 +699,24 @@ static int32_t DecodeADCValue(uint8_t ADCGain, uint8_t ADCChannel, uint8_t *ADC_
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 = 0;
return 0;
}
ADCRealCurrent_long += DecodeADCCurrent(ADCGain, ADC_measure);
avg_number++;
DiscardIVFirstData ++;
DecodeADCCurrent(ADCGain, ADC_measure);
ret = DecodeADCCurrent(ADCGain, ADC_measure);
if (StepTimeCounter == INSTRUCTION.StepTime - 1) {
// 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);
@@ -745,6 +725,12 @@ static int32_t DecodeADCValue(uint8_t ADCGain, uint8_t ADCChannel, uint8_t *ADC_
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);
}
}
@@ -757,7 +743,6 @@ static int32_t DecodeADCValue(uint8_t ADCGain, uint8_t ADCChannel, uint8_t *ADC_
NotifyCurrent[3] = (uint8_t) (ADCRealCurrent & 0x000000FF);
ret = ADCRealCurrent;
}
}
else{
@@ -0,0 +1,21 @@
#ifndef ELITE_FLAG_CT_INIT
#define ELITE_FLAG_CT_INIT
static void InitCT(){
CT.SampleRate_counter = 1;
CT.StepTimeCounter = 1;
CT.NotifyCounter = 1;
CT.StandByCounter = 0;
}
static void InitFlag(){
PeriodicEvent = false; // is there an PeriodicEvent?
InitPeriodicEvent = true; // need to create a WorkModeData?
DACReset = true;
CCModeDACEnable = 0; // to make sure DAC work after ADC
Free_Work_Mode = true; // Free(WorkModeData)
// DiscardIVFirstData = 0;
}
#endif
@@ -8,17 +8,13 @@
* exports/tirtos_full_2_14_02_22/docs/doxygen/html/_i2_c_c_c26_x_x_8h.html
*
*/
#include <Board.h>
#include <ti/drivers/I2C.h>
#include <ti/drivers/Power.h>
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <ti/drivers/i2c/I2CCC26XX.h>
#include "Elite_PIN.h"
// I2C
static I2C_Handle I2Chandle;
static I2C_Params I2Cparams;
@@ -2,22 +2,77 @@
#ifndef ELITEIT
#define ELITEIT
static int32_t IT_Plot() {
#define absolute(a) ((a<0)? -a:a)
//static int32_t IT_Plot() {
// // read ADC current
// int32_t Real_Current = 0;
// ADCGainControl(INSTRUCTION.ADCGainLevel);
// ADCChannelSelect(ADC_CH_CURRENT);
// CPUdelay(10);
// ADC_read(spi_ADC_rxbuf);
//
// // check if ADC over/under flow
// // let the output saturate if over/under flow
//// ADC_overflow(INSTRUCTION.ADCGainLevel, spi_ADC_rxbuf);
//
// // decode ADC value and put it into notify buffer
// Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
//
// return Real_Current;
//}
static int32_t IT_Plot(WorkMode *WorkModeData) {
switch (INSTRUCTION.eliteFxn) {
case IV_CURVE:{
#define CURRENT_MODE WorkModeData->IV
break;
}
case CV_CURVE:{
#define CURRENT_MODE WorkModeData->CV
break;
}
case IT_CURVE:{
#define CURRENT_MODE WorkModeData->IT
break;
}
case POTENTIAL_STATE:{
#define CURRENT_MODE WorkModeData->PS
}
default: {
#define CURRENT_MODE WorkModeData->IV
break;
}
}
// read ADC current
int32_t Real_Current = 0;
ADCGainControl(INSTRUCTION.ADCGainLevel);
ADCChannelSelect(ADC_CH_CURRENT);
CPUdelay(10);
ADC_read(spi_ADC_rxbuf);
// check if ADC over/under flow
// let the output saturate if over/under flow
// ADC_overflow(INSTRUCTION.ADCGainLevel, spi_ADC_rxbuf);
if(INSTRUCTION.AutoGainEnable){
Real_Current = AutoGainReadCurrent(spi_ADC_rxbuf);
}
else{
ReadCurrent(spi_ADC_rxbuf);
Real_Current = 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;
// 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();
// }
// }
// decode ADC value and put it into notify buffer
Real_Current = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
return Real_Current;
}
#endif
@@ -2,7 +2,7 @@
#ifndef ELITEIV
#define ELITEIV
static uint16_t VoltScan() {
static uint16_t VoltScan(WorkMode *WorkModeData) {
uint16_t Voltage;
if (INSTRUCTION.VoltOrigin == INSTRUCTION.VoltFinal) {
Voltage = Usercode_Correction_to_DAC(INSTRUCTION.VoltOrigin);
@@ -10,27 +10,30 @@ static uint16_t VoltScan() {
PeriodicEvent = false;
return Voltage;
} else if (INSTRUCTION.eliteFxn == SQUARE_WAVE_VOLTAMMETRY) {
Voltage = SWVCurve();
Voltage = SWVCurve(WorkModeData);
} else if (INSTRUCTION.eliteFxn == DIFFERENTIAL_PULSE_VOLTAMMETRY) {
Voltage = DPVCurve();
Voltage = DPVCurve(WorkModeData);
} else if (INSTRUCTION.eliteFxn == CV_CURVE) {
Voltage = CVCurve();
Voltage = CVCurve(WorkModeData->CV);
} else if (INSTRUCTION.eliteFxn == POTENTIAL_STATE ) {
Voltage = PSCurve(WorkModeData->PS);
}
// IV plot mode
else {
Voltage = OneWayVoltScan();
Voltage = OneWayVoltScan(WorkModeData->IV);
}
return Voltage;
}
static uint16_t OneWayVoltScan() {
static uint16_t OneWayVoltScan(IVMode *IV) {
static uint16_t DACOutCode;
// reset origin volt at the begin
if (DACReset) {
DACUserCode = INSTRUCTION.VoltOrigin;
// DACUserCode = IV->GetVOrigin((struct VoltOutPara *) IV);
DACUserCode = IV->_VOrigin;
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
DACReset = false;
@@ -39,32 +42,101 @@ static uint16_t OneWayVoltScan() {
return DACOutCode;
}
if (StepTimeCounter == INSTRUCTION.StepTime) {
if (INSTRUCTION.VoltOrigin < INSTRUCTION.VoltFinal) {
if (CT.StepTimeCounter == IV->_StepTime){
if (IV->_VOrigin < IV->_VStop) {
// output the next output volt
DACUserCode = DACUserCode + INSTRUCTION.Step;
DACUserCode = DACUserCode + IV->_Step;
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
DAC_outputV(DACOutCode);
// end IV task if we reach INSTRUCTION.VoltFinal
if (DACUserCode >= INSTRUCTION.VoltFinal) {
if (DACUserCode >= IV->_VStop) {
PeriodicEvent = false;
DACReset = true;
}
} else {
DACUserCode = DACUserCode - IV->_Step;
// check if DACUserCode underflow
if(DACUserCode >= 60000){
// LED_color(DARKLED, 0xFF, 0x00, 0x00);
DACUserCode = 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
DACUserCode = DACUserCode - INSTRUCTION.Step;
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
DAC_outputV(DACOutCode);
// end IV task if we reach INSTRUCTION.VoltFinal
if (DACUserCode <= INSTRUCTION.VoltFinal) {
PeriodicEvent = false;
DACReset = true;
}
// // end IV task if we reach INSTRUCTION.VoltFinal
// if (DACUserCode <= IV->_VStop){
// PeriodicEvent = false;
// DACReset = true;
// // reset();
}
}
return DACOutCode;
}
static void IV_Plot(IVMode *IV) {
static uint8_t VoltCurrentSwitch = 0;
uint16_t ADC_measure = 0;
if(VoltCurrentSwitch < 5){
ReadCurrent(spi_ADC_rxbuf);
VoltCurrentSwitch ++;
}
else if(VoltCurrentSwitch == 5){
// read current
ReadCurrent(spi_ADC_rxbuf);
ADC_measure = (uint16_t) (spi_ADC_rxbuf[0] << 8) | (uint16_t) (spi_ADC_rxbuf[1]);
IV->_MeasureData = DecodeADCCurrent(INSTRUCTION.ADCGainLevel, ADC_measure);
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{
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);
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 >= (IV->_VStop - DAC_ZERO)/5){
PeriodicEvent = false;
DACReset = true;
}
}
else{
if(IV->MeasureVolt <= (IV->_VStop - DAC_ZERO)/5){
PeriodicEvent = false;
DACReset = true;
}
}
}
#endif
@@ -20,6 +20,16 @@
#define CURRENT_LV_UA 0x01
#define CURRENT_LV_MA 0x02
/* DAC reset parameter */
#define DAC_ZERO 25000
#define DAC_POS_MAX 0x0000
#define DAC_NEG_MAX 0xFFFF
// Step time macro
#define STEPTIME_HALF_SEC 5000
#define STEPTIME_ONE_SEC 10000
#define STEPTIME_TWO_SEC 20000
/*==============================
==== headstage instruction ====
=============================*/
@@ -38,15 +48,20 @@ struct HEADSTAGE_INSTRUCTION {
uint16_t VoltFinal;
uint16_t Step;
uint16_t StepTime;
// constant volt
uint16_t VoltConstant;
/** ADC parameter **/
uint8_t ADCGainLevel;
uint8_t AutoGainEnable;
/** Notify parameter **/
uint16_t NotifyRate;
/** Constant Current Parameter **/
uint8_t CurrentLV; // nA? uA? mA?
uint32_t ConstantCurrent;
int32_t ConstantCurrent;
/** Resister Measure **/
uint8_t ResisterMeter;
@@ -70,15 +85,16 @@ struct HEADSTAGE_INSTRUCTION {
static void InitEliteInstruction(){
INSTRUCTION.chip_id = 0;
INSTRUCTION.SampleRateIndex = 1;
INSTRUCTION.SampleRate = 10;
INSTRUCTION.SampleRate = 100;
INSTRUCTION.VoltOrigin = DAC_ZERO;
INSTRUCTION.VoltFinal = DAC_POS_MAX;
INSTRUCTION.VoltFinal = DAC_ZERO;
INSTRUCTION.Step = 0x0005; // 0x0005 = 1mV
INSTRUCTION.StepTime = STEPTIME_HALF_SEC; // about 0.5 sec
INSTRUCTION.VoltConstant = 24999; // is about 0V
INSTRUCTION.ADCGainLevel = GAIN_200K;
INSTRUCTION.VoltConstant = DAC_ZERO; // is about 0V
INSTRUCTION.ADCGainLevel = GAIN_AUTO;
INSTRUCTION.AutoGainEnable = 1;
INSTRUCTION.NotifyRate = STEPTIME_ONE_SEC/10;
INSTRUCTION.ResisterMeter = RESISTER_METER_LARGE;
INSTRUCTION.CurrentLV = 0x00;
INSTRUCTION.ConstantCurrent = 0x00000000;
INSTRUCTION.eliteFxn = 0; // default is a null event
INSTRUCTION.CycleNumber = 0;
@@ -97,7 +113,7 @@ static void GetInstructionParameter(uint8 *ins){
// CurrentLV=0 => unit is nA
// CurrentLV=1 => unit is uA
// CurrentLV=2 => unit is mA
INSTRUCTION.CurrentLV = (*ins);
// INSTRUCTION.CurrentLV = (*ins);
// ConstantCurrentRange=0 => current value is 0~499
// ConstantCurrentRange=1 => current value is 500~999
@@ -10,8 +10,8 @@ static bool TurnOnElite(uint8_t key) {
if (key == 0) {
// press 1 sec, power on LED
if (TurnOnCounter >= CLOCK_ONE_SECOND) {
PIN_setOutputValue(pin_handle, power_enable, 1); // enable +5V, +10V, -10V
// TurnOn10V();
PIN_setOutputValue(pin_handle, enable_5v, 1); // enable 5V
TurnOn10V();
LEDPowerON();
return true;
} else {
@@ -20,7 +20,7 @@ static bool TurnOnElite(uint8_t key) {
}
} else {
TurnOnCounter = 0;
PIN_setOutputValue(pin_handle, power_enable, 0); // enable 5V
PIN_setOutputValue(pin_handle, 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, power_enable, 0); // disable +5V, -10V, +10V
PIN_setOutputValue(pin_handle, 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, power_enable, 1);
PIN_setOutputValue(pin_handle, enable_10v, 1);
CPUdelay(8000);
}
@@ -50,14 +50,17 @@ static void WorkModeLED() {
break;
}
case VT_CURVE: {
// WORKLED();
WORKLED();
break;
}
case IT_CURVE: {
WORKLED();
break;
}
case CONSTANT_CURRENT:{
WORKLED();
break;
}
case VIS_RST: {
LEDPowerON();
break;
@@ -0,0 +1,175 @@
#ifndef ELITEPS
#define ELITEPS
static uint16_t PSCurve(PSMode *PS) {
static uint16_t DACOutCode;
static uint16_t DAC_ControlVolt;
static bool direction_up; // direction_up = true, if Vfinal > Vorigin
static bool current_direction_up; // current_direction_up = true, Vstep => positive. vice versa
// reset origin volt at the begin
if (DACReset) {
PS->_ControlVolt = PS->_VOrigin;
if (INSTRUCTION.VoltFinal > PS->_VOrigin) {
direction_up = true;
current_direction_up = true;
} else {
direction_up = false;
current_direction_up = false;
}
DACOutCode = Usercode_Correction_to_DAC(PS->_ControlVolt);
DAC_outputV(DACOutCode); // output VOLT_ORIGIN
DACReset = false;
return DACOutCode;
}
if (CT.StepTimeCounter == PS->_StepTime) {
// Decide next direction
if (direction_up) {
if (PS->_ControlVolt >= PS->_VStop) {
current_direction_up = false; // problem occurs when origin == 0000 final == ffff!!!!!!
} else if (PS->_ControlVolt <= PS->_VOrigin) {
current_direction_up = true;
if (PS->_CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
}
PS->_CycleNumber--;
}
} else {
if (PS->_ControlVolt <= PS->_VStop) {
current_direction_up = true; // problem occurs when origin == 0000 final == ffff!!!!!!
} else if (PS->_ControlVolt >= PS->_VOrigin) {
current_direction_up = false;
if (PS->_CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
}
PS->_CycleNumber--;
}
}
// Next output voltage
if (direction_up) {
if (current_direction_up) {
// PS->_ControlVolt overflow ?
if (PS->_ControlVolt + PS->_Step < PS->_ControlVolt) {
PS->_ControlVolt = PS->_VStop;
}
else if (PS->_ControlVolt + PS->_Step > PS->_VStop) {
PS->_ControlVolt =PS->_VStop;
}
else {
PS->_ControlVolt = PS->_ControlVolt + PS->_Step;
}
}
else {
// PS->_ControlVolt underflow ?
if (PS->_ControlVolt - PS->_Step > PS->_ControlVolt || PS->_ControlVolt > 60000) {
PS->_ControlVolt = PS->_VOrigin;
}
// reach Vorigin ?
else if (PS->_ControlVolt - PS->_Step < PS->_VOrigin) {
PS->_ControlVolt = PS->_VOrigin;
}
else {
PS->_ControlVolt = PS->_ControlVolt - PS->_Step;
}
}
}
else {
if (current_direction_up) {
if (PS->_ControlVolt + PS->_Step < PS->_ControlVolt) {
PS->_ControlVolt = PS->_VOrigin;
}
else if (PS->_ControlVolt + PS->_Step > PS->_VOrigin) {
PS->_ControlVolt = PS->_VOrigin;
}
else {
PS->_ControlVolt = PS->_ControlVolt + PS->_Step;
}
}
else {
if (PS->_ControlVolt - PS->_Step > PS->_ControlVolt || PS->_ControlVolt > 60000) {
PS->_ControlVolt = PS->_VStop ;
}
else if (PS->_ControlVolt - PS->_Step < PS->_VStop) {
PS->_ControlVolt = PS->_VStop;
}
else {
PS->_ControlVolt = PS->_ControlVolt - PS->_Step;
}
}
}
DACOutCode = PS->_MeasureVolt - PS->_ControlVolt;
DACOutCode = Usercode_Correction_to_DAC(DACOutCode);
DAC_outputV(DACOutCode);
}
DAC_ControlVolt = Usercode_Correction_to_DAC(PS->_ControlVolt);
return DAC_ControlVolt;
}
static void PS_Plot(PSMode* PS){
static uint8_t VoltCurrentSwitch = 0;
uint16_t ADC_measure = 0;
if(VoltCurrentSwitch < 5){
ReadCurrent(spi_ADC_rxbuf);
VoltCurrentSwitch ++;
}
else if(VoltCurrentSwitch == 5){
// read current
ReadCurrent(spi_ADC_rxbuf);
ADC_measure = (uint16_t) (spi_ADC_rxbuf[0] << 8) | (uint16_t) (spi_ADC_rxbuf[1]);
PS->_MeasureData = DecodeADCCurrent(INSTRUCTION.ADCGainLevel, ADC_measure);
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]);
PS->_MeasureVolt = DecodeADCVolt(ADC_measure);
VoltCurrentSwitch++;
}
else{
VoltCurrentSwitch = 0;
}
NotifyCurrent[0] = (uint8_t) (PS->_MeasureData >> 24);
NotifyCurrent[1] = (uint8_t) ((PS->_MeasureData & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((PS->_MeasureData & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (PS->_MeasureData & 0x000000FF);
// NotifyVolt[0] = (uint8_t) (PS->_MeasureVolt >> 24);
// NotifyVolt[1] = (uint8_t) ((PS->_MeasureVolt & 0x00FF0000) >> 16);
// NotifyVolt[2] = (uint8_t) ((PS->_MeasureVolt & 0x0000FF00) >> 8);
// NotifyVolt[3] = (uint8_t) (PS->_MeasureVolt & 0x000000FF);
// if (PS->_VOrigin < PS->_VStop) {
// if(PS->MeasureVolt >= (PS->_VStop - DAC_ZERO)/5){
// PeriodicEvent = false;
// DACReset = true;
// }
// }
// else{
// if(PS->MeasureVolt <= (PS->_VStop - DAC_ZERO)/5){
// PeriodicEvent = false;
// DACReset = true;
// }
// }
}
#endif
@@ -3,15 +3,14 @@
#define ELITERESET
static void reset() {
PeriodicEvent = false;
DACReset = true;
CCModeReset = 1;
InitEliteInstruction();
SampleRate_counter = 1;
StepTimeCounter = 1;
DiscardIVFirstData = 1;
InitFlag();
InitCT();
// IV/CV mode reset
DiscardIVFirstData = 0;
avg_number = 0;
ADCRealCurrent_long = 0;
ADCGainControl(INSTRUCTION.ADCGainLevel);
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
@@ -50,17 +49,15 @@ static void reset() {
}
static void Eliteinterrupt() {
PeriodicEvent = false;
DACReset = true;
CCModeReset = 1;
InitEliteInstruction();
StepTimeCounter = 1;
SampleRate_counter = 1;
DiscardIVFirstData = 1;
InitFlag();
InitCT();
// IV/CV mode reset
DiscardIVFirstData = 0;
avg_number = 0;
ADCRealCurrent_long = 0;
ADCGainControl(INSTRUCTION.ADCGainLevel);
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
// ADCGainControl(INSTRUCTION.ADCGainLevel);
// DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
LEDPowerON();
for (int i = 0; i < BLE_INS_BUFF_SIZE; i++) {
@@ -92,13 +89,10 @@ static void Eliteinterrupt() {
}
static void CleanBuffer() {
PeriodicEvent = false;
DACReset = true;
CCModeReset = 1;
// InitEliteInstruction();
SampleRate_counter = 1;
StepTimeCounter = 1;
DiscardIVFirstData = 1;
InitFlag();
InitEliteInstruction();
InitCT();
DiscardIVFirstData = 0;
avg_number = 0;
ADCRealCurrent_long = 0;
@@ -2,17 +2,21 @@
#ifndef ELITEVT
#define ELITEVT
static void VT_Plot() {
static void VT_Plot(VTMode *VT) {
// ADC gain is don't care when measuring voltage
uint8_t ADCGain = 0;
// read ADC volt
ADCChannelSelect(ADC_CH_VOLT);
CPUdelay(10);
ADC_read(spi_ADC_rxbuf);
ReadVolt(spi_ADC_rxbuf);
// decode ADC value and put it into notify buffer
DecodeADCValue(ADCGain, ADC_CH_VOLT, spi_ADC_rxbuf);
VT->SetMeasureData((struct Measure *) VT, DecodeADCValue(ADCGain, 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);
}
#endif
@@ -0,0 +1,586 @@
/**
*
* struct WorkMode{
* // Measure Only
* ITMode;
* VTMode;
*
* // Measure + VoltOut
* RTMode;
* IVMode;
* CVMode;
*
* // Volt out only
* VOutMode
* }
*
* -------------------------------
* // Measure Only
* struct ITMode{
* MeasureData
* SetMeasureData()
* GetMeasureData()
* }
*
* -------------------------------
* // VoltOut parameter
* stuct VOutMode{
* Vout_UC
* VoltOrigin
* Vstop;
* Step;
* StepTime;
* CycleNumber;
* }
*
*/
#ifndef ELITE_WORK_DATA
#define ELITE_WORK_DATA
#include "EliteInstruction.h"
#define IV_CURVE 0b00010000
#define CV_CURVE 0b00100000
#define VOLT_OUTPUT 0b00110000
#define ZT_CURVE 0b01000000
#define VT_CURVE 0b01010000
#define IT_CURVE 0b01100000
#define SET_SAMPLE_RATE 0b01110000
#define SET_ADC_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
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 *)
/* VoltOut is an UserCode */
/* VOrigin, VStop, Step are all UserCode */
#define VOUT_PARA \
uint16_t _VoltOut; \
uint16_t _VOrigin; \
uint16_t _VStop; \
uint16_t _Step; \
uint16_t _StepTime; \
uint16_t _CycleNumber
// void (*SetVoltOut) (struct VoltOutPara *, uint16_t); \
// uint16_t (*GetVoltOut) (struct VoltOutPara *); \
// void (*SetVOrigin) (struct VoltOutPara *, uint16_t); \
// uint16_t (*GetVOrigin) (struct VoltOutPara *); \
// void (*SetVStop) (struct VoltOutPara *, uint16_t); \
// uint16_t (*GetVStop) (struct VoltOutPara *); \
// void (*SetStep) (struct VoltOutPara *, uint16_t); \
// uint16_t (*GetStep) (struct VoltOutPara *); \
// void (*SetStepTime) (struct VoltOutPara *, uint16_t); \
// uint16_t (*GetStepTime) (struct VoltOutPara *); \
// void (*SetCycleNumber) (struct VoltOutPara *, uint16_t); \
// uint16_t (*GetCycleNumber) (struct VoltOutPara *)
#define LIMIT \
uint32_t _LimitValue; \
void (*SetLimitValue) (struct Limit *, uint32_t); \
uint32_t (*GetLimitValue) (struct Limit*)
struct Measure{
MEASURE;
};
struct VoltOutPara{
VOUT_PARA;
};
struct Limit{
LIMIT;
};
/***** 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;
}
/**** Limit Mode ****/
//LimitValue
void _SetLimitValue(struct Limit *self, uint32_t LimitValue){
self->_LimitValue = LimitValue;
}
uint32_t _GetLimitValue(struct Limit *self){
return self->_LimitValue;
}
/* IT Mode Data */
typedef struct _ITMode{
MEASURE;
LIMIT;
}ITMode;
ITMode * InitITMode(){
ITMode *ret = malloc(sizeof(ITMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
ret->_LimitValue = 0;
ret->SetLimitValue = &_SetLimitValue;
ret->GetLimitValue = &_GetLimitValue;
return ret;
}
/* End of IT Mode Data */
/* VT Mode Data */
typedef struct _VTMode{
MEASURE;
}VTMode;
VTMode * InitVTMode(){
VTMode *ret = malloc(sizeof(VTMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
return ret;
}
/* End of VT 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 Mode Data */
typedef struct _VoltOutMode{
VOUT_PARA;
}VoltOutMode;
VoltOutMode *InitVoltOutMode(){
VoltOutMode *ret = malloc(sizeof(VoltOutMode));
ret->_VoltOut = INSTRUCTION.VoltConstant; // 25000 is DAC_ZERO
ret->_VOrigin = DAC_ZERO;
ret->_VStop = DAC_ZERO;
ret->_Step = 0;
ret->_StepTime = 10000; // STEPTIME_ONE_SEC
ret->_CycleNumber = 1;
// ret->SetVoltOut = &_SetVoltOut;
// ret->GetVoltOut = &_GetVoltOut;
// ret->SetVOrigin = &_SetVOrigin;
// ret->GetVOrigin = &_GetVOrigin;
// ret->SetVStop = &_SetVStop;
// ret->GetVStop = &_GetVStop;
// ret->SetStep = &_SetStep;
// ret->GetStep = &_GetStep;
// ret->SetStepTime = &_SetStepTime;
// ret->GetStepTime = &_GetStepTime;
// ret->SetCycleNumber = &_SetCycleNumber;
// ret->GetCycleNumber = &_GetCycleNumber;
return ret;
}
/* End of VoltOut Mode Data */
/**** End of VoltOut Only Mode ****/
/**** Measure + VoltOut Mode ****/
/* IV Mode Data */
typedef struct _IVMode{
MEASURE;
int32_t MeasureVolt;
VOUT_PARA;
LIMIT;
}IVMode;
IVMode *InitIVMode(){
IVMode *ret = malloc(sizeof(IVMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
ret->MeasureVolt = 0;
ret->_VoltOut = DAC_ZERO;
ret->_VOrigin = INSTRUCTION.VoltOrigin;
ret->_VStop = INSTRUCTION.VoltFinal;
ret->_Step = INSTRUCTION.Step;
ret->_StepTime = INSTRUCTION.StepTime;
ret->_CycleNumber = 1;
// ret->SetVoltOut = &_SetVoltOut;
// ret->GetVoltOut = &_GetVoltOut;
// ret->SetVOrigin = &_SetVOrigin;
// ret->GetVOrigin = &_GetVOrigin;
// ret->SetVStop = &_SetVStop;
// ret->GetVStop = &_GetVStop;
// ret->SetStep = &_SetStep;
// ret->GetStep = &_GetStep;
// ret->SetStepTime = &_SetStepTime;
// ret->GetStepTime = &_GetStepTime;
// ret->SetCycleNumber = &_SetCycleNumber;
// ret->GetCycleNumber = &_GetCycleNumber;
ret->_LimitValue = 1e5;
ret->SetLimitValue = &_SetLimitValue;
ret->GetLimitValue = &_GetLimitValue;
return ret;
}
/* End of IV Mode Data */
/* RT Mode Data */
typedef struct _RTMode{
MEASURE;
VOUT_PARA;
}RTMode;
RTMode * InitRTMode(){
RTMode *ret = malloc(sizeof(RTMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
ret->_VoltOut = DAC_ZERO; // 25000 is DAC_ZERO
ret->_VOrigin = DAC_ZERO;
ret->_VStop = DAC_ZERO;
ret->_Step = 0;
ret->_StepTime = 10000; // STEPTIME_ONE_SEC
ret->_CycleNumber = 1;
// ret->SetVoltOut = &_SetVoltOut;
// ret->GetVoltOut = &_GetVoltOut;
// ret->SetVOrigin = &_SetVOrigin;
// ret->GetVOrigin = &_GetVOrigin;
// ret->SetVStop = &_SetVStop;
// ret->GetVStop = &_GetVStop;
// ret->SetStep = &_SetStep;
// ret->GetStep = &_GetStep;
// ret->SetStepTime = &_SetStepTime;
// ret->GetStepTime = &_GetStepTime;
// ret->SetCycleNumber = &_SetCycleNumber;
// ret->GetCycleNumber = &_GetCycleNumber;
return ret;
}
/* End of RT Mode Data */
/* CV Mode*/
typedef struct _CVMode{
MEASURE;
VOUT_PARA;
}CVMode;
CVMode * InitCVMode(){
CVMode *ret = malloc(sizeof(CVMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
ret->_VoltOut = DAC_ZERO; // 25000 is DAC_ZERO
ret->_VOrigin = INSTRUCTION.VoltOrigin;
ret->_VStop = INSTRUCTION.VoltFinal;
ret->_Step = INSTRUCTION.Step;
ret->_StepTime = INSTRUCTION.StepTime; // STEPTIME_ONE_SEC
ret->_CycleNumber = INSTRUCTION.CycleNumber;
// ret->SetVoltOut = &_SetVoltOut;
// ret->GetVoltOut = &_GetVoltOut;
// ret->SetVOrigin = &_SetVOrigin;
// ret->GetVOrigin = &_GetVOrigin;
// ret->SetVStop = &_SetVStop;
// ret->GetVStop = &_GetVStop;
// ret->SetStep = &_SetStep;
// ret->GetStep = &_GetStep;
// ret->SetStepTime = &_SetStepTime;
// ret->GetStepTime = &_GetStepTime;
// ret->SetCycleNumber = &_SetCycleNumber;
// ret->GetCycleNumber = &_GetCycleNumber;
return ret;
}
/*End of CV Mode*/
/* Const Current Mode */
#define CC_ZERO_POINT 1500000
#define MAX_DAC_UC 50000
#define MIN_DAC_UC 0
#define CURRENT_LV_ONE 1
#define CURRENT_LV_ZERO 0
/*********************************************************************
* @struct Constant Current Code
*
* @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 *);
}CCMode;
/*********************************************************************
* @fn Transform2RealnA
*
* @brief transform an IUC into real current value in nA.
*
* @param self, which is an IUC
*
* @return an int32_t current value in nA
*/
int32_t _Transform2RealnA(CCMode *self){
int32_t IUCReal;
// self->value : 0 ~ 3000000 (which is -1500000 ~ 1500000 (10nA) )
IUCReal = (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->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;
ret->DischargeCurrent = 0;
ret->CycleNumber = 0;
ret->StandBy = false;
ret->StandByTime = 0;
ret->_Transform2RealnA = &_Transform2RealnA;
return ret;
}
/*End of Const Current Mode Mode*/
/** Potential State Mode **/
typedef struct _PS{
// measure
MEASURE; // circuit current
int16_t _ControlVolt;
int32_t _MeasureVolt;
VOUT_PARA;
}PSMode;
PSMode *InitPSMode(){
PSMode *ret = malloc(sizeof(PSMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
ret->_ControlVolt = INSTRUCTION.VoltOrigin;
ret->_MeasureVolt = INSTRUCTION.VoltOrigin;
ret->_VoltOut = DAC_ZERO; // 25000 is DAC_ZERO
ret->_VOrigin = INSTRUCTION.VoltOrigin;
ret->_VStop = INSTRUCTION.VoltFinal;
ret->_Step = INSTRUCTION.Step;
ret->_StepTime = INSTRUCTION.StepTime; // STEPTIME_ONE_SEC
ret->_CycleNumber = INSTRUCTION.CycleNumber;
return ret;
}
/** End of Potential State Mode **/
typedef union _WorkMode{
// Measure only
ITMode *IT;
VTMode *VT;
// Output Only
VoltOutMode *VO;
// Measure + Output
IVMode *IV;
CVMode *CV;
RTMode *RT;
CCMode *CC;
PSMode *PS;
}WorkMode;
WorkMode *CreateWorkMode(){
WorkMode *ret = malloc(sizeof(WorkMode));
return ret;
}
void InitWorkMode(WorkMode *WM){
switch(INSTRUCTION.eliteFxn){
case IV_CURVE:
WM->IV = InitIVMode();
break;
case CV_CURVE:
WM->CV = InitCVMode();
break;
case VOLT_OUTPUT:
WM->VO = InitVoltOutMode();
break;
case ZT_CURVE:
WM->RT = InitRTMode();
break;
case VT_CURVE:
WM->VT = InitVTMode();
break;
case IT_CURVE:
WM->IT = InitITMode();
break;
case CONSTANT_CURRENT:
WM->CC = InitCCMode();
break;
case POTENTIAL_STATE:
WM->PS = InitPSMode();
break;
default:
WM->VT = InitVTMode();
break;
}
}
void FreeWorkMode(WorkMode *WM){
switch(INSTRUCTION.eliteFxn){
case IV_CURVE:
if(WM->IV != NULL){
free(WM->IV);
WM->IV = NULL;
}
break;
case CV_CURVE:
if(WM->CV != NULL){
free(WM->CV);
WM->CV = NULL;
}
break;
case VOLT_OUTPUT:
if(WM->VO != NULL){
free(WM->VO);
WM->VO = NULL;
}
break;
case ZT_CURVE:
if(WM->RT != NULL){
free(WM->RT);
WM->RT = NULL;
}
break;
case VT_CURVE:
if(WM->VT != NULL){
free(WM->VT);
WM->VT = NULL;
}
break;
case IT_CURVE:
if(WM->IT != NULL){
free(WM->IT);
WM->IT = NULL;
}
break;
case CONSTANT_CURRENT:
if(WM->CC != NULL){
free(WM->CC);
WM->CC = NULL;
}
break;
case POTENTIAL_STATE:
if(WM->PS != NULL){
free(WM->PS);
WM->PS = NULL;
}
break;
default:
if(WM->IV != NULL){
free(WM->IV);
WM->IV = NULL;
}
break;
}
// free(WM);
}
#endif
@@ -9,64 +9,98 @@ static void ZT_notify(int32_t impedance);
// => calculate the resister
// change the output voltage step
// => get a R-T curve (with resolution = 1 sample/volt step )
static void ZT_Plot() {
int32_t Real_Resister = 0;
static 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;
// set ADC GAIN
if(INSTRUCTION.ResisterMeter == RESISTER_METER_LARGE){
INSTRUCTION.ADCGainLevel = GAIN_200R;
}
else if(INSTRUCTION.ResisterMeter == RESISTER_METER_MIDDLE2){
INSTRUCTION.ADCGainLevel = GAIN_200R;
}
else if(INSTRUCTION.ResisterMeter == RESISTER_METER_MIDDLE1){
INSTRUCTION.ADCGainLevel = GAIN_10K;
int32_t volt_32 = 0;
int32_t current_32 = 0;
int32_t resister_32 = 0;
if(INSTRUCTION.AutoGainEnable){
current_32 = AutoGainReadCurrent(SPICurrent);
}
else{
INSTRUCTION.ADCGainLevel = GAIN_200K;
ReadCurrent(spi_ADC_rxbuf);
current_32 = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
ADCGainControl(INSTRUCTION.ADCGainLevel);
volt_32 = User2Real(INSTRUCTION.VoltConstant)*1e4;
// ReadVolt(SPIVolt);
// VoltMeasure = (uint16_t) (SPIVolt[0] << 8) | (uint16_t) (SPIVolt[1]);
// volt_32 = DecodeADCVolt(VoltMeasure)*1e4;
resister_32 = volt_32 / current_32;
NotifyVolt[0] = (uint8_t) (volt_32 >> 24);
NotifyVolt[1] = (uint8_t) ((volt_32 & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((volt_32 & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (volt_32 & 0x000000FF);
NotifyCurrent[0] = (uint8_t) (current_32 >> 24);
NotifyCurrent[1] = (uint8_t) ((current_32 & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((current_32 & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (current_32 & 0x000000FF);
NotifyImpedance[0] = (uint8_t) (resister_32 >> 24);
NotifyImpedance[1] = (uint8_t) ((resister_32 & 0x00FF0000) >> 16);
NotifyImpedance[2] = (uint8_t) ((resister_32 & 0x0000FF00) >> 8);
NotifyImpedance[3] = (uint8_t) (resister_32 & 0x000000FF);
// set ADC GAIN
// if(INSTRUCTION.ResisterMeter == RESISTER_METER_LARGE){
// INSTRUCTION.ADCGainLevel = GAIN_200R;
// }
// else if(INSTRUCTION.ResisterMeter == RESISTER_METER_MIDDLE2){
// INSTRUCTION.ADCGainLevel = GAIN_200R;
// }
// else if(INSTRUCTION.ResisterMeter == RESISTER_METER_MIDDLE1){
// INSTRUCTION.ADCGainLevel = GAIN_10K;
// }
// else{
// INSTRUCTION.ADCGainLevel = GAIN_200K;
// }
// ADCGainControl(INSTRUCTION.ADCGainLevel);
// Use 9-th measure value as real-measure value
// because some value in the begin are garbage
if(VoltCurrentSwitch < 9){
ADCChannelSelect(ADC_CH_CURRENT);
CPUdelay(10);
ADC_read(SPICurrent);
VoltCurrentSwitch ++;
}
else if(VoltCurrentSwitch == 9){
// read current
ADCChannelSelect(ADC_CH_CURRENT);
CPUdelay(10);
ADC_read(SPICurrent);
CurrentMeasure = (uint16_t) (SPICurrent[0] << 8) | (uint16_t) (SPICurrent[1]);
VoltCurrentSwitch ++;
}
else if(VoltCurrentSwitch <18){
// read volt
ADCChannelSelect(ADC_CH_VOLT);
CPUdelay(10);
ADC_read(SPIVolt);
VoltCurrentSwitch++;
}
else if(VoltCurrentSwitch == 18){
// read volt
ADCChannelSelect(ADC_CH_VOLT);
CPUdelay(10);
ADC_read(SPIVolt);
VoltMeasure = (uint16_t) (SPIVolt[0] << 8) | (uint16_t) (SPIVolt[1]);
VoltCurrentSwitch++;
}
else{
VoltCurrentSwitch = 0;
}
// if(VoltCurrentSwitch < 9){
// ADCChannelSelect(ADC_CH_CURRENT);
// CPUdelay(10);
// ADC_read(SPICurrent);
// VoltCurrentSwitch ++;
// }
// else if(VoltCurrentSwitch == 9){
// // read current
// ADCChannelSelect(ADC_CH_CURRENT);
// CPUdelay(10);
// ADC_read(SPICurrent);
// CurrentMeasure = (uint16_t) (SPICurrent[0] << 8) | (uint16_t) (SPICurrent[1]);
// VoltCurrentSwitch ++;
// }
// else if(VoltCurrentSwitch <18){
// // read volt
// ADCChannelSelect(ADC_CH_VOLT);
// CPUdelay(10);
// ADC_read(SPIVolt);
// VoltCurrentSwitch++;
// }
// else if(VoltCurrentSwitch == 18){
// // read volt
// ADCChannelSelect(ADC_CH_VOLT);
// CPUdelay(10);
// ADC_read(SPIVolt);
// VoltMeasure = (uint16_t) (SPIVolt[0] << 8) | (uint16_t) (SPIVolt[1]);
// VoltCurrentSwitch++;
// }
// else{
// VoltCurrentSwitch = 0;
// }
// decode ADC value and put it into notify buffer
DecodeResister(INSTRUCTION.ADCGainLevel, CurrentMeasure, VoltMeasure);
// DecodeResister(INSTRUCTION.ADCGainLevel, CurrentMeasure, VoltMeasure);
// Real_Resister = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
@@ -26,17 +26,13 @@
/* I2C */
#ifdef ELITE_VERSION_1_4
#define Board_I2C0_SCL0 IOID_7
#define Board_I2C0_SDA0 IOID_14
#define Board_I2C0_SDA0 IOID_1
#endif
#define Board_I2C0_SCL0 IOID_7
#define Board_I2C0_SDA0 IOID_14
#define shutdown_6994 IOID_10
#define switch_on IOID_11
#define power_enable IOID_12
#define current_waste IOID_13
#define enable_10v IOID_12
#define enable_5v IOID_13
PIN_Handle pin_handle;
static PIN_State ZM_rst;
@@ -46,12 +42,12 @@ 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
power_enable | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // 5V & 10V enable
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,
current_waste | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // extreme_waste_of_current
PIN_TERMINATE
};
@@ -190,58 +186,5 @@ const I2C_Config I2C_config[] = {
*/
#endif
#ifdef ELITE_VERSION_BAT
/* Generic I2C instance identifiers */
#define Board_I2C CC2650_MA_I2C0
/*!
* @def CC2650_LAUNCHXL_I2CName
* @brief Enum of I2C names on the CC2650 dev board
*/
typedef enum CC2650_MA_I2CName {
CC2650_MA_I2C0 = 0,
CC2650_MA_I2CCOUNT
} CC2650_MA_I2CName;
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(I2C_config, ".const:I2C_config")
#pragma DATA_SECTION(i2cCC26xxHWAttrs, ".const:i2cCC26xxHWAttrs")
#endif
/* Include drivers */
#include <ti/drivers/i2c/I2CCC26XX.h>
/* I2C objects */
I2CCC26XX_Object i2cCC26xxObjects[CC2650_MA_I2CCOUNT];
/* I2C configuration structure, describing which pins are to be used */
const I2CCC26XX_HWAttrsV1 i2cCC26xxHWAttrs[CC2650_MA_I2CCOUNT] = {
{
.baseAddr = I2C0_BASE,
.powerMngrId = PowerCC26XX_PERIPH_I2C0,
.intNum = INT_I2C_IRQ,
.intPriority = ~0,
.swiPriority = 0,
.sdaPin = Board_I2C0_SDA0,
.sclPin = Board_I2C0_SCL0,
}
};
/* I2C configuration structure */
const I2C_Config I2C_config[] = {
{
.fxnTablePtr = &I2CCC26XX_fxnTable,
.object = &i2cCC26xxObjects[0],
.hwAttrs = &i2cCC26xxHWAttrs[0]
},
{NULL, NULL, NULL}
};
/*
* ========================== I2C end =========================================
*/
#endif
#endif
@@ -374,15 +374,14 @@ characteristic change event
#define HEADSTAGE_H
// product information
#define DEVICE_NAME "Elite-BAT01"
#define DEVICE_NAME "Elite-ZM-v1.4-re"
#define MAJOR_PRODUCT_NUMBER 0
#define MINOR_PRODUCT_NUMBER 2
#define MAJOR_VERSION_NUMBER 1
#define MINOR_VERSION_NUMBER 4
#define MINOR_VERSION_NUMBER 2
//#define ELITE_VERSION_1_4
#define ELITE_VERSION_1_3
#define ELITE_VERSION_BAT
#define ELITE_VERSION_1_4
//#define ELITE_VERSION_1_3
#include <driverlib/timer.h>
#include <ti/drivers/SPI.h>
@@ -432,6 +431,7 @@ static Clock_Struct periodicClock;
#include "simple_gatt_profile.h"
static bool PeriodicEvent = false;
static bool InitPeriodicEvent = true;
static ICall_Semaphore semaphore;
static uint16_t events;
@@ -602,38 +602,20 @@ static void set_update_instruction_callback(update_instruction_callback_type cal
static uint16_t DAC_outputV(uint16_t voltLV);
static int32_t DAC_to_realV(uint16_t DACcode);
// DAC function for BAT
static uint16_t DAC_outputCV(uint16_t voltLV);
static uint16_t DAC_outputCC(uint16_t voltLV);
/* DAC reset parameter */
#define DAC_ZERO 0x85B2
#define DAC_POS_MAX 0x0000
#define DAC_NEG_MAX 0xFFFF
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 SampleRate_counter = 1;
// record value for IV curve to calculate average current
static uint8_t DiscardIVFirstData = 1;
static uint16_t avg_number = 0;
static long long ADCRealCurrent_long = 0;
// Step time macro
#define STEPTIME_HALF_SEC 5000
#define STEPTIME_ONE_SEC 10000
#define STEPTIME_TWO_SEC 20000
// Constant Current Mode function
static uint8_t CCModeReset = 1;
static uint8_t CCModeDACEnable = 0;
static int32_t CCModeReadCurrent();
static int32_t CCModeVoltOut();
static void SetCCModeGain();
static void CCCurrent2IUC();
static int32_t IUC2RealnA();
static int32_t IUC2RealpA();
// for DPVCurve SWVCurve
static uint16_t Amplitude;
@@ -642,16 +624,28 @@ static uint16_t PulseWidth_16;
static uint8_t PulsePeriod;
static uint16_t PulsePeriod_16;
static uint16_t StepTimeCounter = 1;
struct _CT{
uint32_t SampleRate_counter;
uint16_t StepTimeCounter;
uint16_t NotifyCounter;
uint32_t StandByCounter;
}CT = {0};
static void InitFlag();
static void InitCT();
#include "EliteWorkData.h"
// real instruction fxn
static uint16_t VoltScan(); // used in I-V and cyclic
static uint16_t VoltScan(WorkMode *WorkModeData); // used in I-V and cyclic
static void DACCode2Real2Notify(uint16_t DACcode); // send notify voltage after VoltScan()
//static void VOLT_OUTPUT();
static void ZT_Plot();
static void VT_Plot();
static int32_t IT_Plot();
static void ZT_Plot(RTMode *RT);
static void VT_Plot(VTMode *VT);
static void IV_Plot(IVMode *IV);
static void PS_Plot(PSMode *PS);
static int32_t IT_Plot(WorkMode *WorkModeData);
// the following fxn do the same thing
// IVCurve_T is called if Vorigin > Vfinal, vice versa
@@ -661,11 +655,12 @@ static uint8_t OldStep2NewStep(uint8_t OldStep);
static uint16_t OldStep2NewStepTime(uint8_t StepTime);
static uint8_t IVdone = 0;
static uint16_t OneWayVoltScan();
static uint16_t OneWayVoltScan(IVMode *IV);
static void ramp_test();
static uint16_t DPVCurve();
static uint16_t CVCurve();
static uint16_t SWVCurve();
static uint16_t DPVCurve(WorkMode *WorkModeData);
static uint16_t CVCurve(CVMode *CV);
static uint16_t SWVCurve(WorkMode *WorkModeData);
static uint16_t PSCurve(PSMode *PS);
static void reset();
static void Eliteinterrupt();
@@ -676,6 +671,7 @@ static void SendNotify();
static bool If10Von = false;
static void TurnOn10V();
#include "EliteInstruction.h"
#include "EliteADC.h"
#include "EliteDAC.h"
@@ -686,18 +682,16 @@ static void TurnOn10V();
#include "EliteI2C.h"
#endif
#ifdef ELITE_VERSION_BAT
#include "EliteI2C.h"
#endif
#include "EliteDeviceCorrection.h"
#include "EliteNotify.h"
#include "EliteFlagCTInit.h"
#include "EliteReset.h"
#include "EliteLED.h"
#include "EliteKeyDetect.h"
#include "EliteCCMode.h"
#include "EliteIVCurve.h"
#include "EliteCVCurve.h"
#include "ElitePSCurve.h"
#include "EliteITCurve.h"
#include "EliteVTCurve.h"
#include "EliteZTCurve.h"
@@ -710,7 +704,7 @@ static void update_ZM_instruction(uint8 *ins) {
INSTRUCTION.chip_id = chip_ID;
uint8_t oper = ins[1] & 0xF0; // this is don't care in RIS
uint8_t data_length = ins[1] & 0x0F;
// uint8_t data_length = ins[1] & 0x0F;
if (!If10Von) {
// TurnOn10V();
@@ -747,7 +741,7 @@ static void update_ZM_instruction(uint8 *ins) {
}
case DIFFERENTIAL_PULSE_VOLTAMMETRY: {
CleanBuffer();
// CleanBuffer();
INSTRUCTION.eliteFxn = DIFFERENTIAL_PULSE_VOLTAMMETRY;
DACReset = true;
@@ -782,7 +776,7 @@ static void update_ZM_instruction(uint8 *ins) {
}
case SQUARE_WAVE_VOLTAMMETRY: {
CleanBuffer();
// CleanBuffer();
INSTRUCTION.eliteFxn = SQUARE_WAVE_VOLTAMMETRY;
DACReset = true;
@@ -811,7 +805,6 @@ static void update_ZM_instruction(uint8 *ins) {
}
break;
}
case CV_CURVE: {
// CleanBuffer();
INSTRUCTION.eliteFxn = CV_CURVE;
@@ -842,12 +835,9 @@ static void update_ZM_instruction(uint8 *ins) {
break;
}
case VOLT_OUTPUT: {
INSTRUCTION.eliteFxn = VOLT_OUTPUT;
INSTRUCTION.VoltConstant = ( ((uint16_t)(ins[3])) << 8) | (uint16_t)(ins[4]);
// DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
DAC_outputV(INSTRUCTION.VoltConstant);
break;
}
@@ -876,26 +866,49 @@ static void update_ZM_instruction(uint8 *ins) {
case SET_SAMPLE_RATE: {
INSTRUCTION.SampleRateIndex = ins[3];
INSTRUCTION.SampleRate = SampleRateTable[INSTRUCTION.SampleRateIndex];
SampleRate_counter = 1;
CT.SampleRate_counter = 1;
break;
}
case POTENTIAL_STATE: {
INSTRUCTION.eliteFxn = POTENTIAL_STATE;
DACReset = true;
INSTRUCTION.SampleRate = 1000;
// test
not_buf[0] = ins[3];
not_buf[1] = ins[4];
not_buf[2] = ins[5];
not_buf[3] = ins[6];
// SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
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]) {
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]) {
INSTRUCTION.StepTime = ins[9];
INSTRUCTION.StepTime = OldStep2NewStepTime(INSTRUCTION.StepTime);
}
if (ins[10]) {
INSTRUCTION.CycleNumber = ins[10];
}
// // test
// not_buf[0] = ins[3];
// not_buf[1] = ins[4];
// not_buf[2] = ins[5];
// not_buf[3] = ins[6];
// SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
break;
}
case CONSTANT_CURRENT:{
INSTRUCTION.eliteFxn = CONSTANT_CURRENT;
INSTRUCTION.SampleRate = 1000;
INSTRUCTION.CurrentLV = ins[3];
INSTRUCTION.ConstantCurrent = ( (uint32_t) (ins[4])<<24 | (uint32_t) (ins[5])<<16 | (uint32_t) (ins[6])<<8 | (uint32_t) (ins[7]) );
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.NotifyRate = 1000;
// GetInstructionParameter(ins+2);
// CCCurrent2IUC();
break;
@@ -903,6 +916,12 @@ static void update_ZM_instruction(uint8 *ins) {
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);
// }
@@ -925,9 +944,6 @@ static void update_ZM_instruction(uint8 *ins) {
int32_t ADCRealValue = 0;
uint8_t CIS_buf[9] = {0};
uint16_t ADCValueTemp = 0;
uint32_t ADCValueAVG = 0;
// for(int i=0 ; i<10 ; i++){
ADCGainControl(ins[3]);
ADCChannelSelect(ins[4]);
@@ -1,7 +1,7 @@
/*
* impedance_meter.h
*
* Created on: 2019~115
* Created on: 2019/01/15
* Author: benny
*/
#ifndef HEADSTAGE_H
@@ -19,8 +19,9 @@
// header
#include <ti/drivers/PIN.h>
#include "board.h"
#include "EliteWorkData.h"
static void SimpleBLEPeripheral_performPeriodicTask(CURRENT_USER_CODE *CurrentUserCode);
static void SimpleBLEPeripheral_performPeriodicTask(WorkMode *WorkModeData);
static void SimpleBLEPeripheral_clockHandler(UArg arg) {
// Store the event.
@@ -45,20 +46,17 @@ static void ZM_init() {
pin_handle = PIN_open(&ZM_rst, BLE_IO);
PIN_setOutputValue(pin_handle, shutdown_6994, 1); // OFF = 1 => turn off 6994
PIN_setOutputValue(pin_handle, 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
InitEliteInstruction();
ADCGainControl(INSTRUCTION.ADCGainLevel);
ADCGainControl(GAIN_AUTO);
elite_gptimer_open();
// PIN_setOutputValue(pin_handle, Turnon100R, 0);
// PIN_setOutputValue(pin_handle, Turnon10K, 0);
// PIN_registerIntCb(pin_handle, switch_on_callback);
PIN_setInterrupt(pin_handle, switch_on | PIN_IRQ_POSEDGE);
// PIN_registerIntCb(pin_handle, switch_on_callback);
// PIN_setInterrupt(pin_handle, switch_on | PIN_IRQ_POSEDGE);
}
static void ZM_update_instruction_callback(uint8_t ins_type, uint8_t chip_ID, uint8_t *ins) {}
@@ -80,6 +78,7 @@ static void DACCode2Real2Notify(uint16_t DACcode) {
(INSTRUCTION.eliteFxn == IT_CURVE) || \
(INSTRUCTION.eliteFxn == VT_CURVE) || \
(INSTRUCTION.eliteFxn == ZT_CURVE) || \
(INSTRUCTION.eliteFxn == POTENTIAL_STATE) || \
(INSTRUCTION.eliteFxn == CONSTANT_CURRENT) \
)
@@ -92,107 +91,136 @@ static void DACCode2Real2Notify(uint16_t DACcode) {
*
* @return None.
*/
static void SimpleBLEPeripheral_performPeriodicTask(CURRENT_USER_CODE *CurrentUserCode) {
static void SimpleBLEPeripheral_performPeriodicTask(WorkMode *WorkModeData) {
if ( IsPeriodicMode() ){
if (StepTimeCounter == INSTRUCTION.StepTime){
StepTimeCounter = 1;
// DAC counter
if (CT.StepTimeCounter == INSTRUCTION.StepTime){
CT.StepTimeCounter = 1;
}
else{
StepTimeCounter++;
CT.StepTimeCounter++;
}
if (SampleRate_counter == INSTRUCTION.SampleRate){
SampleRate_counter = 1;
// ADC counter
if (CT.SampleRate_counter == INSTRUCTION.SampleRate){
CT.SampleRate_counter = 1;
}
else{
SampleRate_counter++;
CT.SampleRate_counter++;
}
// notify counter
if (CT.NotifyCounter == INSTRUCTION.NotifyRate){
CT.NotifyCounter = 1;
}
else{
CT.NotifyCounter ++;
}
/** Periodic Event **/
// Default working mode is DAC out -> ADC read -> send notify
// Default working flow is DAC out -> ADC read -> send notify
// We will need a flag to control DAC, if we want to exchange to ADC -> DAC -> notify
// This flag can be named by FxnNameReset
// This flag can be named by FxnNameDACReset
// In IV, CV, and func-gen mode, DAC will output voltage
// else DAC do nothing.
EliteDACControl(CurrentUserCode);
EliteDACControl(WorkModeData);
// Control ADC to sample rate
EliteADCControl(CurrentUserCode);
EliteADCControl(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));
FreeWorkMode(WorkModeData);
PeriodicEvent = false;
InitPeriodicEvent = true;
}
else{
PeriodicEvent = false;
}
}
static void EliteDACControl(CURRENT_USER_CODE *CurrentUserCode) {
if ((INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE)) {
static void EliteDACControl(WorkMode *WorkModeData) {
if ((INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE) || (INSTRUCTION.eliteFxn == POTENTIAL_STATE)) {
// output a certain voltage and put it into NotifyVolt
DACCode2Real2Notify(VoltScan());
DACCode2Real2Notify(VoltScan(WorkModeData));
}
else if (INSTRUCTION.eliteFxn == ZT_CURVE){
if(INSTRUCTION.ResisterMeter == RESISTER_METER_SMALL){
// output 1V
if (DACReset) {
INSTRUCTION.VoltConstant = 24999 + 5000;
// DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
INSTRUCTION.VoltConstant = 25000 + 5000;
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
DACReset = false;
}
}
else{
// output 1V
if (DACReset) {
INSTRUCTION.VoltConstant = 24999 + 5000;
// DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
INSTRUCTION.VoltConstant = 25000 + 5000;
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
DACReset = false;
}
}
}
else if(INSTRUCTION.eliteFxn == CONSTANT_CURRENT){
if (DACReset) {
// DAC_outputV(Usercode_Correction_to_DAC(CurrentUserCode->value));
DAC_outputV(Usercode_Correction_to_DAC(25000));
DACReset = false;
}
CCModeVoltOut(CurrentUserCode);
// DAC_outputV(Usercode_Correction_to_DAC(CurrentUserCode->value));
CCModeVoltOut(WorkModeData->CC);
}
else{
// IT, VT need only ADC measure
return;
}
}
static void EliteADCControl(CURRENT_USER_CODE *CurrentUserCode) {
if (SampleRate_counter == INSTRUCTION.SampleRate-1) {
static void EliteADCControl(WorkMode *WorkModeData) {
if (CT.SampleRate_counter == INSTRUCTION.SampleRate - 1) {
switch (INSTRUCTION.eliteFxn) {
case IV_CURVE:{
IT_Plot();
IV_Plot(WorkModeData->IV);
break;
}
case CV_CURVE:{
IT_Plot();
IT_Plot(WorkModeData);
break;
}
case IT_CURVE:{
IT_Plot();
IT_Plot(WorkModeData);
break;
}
case VT_CURVE:{
// read volt through ADC and put it into notify buffer
VT_Plot();
VT_Plot(WorkModeData->VT);
break;
}
case ZT_CURVE:{
ZT_Plot();
ZT_Plot(WorkModeData->RT);
break;
}
case CONSTANT_CURRENT:{
CCModeReadCurrent(CurrentUserCode);
CCModeReadCurrent(WorkModeData->CC);
CCModeReverseCurrent(WorkModeData->CC);
break;
}
case POTENTIAL_STATE:{
PS_Plot(WorkModeData->PS);
break;
}
default:{
IT_Plot(WorkModeData);
break;
}
}
@@ -205,12 +233,16 @@ static void EliteNotifyControl() {
if (!PeriodicEvent) {
SendNotify();
reset();
} else if (StepTimeCounter == INSTRUCTION.StepTime - 1) {
} else if (CT.StepTimeCounter == INSTRUCTION.StepTime - 1) {
SendNotify();
}
}
else if (SampleRate_counter == INSTRUCTION.SampleRate) {
else if((INSTRUCTION.eliteFxn == CONSTANT_CURRENT) || (INSTRUCTION.eliteFxn == POTENTIAL_STATE)){
if(CT.NotifyCounter == INSTRUCTION.NotifyRate){
SendNotify();
}
}
else if (CT.SampleRate_counter == INSTRUCTION.SampleRate) {
SendNotify();
}
}
@@ -529,7 +529,7 @@ static void SimpleBLEPeripheral_init(void) {
}
#include "EliteWorkData.h"
/*********************************************************************
* @fn SimpleBLEPeripheral_taskFxn
*
@@ -550,19 +550,15 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
headstage_init_device_info();
ZM_init();
Elite_SPI_init();
I2Cinit();
CURRENT_USER_CODE *CurrentUserCode = InitCurrentUserCode();
LEDPowerON();
WorkMode *WorkModeData = CreateWorkMode();
// uint8_t key_BAT = 0;
uint8_t key = 0;
uint16_t counter6994 = 0;
bool EliteOn = 0;
// init DAC, set output ~= 0 V
// DAC_outputV(Usercode_Correction_to_DAC(24999));
DAC_outputV(Usercode_Correction_to_DAC(25000));
elite_gptimer_start();
// Application main loops
@@ -615,17 +611,6 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
}
if(events & SBP_PERIODIC_EVT){
events &= ~SBP_PERIODIC_EVT;
// test LED functionality for Elite BAT
// key_BAT = PIN_getInputValue(switch_on);
// if (!key_BAT) {
// LED_color(DARKLED, 0x00, 0x99, 0x00); // green LED
// } else {
// LED_color(DARKLED, 0x99, 0x00, 0x00); // red LED
// }
// PIN_setOutputValue(pin_handle, power_enable, 1);
// LED_color(DARKLED, 0x00, 0x00, 0x99); // blue LED
if (!PeriodicEvent) { // if there is no periodic event
key = PIN_getInputValue(switch_on);
if (EliteOn) {
@@ -633,28 +618,39 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
counter6994++;
} else if (counter6994 == CLOCK_ONE_SECOND/2) {
PIN_setOutputValue(pin_handle, shutdown_6994, 1); // OFF = 1 => turn off 6994
#ifdef ELITE_VERSION_1_4
SPI_close(spiHandle0);
I2Cinit();
I2C_close(I2Chandle);
spiHandle0 = SPI_open(Board_SPI0, &spiParams0); // LED SPI
#endif
// #ifdef ELITE_VERSION_1_4
// SPI_close(spiHandle0);
// I2Cinit();
// I2C_close(I2Chandle);
// spiHandle0 = SPI_open(Board_SPI0, &spiParams0); // LED SPI
// #endif
counter6994++;
}
EliteKeyPress(key);
if(Free_Work_Mode){
FreeWorkMode(WorkModeData);
InitEliteInstruction();
ADCGainControl(INSTRUCTION.ADCGainLevel);
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
Free_Work_Mode = false;
}
} else {
EliteOn = TurnOnElite(key);
}
}
// if there is periodic event
else {
if(InitPeriodicEvent){
InitWorkMode(WorkModeData);
InitPeriodicEvent = false;
}
// Perform periodic application task
SimpleBLEPeripheral_performPeriodicTask(CurrentUserCode);
SimpleBLEPeripheral_performPeriodicTask(WorkModeData);
key = PIN_getInputValue(switch_on);
EliteKeyPress(key); // onPress=> key = 0; 1.lighten LED 2.long press shut down 2650
}
}
// if (events & SBP_PERIODIC_EVT)
@@ -665,7 +661,7 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
// SimpleBLEPeripheral_performPeriodicTask();
// }
// headstage_gptimer_main_handle();
// headstage_gptimer_main_handle();
#ifdef FEATURE_OAD
while (!Queue_empty(hOadQ)) {