Compare commits

...

1131 Commits

Author SHA1 Message Date
YiChin 0259d3ec61 TODO: delete auto gain 2019-11-11 19:11:12 +08:00
YiChin 8bc43f1bb0 [CC] This is a stable version 2019-11-11 11:06:55 +08:00
weiting2 50acc23eb1 [CC mode] read Vin 2019-11-11 10:52:21 +08:00
YiChin a26bad68a6 [CC] everything well, return Vin works ^^ 2019-11-11 10:46:13 +08:00
weiting2 f5796e8ac5 [CC mode] read Vin 2019-11-11 10:26:13 +08:00
YiChin c862e6790f [CC] everything well, NEED RETURN VIN 2019-11-08 17:38:55 +08:00
YiChin fb43ec6ac3 [CC] Vin + V_(Iin-GND) = battery V 2019-11-08 16:09:09 +08:00
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
weiting2 cad8a78164 check IUC-Measure difference 2019-10-16 10:48:27 +08:00
YiChin 0c4ebcac79 [CC] discharge fine, charge doesn't work 2019-10-16 10:41:17 +08:00
YiChin e700657d5d [CC] discharge fine, charge doesn't work 2019-10-15 18:16:17 +08:00
YiChin ea9fb92d53 [CC] discharge fine, charge doesn't work 2019-10-15 18:12:18 +08:00
YiChin ba215c7ca9 pointer->value compare error 2019-10-15 16:54:48 +08:00
YiChin 564dc6e266 test cc mode notify 2019-10-15 15:43:13 +08:00
weiting2 86a2e54694 trans IUC current update 2019-10-15 14:21:57 +08:00
YiChin 358950bec0 CC mode read, done 2019-10-15 12:17:53 +08:00
weiting2 de2cb269b7 check measure current 2019-10-14 18:42:24 +08:00
YiChin 151e829973 test IUC 2019-10-14 17:50:35 +08:00
YiChin 19121b55a7 test IUC 2019-10-14 17:34:25 +08:00
alan 31f03582a3 check notify 2019-10-14 17:27:10 +08:00
alan 0859f6da6d check notify 2019-10-14 17:12:27 +08:00
YiChin 120b7086e5 USA demo version 2019-10-14 10:05:43 +08:00
YiChin d393872d8c [CV] done 2019-10-10 17:28:29 +08:00
YiChin 3ab9afdcd3 Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-10-10 17:27:25 +08:00
YiChin 8812b4c103 [CV] done 2019-10-10 17:27:00 +08:00
Benny Liu 4cccced7ac calibration data for European 2019-10-09 18:40:09 +08:00
alan 7b3d342be6 [CV] Test turn back measure current 2019-10-09 16:50:26 +08:00
alan 97409c88c3 [IV][IT][VT][RT][Vout] work fine
[CV] turn direction has an offset bug
2019-10-08 19:01:03 +08:00
Benny Liu 1d675d9d78 calibration data 2019-10-08 18:57:00 +08:00
Benny Liu 1774a255d8 Merge branch 'Elite_ZTcurve' of https://gitlab.com/bioproscientific/bioprocc2650 into Elite_ZTcurve 2019-10-08 18:48:34 +08:00
Benny Liu 1863016b63 calibration data of various boards 2019-10-08 18:48:24 +08:00
YiChin 1e89a540a1 macro CAPS 2019-10-08 18:00:57 +08:00
alan 5daa67e054 Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-10-08 17:56:23 +08:00
alan 05ce7f7f44 [IV][CV] get sample after wait 0.1 sec 2019-10-08 17:56:08 +08:00
YiChin 9391c700a1 macro CAPS 2019-10-08 16:38:27 +08:00
YiChin 16c4ecf9f2 Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-10-08 16:34:58 +08:00
alan 7280f76fae [Test] CC mode Vout = Iconstant 2019-10-08 16:33:52 +08:00
YiChin 3a5d40a5d9 kelly macro CAPS 2019-10-08 11:56:22 +08:00
alan 40dd596fef CV mode debug 2019-10-08 10:15:59 +08:00
YiChin 56b240b101 CC mode can read current and set IUC correctly 2019-10-07 18:21:42 +08:00
alan bf36103499 test CCmode output Volt 2019-10-07 16:39:20 +08:00
YiChin 477144dc24 delete gain switch LED 2019-10-05 14:31:26 +08:00
alan 0aa45cfedc Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-10-05 14:12:41 +08:00
alan 4691345831 test CCmode output Volt 2019-10-05 14:12:22 +08:00
Benny Liu 8445f8c263 board BAY_BAY calibration data 2019-10-05 12:09:52 +08:00
Benny Liu 7176f91a3f fix error 2019-10-05 11:32:58 +08:00
Benny Liu e37065ce91 board Kelly calibration data 2019-10-05 11:29:46 +08:00
YiChin 2537b76256 error fix 2019-10-05 10:47:47 +08:00
alan 59e275c997 test switch ADC gain 2019-10-05 10:07:56 +08:00
105042004 bfe61896e8 BAYBAY Kwlly Iin callibration 2019-10-04 19:13:43 +08:00
alan 0ad8b13db2 Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-10-04 16:42:26 +08:00
alan 3c8abc04a8 ADC test WITHOUT avg 2019-10-04 16:42:08 +08:00
Benny Liu a48cf75c90 Merge branch 'Elite_ZTcurve' of https://gitlab.com/bioproscientific/bioprocc2650 into Elite_ZTcurve 2019-10-04 15:22:34 +08:00
alan 4f7017d5b2 Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-10-04 15:16:58 +08:00
alan 79f0d57161 ADC test with avg 2019-10-04 15:16:42 +08:00
Benny Liu d76e8e6f3f Merge branch 'Elite_ZTcurve' of https://gitlab.com/bioproscientific/bioprocc2650 into Elite_ZTcurve 2019-10-04 15:08:43 +08:00
Benny Liu b6147c1fe5 fish_vet calibration data 2019-10-04 15:08:32 +08:00
YiChin 4bbd92127a Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-10-04 15:03:31 +08:00
YiChin 337c2aef8d add CV curve 2019-10-04 15:03:11 +08:00
alan e943d22a5f Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-10-04 14:47:27 +08:00
alan bceb8b9134 ADC test with avg 2019-10-04 14:47:09 +08:00
YiChin 14adc8a768 10/4 demo version 2019-10-04 14:00:21 +08:00
YiChin 7c44ad2272 10/6 demo version 2019-10-04 11:22:07 +08:00
alan c8272dd455 Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-10-04 09:51:34 +08:00
YiChin cb2aa2126b 10/6 demo version 2019-10-03 18:35:55 +08:00
YiChin f74a412611 10/6 demo version 2019-10-03 18:18:23 +08:00
YiChin f0b92f8578 ADD 517 CORRECTION DATA 2019-10-03 18:14:15 +08:00
YiChin e7cae7dc21 10/6 demo version 2019-10-03 16:49:57 +08:00
YiChin 1c41bd7a45 Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-10-03 12:58:31 +08:00
YiChin a671a4916d 10/6 demo version 2019-10-03 12:57:18 +08:00
alan 15ea1488c9 Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-10-02 18:27:06 +08:00
Benny Liu f92dd743ef triceratops calibration data 2019-10-02 18:03:19 +08:00
alan eddbe3980a 10/6 demo version 2019-10-02 17:49:06 +08:00
Benny Liu b27df1489b Merge branch 'Elite_ZTcurve' of https://gitlab.com/bioproscientific/bioprocc2650 into Elite_ZTcurve 2019-10-02 17:46:35 +08:00
YiChin dc3f2ee046 10/6 demo version 2019-10-02 16:47:43 +08:00
YiChin ba7f03daeb 10/6 demo version 2019-10-02 16:19:14 +08:00
YiChin 079500faff 10/6 demo version 2019-10-02 16:13:21 +08:00
YiChin ce0defe5e9 RT mode demo prepare 2019-10-02 15:40:53 +08:00
alan 7b1bcd5147 Elite 1.4-re CCmode test read current 2019-10-02 14:01:34 +08:00
alan 787eb5dce1 Elite 1.4-re CCmode test read current 2019-10-02 12:04:45 +08:00
YiChin 9d73fab37e CC MDOE error fix 2019-10-02 11:31:39 +08:00
alan 6a833aabee Elite 1.4-re CCmode test read current 2019-10-01 18:42:42 +08:00
alan e40d0896b8 Elite 1.4-re CCmode test read current 2019-10-01 17:56:47 +08:00
alan c265eb0118 Elite 1.4-re CCmode test read current 2019-10-01 17:41:38 +08:00
alan cead3b0b5c 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/EliteCCMode.h
2019-10-01 17:22:56 +08:00
alan 238c09befd Elite 1.4-re CCmode test read current 2019-10-01 17:22:18 +08:00
YiChin de1867d523 CC MDOE error fix 2019-10-01 17:19:06 +08:00
YiChin 906e02e265 CC MDOE error fix 2019-10-01 16:47:14 +08:00
Benny Liu 307308825e time test 2019-10-01 16:24:30 +08:00
YiChin aaf166d187 CC MDOE error fix 2019-10-01 15:59:39 +08:00
YiChin 38ff1f8c2b CC MDOE error fix 2019-10-01 15:12:18 +08:00
YiChin 82f58b3255 CC MDOE error fix 2019-10-01 14:40:35 +08:00
alan 31d22f02e1 Elite 1.4-re CCmode test read current 2019-10-01 14:28:43 +08:00
alan ff1f517af5 Elite 1.4-re CCmode test read current 2019-10-01 09:53:10 +08:00
alan fb340fbec6 Elite 1.4-re CCmode test 2019-09-30 17:40:55 +08:00
YiChin e208bfd4d9 CC MDOE error fix 2019-09-30 16:33:57 +08:00
alan b9f4967a23 Elite 1.4-re CCmode test 2019-09-30 16:12:10 +08:00
YiChin 539a388ec4 CC MDOE error fix 2019-09-30 16:10:02 +08:00
alan f770ba8783 Elite 1.4-re CCmode test 2019-09-30 15:37:16 +08:00
alan 6d2ef3e106 Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-09-30 15:19:49 +08:00
alan e483c58f10 Elite 1.4-re CCmode test 2019-09-30 15:19:28 +08:00
YiChin b07c10bb53 CC MDOE error fix 2019-09-30 15:13:50 +08:00
alan bb10a463dc Elite 1.4-re CCmode test 2019-09-30 14:58:46 +08:00
YiChin 93e0db98fc CC MDOE error fix 2019-09-30 14:40:36 +08:00
YiChin 51fc4553a3 CC MDOE error fix 2019-09-30 14:31:15 +08:00
alan 5184fe76e7 Elite 1.4-re CCmode test 2019-09-30 14:26:45 +08:00
alan ee264a6f18 Elite 1.4-re CCmode test 2019-09-27 18:05:24 +08:00
YiChin d290201085 CC MDOE 2019-09-27 17:51:45 +08:00
alan 5ab5bdc301 Elite 1.4-re CCmode test 2019-09-27 17:37:10 +08:00
alan de995e2cec Elite 1.4-re CCmode test 2019-09-27 17:31:46 +08:00
alan 81fb68264c Elite 1.4-re CCmode test 2019-09-27 17:01:40 +08:00
alan b05a245cf4 Elite 1.4-re CCmode test 2019-09-27 16:35:22 +08:00
alan f3376a2ab3 Elite 1.4-re CCmode test 2019-09-27 15:25:22 +08:00
alan 48faeeaf1d Elite 1.4-re CCmode test 2019-09-27 15:11:57 +08:00
alan 5560899c94 Elite 1.4-re CCmode test 2019-09-27 14:41:31 +08:00
YiChin 85e7b34da1 CC MDOE 2019-09-27 13:08:57 +08:00
YiChin 013a2b9ede CC MDOE 2019-09-27 12:52:56 +08:00
alan e984572847 Elite 1.4-re CCmode test 2019-09-27 11:09:38 +08:00
alan 591c01bb98 Elite 1.4-re CCmode test 2019-09-27 10:49:14 +08:00
alan 7b053c506e Elite 1.4-re CCmode test 2019-09-27 10:48:22 +08:00
alan e8fcdc18da Merge remote-tracking branch 'remotes/origin/Elite_GPTimer' into Elite_ZTcurve 2019-09-27 10:41:34 +08:00
alan b65ff2383a Elite 1.4-re gptimer test 2019-09-26 18:05:28 +08:00
alan b69e9017bf Elite 1.4-re gptimer test 2019-09-26 17:07:59 +08:00
YiChin 09a40e1912 turn on/off with new clock done 2019-09-26 16:45:46 +08:00
alan 6fa630e6e4 Elite 1.4-re gptimer test 2019-09-26 16:03:48 +08:00
alan 95d3c0bbc4 Elite 1.4-re gptimer test 2019-09-26 15:45:19 +08:00
YiChin 9bf2ab20a8 gptimer_open has no bug 2019-09-26 15:35:22 +08:00
alan 15a10b2405 Elite 1.4-re gptimer test 2019-09-26 15:20:27 +08:00
YiChin a4093cdc70 gptimer_open has a bug 2019-09-26 15:08:53 +08:00
alan 8713d743e1 Elite 1.4-re gptimer test 2019-09-26 15:03:55 +08:00
YiChin 4d3129782e gptimer_open has a bug 2019-09-26 14:46:52 +08:00
alan 53ed3f7d6c Elite 1.4-re gptimer test 2019-09-26 12:17:42 +08:00
alan 91d68e665b Elite 1.4-re gptimer test 2019-09-26 11:32:03 +08:00
alan 0bc606c3a8 Elite 1.4-re gptimer test 2019-09-26 11:12:28 +08:00
alan d19b709324 Elite 1.4-re gptimer test 2019-09-26 11:11:40 +08:00
alan 74742ca45b Elite 1.4-re gptimer test 2019-09-26 11:10:05 +08:00
YiChin 2678b0c02f smallZ-T curve 2019-09-26 11:06:55 +08:00
alan 5576c071c5 Elite 1.4-re gptimer test 2019-09-26 10:52:01 +08:00
alan 27c51a6c54 Elite 1.4-re gptimer test 2019-09-26 10:43:02 +08:00
alan 98c4a62130 Elite 1.4-re genius correction test 2019-09-25 12:18:03 +08:00
alan 7bf8620baf Elite 1.4-re genius correction test 2019-09-25 12:11:33 +08:00
alan 1f742b24df Elite 1.4-re try compile gptimer 2019-09-25 11:59:50 +08:00
Benny Liu 3ac1d77651 Genius calibration data 2019-09-25 11:59:13 +08:00
YiChin ae74c4e5cd fix error 2019-09-25 11:36:48 +08:00
alan 434be00a44 Elite 1.4-re try compile gptimer 2019-09-25 11:26:28 +08:00
Benny Liu 0b365f098d Elite Genius board calibration data 2019-09-25 10:30:39 +08:00
YiChin 54e1aab5fc RT class leader 2019-09-24 18:50:37 +08:00
alan 76c8b49553 Elite 1.4-re RT mode 2019-09-23 18:36:56 +08:00
YiChin 085d51adcf RT class leader 2019-09-23 18:33:46 +08:00
alan 0b75801ed6 Elite 1.4-re RT mode 2019-09-23 18:01:45 +08:00
alan eb712ed4bb Elite 1.4-re RT mode 2019-09-23 17:55:52 +08:00
alan c6f6f4c8f7 Elite 1.4-re RT mode 2019-09-23 17:25:14 +08:00
alan ab8c29021d Elite 1.4-re RT mode 2019-09-23 16:48:50 +08:00
alan 62961eeaa4 Elite 1.4-re RT mode 2019-09-23 16:39:35 +08:00
alan b32c3048d7 Elite 1.4-re RT mode 2019-09-23 16:33:38 +08:00
alan bc18b12227 Elite 1.4-re RT mode 2019-09-23 16:09:48 +08:00
YiChin 28734c52a4 RT class leader 2019-09-23 16:03:03 +08:00
alan cd38d00496 Elite 1.4-re RT mode 2019-09-23 15:51:54 +08:00
alan e613ae4542 Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-09-23 15:28:43 +08:00
YiChin 4439a83382 RT class leader 2019-09-23 15:20:56 +08:00
YiChin 64ef6657be RT class leader 2019-09-23 10:24:00 +08:00
alan 35760ace39 Elite 1.4-re RT mode 2019-09-20 18:29:42 +08:00
alan 72e6e9acae Elite 1.4-re RT mode 2019-09-20 18:25:21 +08:00
alan eecc7236ad Elite 1.4-re RT mode 2019-09-20 15:12:03 +08:00
alan bdb280c029 Elite 1.4-re RT mode 2019-09-20 14:01:30 +08:00
YiChin 77b1259bf3 bug fix 2019-09-20 11:36:06 +08:00
YiChin 6b9ffacb89 bug fix 2019-09-19 18:58:04 +08:00
YiChin 523a98cf8a bug fix 2019-09-19 16:57:34 +08:00
YiChin 98db6a0390 bug fix 2019-09-19 11:05:53 +08:00
YiChin 164d5209eb bug fix 2019-09-19 10:29:52 +08:00
alan 4b8a1960dd Elite 1.4-re RT mode 2019-09-18 17:17:00 +08:00
alan 2e25a129d6 Elite 1.4-re RT mode 2019-09-18 12:24:18 +08:00
YiChin 3fc2ccbc6a ZT should work 2019-09-18 11:37:24 +08:00
YiChin 78853da803 ZT should work 2019-09-17 18:38:10 +08:00
YiChin 4668654d3c ZT should work 2019-09-17 12:07:09 +08:00
YiChin 55503b209b ZT clean buf has a bug 2019-09-17 10:53:24 +08:00
alan 0fdd8bf693 Elite 1.4-re RT mode with 4 level (small resister 2019-09-16 18:45:41 +08:00
YiChin a6459e4302 ZT clean buf has a bug 2019-09-16 18:40:23 +08:00
YiChin b256a61876 CC studio is a FUCKING stupid IDE, F U C K 2019-09-16 18:01:25 +08:00
alan a59c70f75b Elite 1.4-re RT mode with 4 level (small resister 2019-09-16 17:49:29 +08:00
YiChin 59f608a4d0 bug fix 2019-09-16 17:45:58 +08:00
YiChin 70543a2bd5 bug fix 2019-09-16 15:14:07 +08:00
YiChin 7743b6ef62 bug fix 2019-09-16 12:17:43 +08:00
alan a7f3120fb9 Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-09-16 12:09:40 +08:00
alan 16525b0d19 Elite 1.4-re RT mode with 4 level (small resister 2019-09-16 12:09:21 +08:00
YiChin c96b9db716 using long long in correction 2019-09-12 10:20:12 +08:00
YiChin a8bdface95 using long long in correction 2019-09-11 12:13:25 +08:00
YiChin ea8bf21ffd using long long in correction 2019-09-11 11:41:52 +08:00
YiChin 24efe9d896 using long long in correction 2019-09-11 11:41:23 +08:00
alan 3ae0520f39 Elite 1.4-re test ZT_curve branch 2019-09-11 10:06:48 +08:00
alan 035ca66237 Elite 1.4-re debug VT 2019-09-05 17:20:44 +08:00
alan 66fd1a5f2f Elite 1.4-re debug VT 2019-09-05 12:23:11 +08:00
alan ba4a082834 Elite 1.4-re debug VT 2019-09-05 12:16:23 +08:00
alan ac7b4e8ac3 Elite 1.4-re debug VT 2019-09-05 12:07:29 +08:00
alan 7e79b2e12c Elite 1.4-re debug VT 2019-09-05 11:45:20 +08:00
YiChin 0da686a78b add new correction data 2019-09-05 11:20:59 +08:00
alan 474e3cb8d9 Elite 1.4-re IV avg out at steptime-1 2019-09-05 10:35:49 +08:00
alan e649bd9a25 Elite 1.4-re RT comment 2019-09-05 10:26:44 +08:00
alan 1f5bf25d16 Elite 1.4-re Vorigin Vfinal use usercode 2019-09-04 18:52:49 +08:00
alan 14cc86bce1 Elite 1.4-re Vorigin Vfinal use usercode 2019-09-04 18:43:41 +08:00
alan 5f636db5ed Elite 1.4-re fix function pointer error (*self) 2019-09-04 14:58:41 +08:00
alan 72c84deb85 Elite 1.4-re fix function pointer error (*self) 2019-09-04 14:51:16 +08:00
alan a0cc1cf228 Elite 1.4-re fix function pointer error (*self) 2019-09-04 14:35:01 +08:00
alan 41b35655a6 Elite 1.4-re fix function pointer error 2019-09-04 14:25:10 +08:00
YiChin 68169aed0d fix error 2019-09-04 14:09:21 +08:00
alan 645b971b6b Elite 1.4-re fix function pointer error 2019-09-04 13:55:32 +08:00
YiChin f669739b4e fix error 2019-09-04 13:01:34 +08:00
alan 9f5912c649 Elite 1.4-re IUC compare with real I 2019-09-04 12:55:19 +08:00
alan 8dac9ea12c Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-09-04 12:48:21 +08:00
alan 9f2e6547d2 Elite 1.4-re IUC compare with real I 2019-09-04 12:47:56 +08:00
YiChin 164be3061d Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-09-04 12:44:52 +08:00
YiChin f4acbf75d8 fix error 2019-09-04 12:44:22 +08:00
alan a3f710f398 Elite 1.4-re IUC compare with real I 2019-09-04 12:25:37 +08:00
alan fdd9ee173c Elite 1.4-re IUC compare with real I 2019-09-04 12:07:41 +08:00
alan 5c581869da Elite 1.4-re IUC compare with real I 2019-09-04 12:07:06 +08:00
alan f1bb7e6217 Elite 1.4-re add function pointer 2019-09-04 11:16:02 +08:00
alan bc553c66af Elite 1.4-re step time macro 2019-09-03 18:21:18 +08:00
alan 2bb80a06ed Elite 1.4-re merge with IVtest branch 2019-09-03 18:19:59 +08:00
alan d44dd996a7 Elite 1.4-re merge with IVtest branch 2019-09-03 18:16:32 +08:00
alan 36de918cfc Elite 1.4-re IUC to real nA/pA 2019-09-03 18:14:25 +08:00
alan 4b45002129 Elite 1.4-re fix error 2019-09-03 17:11:16 +08:00
alan 2d23da34c2 Elite 1.4-re split every function into .h file 2019-09-03 17:03:23 +08:00
alan ff58ec8a1e Elite 1.4-re split every function into .h file 2019-09-03 17:01:46 +08:00
alan 6ae419b537 Elite 1.4-re add CCmode 2019-09-03 16:22:08 +08:00
alan 96350c19c2 Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-09-03 12:39:07 +08:00
alan ab52989e0e Elite 1.4-re add CCmode 2019-09-03 12:38:49 +08:00
alan 035f01fb0a Elite 1.4-re add CCmode 2019-09-03 11:41:30 +08:00
alan e235fd3adf Elite 1.4-re add CCmode 2019-09-03 11:23:21 +08:00
105042004 272d0e423d fix Impedance_Calculate() 2019-09-03 11:11:37 +08:00
alan e227b395f9 Elite 1.4-re add CCmode 2019-09-02 18:50:59 +08:00
YiChin 91d8d1a4d0 add ZTcurve impedance calculation function 2019-08-30 18:16:14 +08:00
alan c5543e777a Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-08-30 15:05:37 +08:00
alan ddfcd11fb4 Elite 1.4-re ZT_plot not finish yet 2019-08-30 15:05:19 +08:00
YiChin 03ef7ef734 fix error 2019-08-30 12:34:17 +08:00
alan 4d84788f51 Elite 1.4-re fix error 2019-08-30 12:15:15 +08:00
YiChin 6d48245d82 fix error 2019-08-30 12:08:31 +08:00
YiChin a2070d1073 Merge remote-tracking branch 'origin/Elite_ZTcurve' into Elite_ZTcurve 2019-08-30 11:52:39 +08:00
YiChin 40bb5b8e0a fix error 2019-08-30 11:49:45 +08:00
alan ac3bee4609 Elite 1.4-re fix error 2019-08-30 11:40:29 +08:00
alan 4166c2721c Elite 1.4-re add (instruction, LED, reset...).h file 2019-08-30 11:26:47 +08:00
alan 8455fe9422 Elite 1.4-re stepcode to DAC code 2019-08-29 17:11:55 +08:00
alan ed3a24a9c9 Elite 1.4-re stepcode to DAC code 2019-08-29 17:04:31 +08:00
alan d93464e970 Elite 1.4-re step reset value = 1mV 2019-08-29 16:57:22 +08:00
105042004 0909855fbb fix 10e3 2019-08-29 16:52:16 +08:00
alan dc32d4fb13 Elite 1.4-re delete 1.3 DACout function 2019-08-29 16:15:36 +08:00
alan 36e0be6f9b Elite 1.4-re FXN_GEN type VS bitwise priority? 2019-08-29 16:09:39 +08:00
105042004 ea5355f413 fix CHAO I correction 2019-08-29 15:09:21 +08:00
105042004 27960395de Merge branch 'Elite_IVtest' of https://gitlab.com/bioproscientific/bioprocc2650 into Elite_IVtest 2019-08-29 14:33:26 +08:00
105042004 cdbcb85640 add CHAO I DAC correction code 2019-08-29 14:32:54 +08:00
alan db2d8e4217 Elite 1.4-re clean warning 2019-08-29 12:38:33 +08:00
alan 1b9aedf7a0 Elite 1.4-re clean warning 2019-08-29 12:24:40 +08:00
alan 1cba7efeeb Elite 1.4-re interrupt function 2019-08-29 12:20:21 +08:00
alan ec7e721fcc Elite 1.4-re reformat 2019-08-29 12:16:28 +08:00
YiChin dcfb390243 fix format bug 2019-08-29 12:03:00 +08:00
alan 2cd7161694 Elite 1.4-re have a format bug 2019-08-29 11:58:14 +08:00
105042004 a84ec8c438 fix IV curve 2019-08-29 11:43:46 +08:00
105042004 33805dd480 fix IV curve 2019-08-29 11:41:53 +08:00
alan a033919d47 Elite 1.4-re IV mode with LED hint 2019-08-29 11:30:09 +08:00
alan 72674329bc Elite 1.4-re DAC control and IV mode notify 2019-08-29 11:07:56 +08:00
alan 6d690d80da Merge remote-tracking branch 'origin/Elite_IVtest' into Elite_IVtest
# Conflicts:
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h
2019-08-29 11:07:49 +08:00
alan e607ae50e1 Elite 1.4-re DAC control and IV mode notify 2019-08-29 11:05:12 +08:00
105042004 750c13ee00 test IV current 2019-08-29 10:54:37 +08:00
105042004 b66a5c1cc5 test IV current 2019-08-29 10:45:46 +08:00
105042004 732ef11d7f test IV current 2019-08-29 10:38:10 +08:00
105042004 1187ead2cf test IV current 2019-08-29 10:31:28 +08:00
105042004 c6ddc19fdc fix average 2019-08-28 18:53:30 +08:00
105042004 e864d8fc10 fix average 2019-08-28 18:52:23 +08:00
YiChin 3a0d730c11 push 2019-08-28 16:36:29 +08:00
alan 773b9f5e48 Elite 1.4-re move include "XXX.h" 2019-08-28 16:26:38 +08:00
alan 3218b3a531 Elite 1.4-re move include "XXX.h" 2019-08-28 16:19:24 +08:00
alan 658ed58412 Elite 1.4-re IV-current avg has a bug; move include "XXX.h" 2019-08-28 16:13:19 +08:00
105042004 9d288dee41 fix IV notify 2019-08-28 14:40:56 +08:00
105042004 e975789be4 fix IV notify 2019-08-28 14:40:44 +08:00
105042004 bf2ef89a7f fix correction data init 2019-08-28 14:10:29 +08:00
105042004 f81aa9a47b fix correction_data 2019-08-28 13:02:03 +08:00
alan 2a82ac65e2 Elite 1.4-re correction struct 2019-08-28 12:45:24 +08:00
105042004 6a506898a8 fix correction_data init 2019-08-28 12:26:45 +08:00
105042004 8606e0ca9d fix Correction data 2019-08-28 12:10:46 +08:00
105042004 5951d1c9e2 switch to chao i 2019-08-28 11:54:01 +08:00
105042004 e741d1b252 Merge branch 'Elite_IVtest' of https://gitlab.com/bioproscientific/bioprocc2650 into Elite_IVtest 2019-08-28 11:53:19 +08:00
105042004 f85d687a77 add DAC correction data 2019-08-28 11:52:54 +08:00
alan 142b006c63 Elite 1.4-re use old format notify 2019-08-28 11:42:15 +08:00
alan 5e59e60b4e Merge remote-tracking branch 'origin/Elite_IVtest' into Elite_IVtest 2019-08-28 11:36:29 +08:00
105042004 f678680f1d push 2019-08-28 11:36:09 +08:00
105042004 0de37ed924 merge 2019-08-28 11:30:53 +08:00
105042004 5f2b3c55bb arrange correction data 2019-08-28 11:22:42 +08:00
alan 4a37fa8668 Elite 1.4-re write notify comment 2019-08-28 10:49:49 +08:00
alan f7f5e550c9 Elite 1.4-re notify include mode & gain infomation 2019-08-28 10:48:50 +08:00
alan 24db728a6c Elite 1.4-re move DAC correction to correction.h 2019-08-28 10:37:36 +08:00
alan 1f2ddc7829 Elite 1.4-re ADC gain macro 2019-08-28 10:36:35 +08:00
alan 77d22be8fa Elite 1.4-re notify format 2019-08-28 10:32:08 +08:00
alan 691bd9a10f Merge remote-tracking branch 'origin/Elite_IVtest' into Elite_IVtest 2019-08-28 10:09:59 +08:00
alan f5165cc78b Elite 1.4-re Correction array 2019-08-28 10:09:47 +08:00
105042004 6cb687d8b6 IV curve count current average 2019-08-28 02:34:13 +08:00
alan 80dd042021 Merge remote-tracking branch 'origin/Elite_IVtest' into Elite_IVtest 2019-08-27 17:59:24 +08:00
alan 3b43cd1e74 Elite 1.4-re Correction array 2019-08-27 17:59:07 +08:00
105042004 289b0ad94c change to chao i 2019-08-27 17:12:58 +08:00
105042004 e1469d96d8 delete current 2019-08-27 17:01:37 +08:00
105042004 93f106dc30 push chao i 2019-08-27 16:36:03 +08:00
105042004 73913197df push 2019-08-27 16:33:51 +08:00
105042004 4ec017a68f add tri correction 2019-08-27 16:33:42 +08:00
105042004 284891f73a Merge branch 'Elite_IVtest' of https://gitlab.com/bioproscientific/bioprocc2650 into Elite_IVtest 2019-08-27 14:08:27 +08:00
105042004 5a1b69d29b 29 21 ADC volt correction 2019-08-27 14:06:47 +08:00
Benny Liu 0699a7edf7 fix 2019-08-26 15:02:18 +08:00
Benny Liu 14c21694ec fix 2019-08-26 12:22:26 +08:00
Benny Liu 5f95225d00 auto shifting tesst 2019-08-26 12:08:37 +08:00
Benny Liu c1b25aa3ef update calibration data 2019-08-26 10:37:40 +08:00
105042004 237f6a820c move DAC reset parameter 2019-08-23 16:21:32 +08:00
105042004 7ba3aa560b move IV current average 2019-08-23 16:03:52 +08:00
105042004 405b599562 push 2019-08-23 15:01:32 +08:00
105042004 1dae858671 fix 2019-08-23 14:54:05 +08:00
105042004 aee139e154 push 2019-08-23 14:23:56 +08:00
105042004 b80f977e16 fix ADC current samplerate 2019-08-23 14:13:12 +08:00
105042004 e6e8b255ba Merge branch 'Elite_IVtest' of https://gitlab.com/s880782002/bioprocc2650 into Elite_IVtest 2019-08-23 11:17:40 +08:00
105042004 0aca212f53 commit 2019-08-23 11:17:28 +08:00
alan 7f64e9b9c7 Elite 1.4-re clock with event mask 2019-08-23 11:16:51 +08:00
alan 8953c51f9a Elite 1.4-re AVG notify current & V 2019-08-23 10:48:38 +08:00
105042004 72d97ad288 Elite change IV curve samplerate to average 2019-08-23 10:26:50 +08:00
105042004 43cb1a278b change iv curve sample rate 2019-08-22 18:09:59 +08:00
105042004 ccc1becc87 push 2019-08-22 11:34:46 +08:00
105042004 8b55122225 fix IV curve/instruction 2019-08-22 11:18:29 +08:00
alan 776fe53178 Elite 1.4-re periodic event flag 2019-08-21 10:24:19 +08:00
alan 003b115067 Elite 1.4-re ADC w/r delay time 2019-08-21 09:57:56 +08:00
alan bcf682e116 Elite 1.4-re clock callback 2019-08-21 09:50:34 +08:00
alan ad4fab1aa6 Elite 1.4-re clock callback 2019-08-21 00:18:25 +08:00
alan 80d89e7b87 Elite 1.4-re IT fix display output V 2019-08-20 23:55:19 +08:00
alan 46bbbc8ac7 Elite 1.4-re IT fix display output V 2019-08-20 23:22:04 +08:00
alan cd43385573 Elite 1.4-re IT fix display output V 2019-08-20 23:14:15 +08:00
YiChin 63b4c19d67 ADC Gain level instructino 2019-08-20 22:50:53 +08:00
YiChin 837055cc29 ADC Gain level instructino 2019-08-20 22:05:04 +08:00
alan 053718f7f2 Elite 1.4-re IT over/under flow check 2019-08-20 21:49:34 +08:00
Benny Liu 9d18f7c67f manual shift 2019-08-20 21:34:48 +08:00
YiChin f32ac10e94 ADC Gain level instructino 2019-08-20 21:22:09 +08:00
alan aaa3f62f62 Elite 1.4-re try to fix IV plot 2019-08-20 21:01:07 +08:00
alan c68f34a48a Elite 1.4-re try to fix IV plot 2019-08-20 20:37:14 +08:00
alan c39075eff8 Elite 1.4-re try to fix IV plot 2019-08-20 20:03:18 +08:00
YiChin 53c28fed5d Elite 1.4-re try to DAC 2019-08-20 19:24:08 +08:00
YiChin 112e177928 Elite 1.4-re try to DAC 2019-08-20 19:14:15 +08:00
105042004 449201e3ea change steptime 2019-08-20 18:48:05 +08:00
105042004 c7c9e75c17 test steptime 2019-08-20 18:40:00 +08:00
105042004 2bdbe91c7e test steptime 2019-08-20 18:27:55 +08:00
YiChin 58c3f8fd22 Elite 1.4-re try to DAC 2019-08-20 17:11:03 +08:00
YiChin ad7063eea2 Elite 1.4-re try to DAC 2019-08-20 16:35:10 +08:00
YiChin 34b3524533 Elite 1.4-re try to DAC 2019-08-20 16:33:53 +08:00
YiChin f63d991df4 Elite 1.4-re try to fix IV zero Notify problem 2019-08-20 15:24:30 +08:00
YiChin 10a640bac6 Merge remote-tracking branch 'origin/Elite_14re_demo' into Elite_14re_demo 2019-08-20 15:15:14 +08:00
YiChin e4bd49e6ae Elite 1.4-re try to fix IV zero Notify problem 2019-08-20 15:13:58 +08:00
Benny Liu c14d4a9f6b don't care 2019-08-20 15:13:29 +08:00
YiChin 596897ccd7 Merge remote-tracking branch 'origin/Elite_14re_demo' into Elite_14re_demo
# Conflicts:
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h
2019-08-20 14:39:58 +08:00
YiChin b304f03a7a Elite 1.4-re try to fix IV zero Notify problem 2019-08-20 14:39:13 +08:00
105042004 2c9f467939 push 2019-08-20 14:37:37 +08:00
105042004 31f6c9d43c fix DAC correction 2019-08-20 14:36:50 +08:00
Benny Liu 91e5f2f43f error fix 2019-08-20 14:35:37 +08:00
Benny Liu f4f5c18a95 Merge branch 'Elite_14re_demo' of https://gitlab.com/s880782002/bioprocc2650 into Elite_14re_demo 2019-08-20 14:33:00 +08:00
alan 08b1bd4ce6 Merge remote-tracking branch 'origin/Elite_14re_demo' into Elite_14re_demo
# Conflicts:
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteDAC.h
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h
2019-08-20 14:32:28 +08:00
Benny Liu 61934cee51 Merge branch 'Elite_14re_demo' of https://gitlab.com/s880782002/bioprocc2650 into Elite_14re_demo 2019-08-20 14:32:18 +08:00
Benny Liu ae560e8923 Gain Boundary for CHAO-I 2019-08-20 14:31:29 +08:00
alan d0f1cb5db0 Elite 1.4-re try to fix IV plot 2019-08-20 14:31:02 +08:00
YiChin 18b1279fe6 Merge remote-tracking branch 'origin/Elite_14re_demo' into Elite_14re_demo 2019-08-20 14:06:38 +08:00
YiChin dd541ef1d0 Elite 1.4-re try to fix IV zero Notify problem 2019-08-20 14:05:55 +08:00
Benny Liu d3c3135775 add calibration data for CHAO-I. 2019-08-20 14:04:07 +08:00
alan 317305dbcd Elite 1.4-re try to fix IV plot 2019-08-20 13:48:18 +08:00
105042004 d889aee9df gix bug 2019-08-20 13:32:38 +08:00
105042004 0d2ef231d7 fix CV curve function 2019-08-20 11:16:37 +08:00
105042004 52036a6c4b merge 2019-08-20 11:04:33 +08:00
105042004 fc44b2be44 add Notify_IV( ) 2019-08-20 11:03:27 +08:00
alan 48fcbe8de8 Elite 1.4-re move ADC overflow to correction.h 2019-08-20 10:48:55 +08:00
alan 8a2bb2a8a4 Elite 1.4-re fix reset (but failed) 2019-08-20 10:32:44 +08:00
YiChin 37480a0c6e Elite 1.4-re add correction comment of #0 board 2019-08-20 10:26:45 +08:00
YiChin 332b49de31 Elite 1.4-re LED 2019-08-19 19:14:16 +08:00
YiChin 3fa9abecd9 Merge remote-tracking branch 'origin/Elite_14re_demo' into Elite_14re_demo
# Conflicts:
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage.h
2019-08-19 18:03:56 +08:00
YiChin 25c964ee37 Elite 1.4-re LED 2019-08-19 18:02:39 +08:00
105042004 5b471539e9 push 2019-08-19 18:01:43 +08:00
105042004 1739a4ebd2 Merge branch 'Elite_14re_demo' of https://gitlab.com/s880782002/bioprocc2650 into Elite_14re_demo 2019-08-19 17:43:49 +08:00
105042004 dfde53e893 adjust clock 2019-08-19 17:43:35 +08:00
YiChin a9066d91fc Elite 1.4-re LED 2019-08-19 17:43:16 +08:00
105042004 e3aff9e394 Merge branch 'Elite_14re_demo' of https://gitlab.com/s880782002/bioprocc2650 into Elite_14re_demo 2019-08-19 16:37:44 +08:00
105042004 68ea183e52 test samperate 2019-08-19 16:37:20 +08:00
alan 78bafd54f3 Elite 1.4-re ADC auto switch 2019-08-19 16:07:20 +08:00
YiChin 429ccd3254 Elite 1.4-re LED 2019-08-19 15:53:10 +08:00
YiChin 4d181df5b8 Merge remote-tracking branch 'origin/Elite_14re_demo' into Elite_14re_demo 2019-08-19 15:32:53 +08:00
YiChin e8d8b7730e Elite 1.4-re LED 2019-08-19 15:32:40 +08:00
105042004 04e649ce0b merge 2019-08-19 15:31:02 +08:00
105042004 b54d1c3b2b Elite 1.4 adjust steptime 2019-08-19 15:28:41 +08:00
105042004 ec58058e00 Elite 1.4 adjust sampling rate 2019-08-19 15:24:58 +08:00
alan a8bc5a22d5 Elite 1.4-re push 2019-08-19 15:00:24 +08:00
alan ddf5a59ee9 Elite 1.4-re push 2019-08-19 14:59:56 +08:00
alan 19ed1b1444 Merge remote-tracking branch 'origin/Elite_14re_demo' into Elite_14re_demo 2019-08-19 14:56:44 +08:00
alan 0c08992214 Elite 1.4-re push 2019-08-19 14:56:27 +08:00
105042004 c48f570877 Elite 1.4 adjust samplerate_counter 2019-08-19 14:56:14 +08:00
105042004 95dc465f45 fix samplerate 2019-08-19 14:44:30 +08:00
105042004 65b49cdd11 fix EliteADCControl 2019-08-19 14:40:47 +08:00
105042004 a18cabfa33 fix EliteADCControl 2019-08-19 14:40:17 +08:00
105042004 9d86f9f1f9 fix 2019-08-19 14:34:15 +08:00
105042004 adca6987b4 Elite 1.4 move IT_plot() 2019-08-19 14:25:40 +08:00
105042004 cf5d09d0d1 fix bug 2019-08-19 14:07:55 +08:00
105042004 b4075c14fd Elite 1.4 fix sample rate 2019-08-19 14:00:31 +08:00
105042004 06717ad552 merge 2019-08-19 12:51:32 +08:00
105042004 e4b4b3e0e5 Elite1.4 Seperate DAC and ADC / add Sampling rate 2019-08-19 12:48:22 +08:00
alan e51a0adf12 Elite 1.4-re error fix 2019-08-19 12:29:00 +08:00
YiChin 3bdba2ad71 Elite 1.4-re error fix 2019-08-19 11:48:09 +08:00
alan 89e7935cd6 Elite 1.4-re error fix 2019-08-19 11:30:34 +08:00
YiChin 935e3fea4d Elite 1.4-re error fix 2019-08-19 11:24:09 +08:00
YiChin e1f4c20fd7 Elite 1.4-re error fix 2019-08-19 11:11:18 +08:00
alan 226c822fcf Elite 1.4-re clock 0.05s ->0.01s | samplerate 2019-08-19 11:09:42 +08:00
alan 7905d25c2f Merge remote-tracking branch 'origin/Elite_14re_demo' into Elite_14re_demo
# Conflicts:
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteADC.h
2019-08-19 10:57:23 +08:00
alan 941d508859 Elite 1.4-re clock 0.05s ->0.01s | samplerate 2019-08-19 10:56:23 +08:00
alan 2230a78ad1 Elite 1.4-re clock 0.05s ->0.01s | samplerate 2019-08-19 10:50:40 +08:00
Benny Liu 95ec664c9c Merge branch 'Elite_14re_demo' of https://gitlab.com/s880782002/bioprocc2650 into Elite_14re_demo 2019-08-19 10:46:55 +08:00
Benny Liu ef894ae441 calibration coefficient value 2019-08-19 10:46:34 +08:00
YiChin f887abbf66 Elite 1.4-re new world 2019-08-19 10:30:03 +08:00
alan d51b9839c2 Elite 1.4-re clock 0.05s ->0.01s 2019-08-16 19:09:11 +08:00
alan fb08b5638d Elite 1.4-re clock 0.05s ->0.01s 2019-08-16 19:03:54 +08:00
alan c09ec1b3e1 Elite 1.4-re clock 0.05s ->0.01s 2019-08-16 18:47:50 +08:00
alan b77104baa8 Elite 1.4-re clock 0.05s ->0.01s 2019-08-16 18:34:37 +08:00
alan 60beceb0a4 Elite 1.4-re clock 0.05s ->0.01s 2019-08-16 18:12:43 +08:00
alan 36810bbf53 Merge remote-tracking branch 'origin/Elite_14re_demo' into Elite_14re_demo 2019-08-16 18:07:14 +08:00
alan 5f62559811 Elite 1.4-re clock 0.05s ->0.01s 2019-08-16 18:07:01 +08:00
Benny Liu bb521437db auto shift bug fix 2019-08-16 17:56:14 +08:00
Benny Liu c31bbef8f5 auto shift 2019-08-16 17:47:16 +08:00
Benny Liu ca5203848d DAC output voltage correction 2019-08-16 17:01:59 +08:00
Benny Liu b6f8ddd041 auto shift 2019-08-16 16:47:09 +08:00
alan 1e834cfb45 Elite 1.4-re ADC current correction 2019-08-16 16:40:09 +08:00
alan e93ac78ccd Elite 1.4-re ADC current correction 2019-08-16 14:23:02 +08:00
YiChin 8a375019f1 Elite 1.4-re error fix 2019-08-16 14:20:50 +08:00
YiChin 3cda19e2d2 Elite 1.4-re error fix 2019-08-16 13:40:24 +08:00
YiChin 95169d0885 Merge remote-tracking branch 'origin/elite_tempbranch' into elite_tempbranch 2019-08-16 12:28:45 +08:00
YiChin 96c3b0725b Elite 1.4-re error fix 2019-08-16 12:28:19 +08:00
alan b29eef912d Elite 1.4-re ADC current correction 2019-08-16 12:26:53 +08:00
YiChin 7790621b3c Elite 1.4-re error fix 2019-08-16 11:51:59 +08:00
YiChin adf96c3055 Elite 1.4-re error fix 2019-08-16 11:18:25 +08:00
YiChin a99ced845c Elite 1.4-re error fix 2019-08-16 11:01:02 +08:00
YiChin be6681a0fd Merge remote-tracking branch 'origin/elite_tempbranch' into elite_tempbranch 2019-08-16 10:17:01 +08:00
alan fbcb1f8ddd Elite 1.4-re ADC volt correction 2019-08-16 10:16:13 +08:00
YiChin 61cb5a9eed Elite 1.4-re error fix 2019-08-15 18:46:23 +08:00
alan 64d32a6386 Merge remote-tracking branch 'origin/elite_tempbranch' into elite_tempbranch 2019-08-15 18:44:33 +08:00
alan 50e47e75a1 Elite 1.4-re ADC volt correction 2019-08-15 18:44:21 +08:00
YiChin 21b7e081e7 Elite 1.4-re error fix 2019-08-15 18:38:34 +08:00
alan e53403d11b Elite 1.4-re ADC volt correction 2019-08-15 18:31:38 +08:00
alan 6ef19dfbdc Elite 1.4-re ADC volt correction 2019-08-15 17:52:32 +08:00
alan 1c601e57a4 Elite 1.4-re new notify.h 2019-08-15 17:42:13 +08:00
YiChin 346ff4db00 Elite 1.4-re error fix 2019-08-15 17:24:34 +08:00
alan 6900a6f3be Elite 1.4-re new notify.h 2019-08-15 17:00:57 +08:00
YiChin 08c3c19219 Elite 1.4-re error fix 2019-08-15 16:55:29 +08:00
alan 828d5301e7 Elite 1.4-re VT function test 2019-08-15 16:39:09 +08:00
alan 4ffbcba8cf Elite 1.4-re VT function test 2019-08-15 16:32:39 +08:00
alan 0290a178ee Elite 1.4-re ADC correction using CIS 2019-08-15 15:53:40 +08:00
YiChin 4723ec9d5b fix instruction length 2019-08-15 12:05:23 +08:00
YiChin 4b908677a9 compile pass 2019-08-15 11:37:28 +08:00
105042004 24b7699520 test width period 2019-08-15 11:24:00 +08:00
105042004 6a2bba3119 test period width 2019-08-15 11:23:36 +08:00
alan 4a2af94b31 Elite 1.4-re DAC correction 2019-08-14 19:22:48 +08:00
alan 77719e3713 Elite 1.4-re DAC correction 2019-08-14 19:15:44 +08:00
alan 94776b0171 Merge remote-tracking branch 'origin/elite_tempbranch' into elite_tempbranch
# Conflicts:
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage.h
2019-08-14 19:13:26 +08:00
alan 5c4c08fc97 Elite 1.4-re ADC test 2019-08-14 19:11:57 +08:00
YiChin 1d58fe359b Elite 1.4-re LED modify 2019-08-14 18:10:53 +08:00
105042004 a50849882e test pulse period pulse width 2019-08-14 11:56:41 +08:00
105042004 89a474f509 test pulse width 2019-08-14 11:06:51 +08:00
105042004 4cc1d01c6a update DPV curve fix CV curve overflow 2019-08-14 10:29:24 +08:00
105042004 703d6bcb69 test DPV 2019-08-14 09:58:20 +08:00
105042004 a0cf6389aa test DPV 2019-08-13 18:28:21 +08:00
105042004 7cf77afab3 fix bug 2019-08-13 18:16:01 +08:00
105042004 ec36764750 test DPV 2019-08-13 18:05:20 +08:00
105042004 e1186901e9 test DPV curve 2019-08-13 17:54:39 +08:00
105042004 82d1b90542 test DPV amplitude 2019-08-13 17:47:23 +08:00
105042004 1c2b3ac07c test DPV step 2019-08-13 17:42:11 +08:00
105042004 5d545d6acf test DPV 2019-08-13 17:37:09 +08:00
105042004 abacf8b977 test DPV curve 2019-08-13 17:23:26 +08:00
105042004 e7fb10be20 kill 10V 2019-08-13 17:12:46 +08:00
105042004 9eac85a5d3 test DPV 2019-08-13 16:29:25 +08:00
105042004 c2a4d4ddac test DPV 2019-08-13 15:31:38 +08:00
105042004 c64b19bbb4 test DPV 2019-08-13 15:09:42 +08:00
105042004 f8569c15bc test Amplitude 2019-08-13 14:52:50 +08:00
105042004 1b0d50eeaf test DPV 2019-08-13 14:43:12 +08:00
105042004 e681c0a2b0 test 2019-08-13 14:35:42 +08:00
105042004 6dcb7173d5 test 2019-08-13 14:35:29 +08:00
105042004 ee8165d4b9 test 2019-08-13 14:28:27 +08:00
105042004 0539ffbd23 test 2019-08-13 14:17:11 +08:00
105042004 4bc2364e07 test 2019-08-13 14:04:10 +08:00
105042004 fbff4b2985 test amplitude 2019-08-13 12:58:53 +08:00
105042004 6031a35461 update step amplitide width 2019-08-13 12:24:51 +08:00
105042004 b55b521d06 test 2019-08-13 11:58:02 +08:00
105042004 8303c80326 test DPV 2019-08-13 11:50:53 +08:00
105042004 1a196b20da test DPV 2019-08-13 11:50:29 +08:00
105042004 aa2e813fb1 update CV curve DPV curve SWV curve 2019-08-13 11:07:13 +08:00
105042004 92ef9e44d6 fix 2019-08-08 18:07:41 +08:00
105042004 d840e63ac1 test DPV curve 2019-08-08 17:58:48 +08:00
105042004 345bbf7f21 fix 2019-08-08 17:17:23 +08:00
105042004 e728e0b520 fix bug 2019-08-08 16:50:13 +08:00
105042004 be70e455d7 update CV curve DPV curve 2019-08-08 16:23:17 +08:00
105042004 7a92fe8f86 debug CV curve 2019-08-08 14:47:39 +08:00
105042004 bbcda86272 test CV curve 2019-08-08 14:38:17 +08:00
105042004 148b3a4bd3 change step 2019-08-08 14:28:23 +08:00
105042004 dc0267427f test 2019-08-08 13:59:00 +08:00
105042004 fa71a8535d test 2019-08-08 13:50:39 +08:00
105042004 15d7e94082 test 2019-08-08 13:36:18 +08:00
105042004 d571d1ea98 test 2019-08-08 12:58:04 +08:00
105042004 ca2cef61a4 test 2019-08-08 12:45:25 +08:00
105042004 5957b60680 fix CV curve 2019-08-08 12:31:04 +08:00
105042004 37e9931c5a test IV cuve 2019-08-08 11:58:22 +08:00
105042004 837e9f4029 fix CV curve 2019-08-08 11:41:14 +08:00
105042004 020746027d test step 2019-08-08 11:05:23 +08:00
105042004 f170f9ab0d fix 2019-08-08 10:52:15 +08:00
105042004 44bab26192 fix bug 2019-08-08 10:34:48 +08:00
105042004 042b15f787 fix bug 2019-08-08 10:11:54 +08:00
105042004 4d95438e20 update CVcurve DPVcurve SWVcurve 2019-08-07 22:32:58 +08:00
105042004 94fd12b436 push 2019-08-07 12:29:42 +08:00
105042004 d9d12321b7 push 2019-08-07 12:23:20 +08:00
105042004 73ab6505ca test CV curve 2 2019-08-07 12:19:59 +08:00
105042004 7f1cd7437c test CV curve 2019-08-07 12:17:33 +08:00
Benny Liu 0e40bc0deb Merge branch 'elite_tempbranch' of https://gitlab.com/s880782002/bioprocc2650 into elite_tempbranch 2019-08-07 11:17:31 +08:00
Benny Liu 51a46e0f4d shift gear 2019-08-07 11:15:01 +08:00
105042004 9ffe4e2965 test CV curve 2019-08-07 11:07:15 +08:00
105042004 d4551a83e6 test CV curve 2019-08-07 10:56:24 +08:00
105042004 fbd4699246 test12 2019-08-06 18:13:47 +08:00
105042004 bfc8242ee6 test11 2019-08-06 17:56:52 +08:00
105042004 68598cc9d0 test10 2019-08-06 17:41:58 +08:00
105042004 c87ff74add test9 2019-08-06 17:15:18 +08:00
105042004 fcb9ca34a1 test8 2019-08-06 16:36:28 +08:00
105042004 43e19870b2 test7 2019-08-06 16:07:30 +08:00
105042004 365b272e91 test6 2019-08-06 15:28:57 +08:00
105042004 56ad82e481 test6 2019-08-06 15:18:02 +08:00
105042004 110940e898 test5 2019-08-06 15:12:02 +08:00
105042004 f58557d785 test4 2019-08-06 13:56:13 +08:00
105042004 5a0d3e5026 test 3 2019-08-06 13:44:14 +08:00
105042004 357e30d8af test CV curve 2019-08-06 13:26:20 +08:00
105042004 c3b633a207 test CV curve 2019-08-06 13:20:51 +08:00
105042004 daef46eecc update CV curve 2019-08-06 12:47:45 +08:00
105042004 140add3754 change reset 2019-08-06 12:20:31 +08:00
105042004 540a6a3d2a update CVcurve 2019-08-06 11:47:10 +08:00
105042004 a7e337cf96 add DPV & fix bug 2019-08-01 11:52:03 +08:00
105042004 a6cf807b08 fix errors 2019-08-01 11:19:43 +08:00
105042004 b87b5c4f2f add DPV 2019-08-01 10:40:37 +08:00
105042004 cb1497d434 add CVcurve 2019-07-30 16:50:01 +08:00
105042004 01d104c81c Merge remote-tracking branch 'origin/elite_memory' into elite_tempbranch 2019-07-30 10:44:54 +08:00
alan d716f396b4 Elite 1.4 DAC output fxn 2019-07-30 10:08:29 +08:00
YiChin c683e0261c Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-26 15:28:49 +08:00
YiChin 4d1ed89e40 Elite 1.4 ADC test 2019-07-26 15:26:39 +08:00
alan 7769de7174 Elite 1.4 ADC test 2019-07-26 11:58:39 +08:00
alan 99a2fb27df Elite 1.4 ADC test 2019-07-26 11:26:45 +08:00
alan 45f96605d9 Elite 1.4 ADC test 2019-07-26 10:35:35 +08:00
alan fb7b75b02d Elite 1.4 ADC test 2019-07-26 09:51:52 +08:00
YiChin 101c03b19e Elite 1.4 ADC test 2019-07-26 09:11:43 +08:00
alan 17fa54c979 Elite 1.4 I2C test 2019-07-26 09:03:43 +08:00
alan 35f610001f Elite 1.4 I2C test 2019-07-25 18:33:13 +08:00
alan 1f57e7d2de Elite 1.4 I2C test 2019-07-25 17:57:15 +08:00
alan 3fad139bc5 Elite 1.4 I2C test 2019-07-25 17:30:26 +08:00
alan ba3888f523 Elite 1.4 I2C test 2019-07-25 15:42:17 +08:00
alan 9751ef2529 Elite 1.4 ADC test 2019-07-25 14:59:09 +08:00
alan b69b46a78c Elite 1.4 ADC test 2019-07-25 14:50:17 +08:00
YiChin 88979fe511 Elite 1.4 ADC test 2019-07-25 14:26:51 +08:00
105042004 7d2fc57b77 add comment 2019-07-25 12:13:05 +08:00
105042004 71c30babea add comment 2019-07-25 12:11:16 +08:00
alan c4996a3e2d Elite 1.4 ADC test 2019-07-25 09:47:14 +08:00
YiChin 7a71bbb995 Elite 1.4 DAC test 2019-07-24 18:32:27 +08:00
YiChin 45b00acc8b Elite 1.4 DAC test 2019-07-24 18:08:49 +08:00
YiChin 0728f77d31 Elite 1.4 DAC test 2019-07-24 17:28:53 +08:00
YiChin 3c2bec7d02 Elite 1.4 DAC test 2019-07-24 17:21:10 +08:00
alan bf1669c0f0 Elite 1.4 DAC test 2019-07-24 16:34:27 +08:00
YiChin b1e17a1115 Elite 1.4 DAC test 2019-07-24 16:26:25 +08:00
alan 3814e51585 Elite 1.4 DAC test 2019-07-24 16:10:15 +08:00
YiChin f7f5c3abc6 Elite 1.4 DAC test 2019-07-24 14:57:40 +08:00
YiChin 9cac8694c0 Elite 1.4 I2C test 2019-07-24 14:11:21 +08:00
YiChin e63af33723 Elite 1.4 I2C test 2019-07-24 11:53:26 +08:00
YiChin fcbda78a46 Elite 1.4 I2C test 2019-07-24 11:49:20 +08:00
YiChin e7cdc676cf Elite 1.4 I2C test 2019-07-24 11:39:55 +08:00
YiChin c2bd1e9780 Elite 1.4 test 2019-07-24 10:35:58 +08:00
YiChin 2fab159ba8 Elite 1.4 test 2019-07-24 09:56:48 +08:00
YiChin 1e41629f49 I2C PIN 2019-07-23 17:34:50 +08:00
YiChin 18c32c7e64 I2C PIN 2019-07-23 14:27:39 +08:00
YiChin e8aac9bd81 Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-23 13:34:03 +08:00
YiChin 263ba0581b I2C PIN 2019-07-23 13:33:34 +08:00
alan db943ee144 memory elite I2C 2019-07-23 13:32:30 +08:00
alan afb3da7942 memory elite I2C 2019-07-23 12:54:49 +08:00
alan 34fe7564ba memory elite I2C 2019-07-23 12:35:02 +08:00
alan eef87b3881 memory elite I2C 2019-07-23 12:25:13 +08:00
YiChin d606b2c7e9 I2C PIN 2019-07-23 11:11:45 +08:00
YiChin 495aa8bbc5 I2C PIN 2019-07-22 17:13:27 +08:00
alan f12185f853 memory elite I2C 2019-07-22 17:03:49 +08:00
alan a2d3ac3138 memory elite I2C 2019-07-22 15:22:43 +08:00
alan e4d34f886a memory elite I2C 2019-07-22 15:13:09 +08:00
alan ca946c1cd1 memory elite I2C 2019-07-19 09:20:29 +08:00
alan 26737e0a11 Merge remote-tracking branch 'origin/elite_memory' into elite_memory
# Conflicts:
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/EliteI2C.h
2019-07-19 09:19:59 +08:00
alan576 fc86bc9dd3 I2C write 2019-07-18 22:37:30 +08:00
alan c115de0bf0 memory elite I2C 2019-07-18 18:43:58 +08:00
alan da9e8493b7 memory elite I2C 2019-07-18 18:38:18 +08:00
alan 02a94ff271 memory elite 2019-07-18 18:34:09 +08:00
YiChin 7a06c05343 I2C PIN 2019-07-18 17:49:02 +08:00
alan 16eafe918a memory elite 2019-07-18 16:57:06 +08:00
YiChin 397cc1c50c I2C PIN 2019-07-18 16:51:03 +08:00
YiChin d8ac537fba I2C PIN 2019-07-18 16:28:50 +08:00
alan dbe5257f3a memory elite 2019-07-18 13:55:20 +08:00
alan 7437c17f84 memory elite 2019-07-18 12:19:27 +08:00
YiChin 520e710aae I2C PIN 2019-07-18 11:55:48 +08:00
YiChin 49888e73bb Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-18 11:28:41 +08:00
alan 78db3a0122 memory elite 2019-07-18 11:28:03 +08:00
YiChin cad6f00f2d Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-18 11:21:42 +08:00
alan 0139bfa17d memory elite 2019-07-18 11:21:03 +08:00
YiChin fa87ba98c5 Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-18 11:15:46 +08:00
alan f296b7a2c4 memory elite 2019-07-18 11:15:04 +08:00
alan c41e366758 memory elite 2019-07-18 11:10:22 +08:00
alan c241a1ea16 memory elite 2019-07-18 11:07:34 +08:00
YiChin 0bc9f8f4e3 Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-18 10:39:45 +08:00
alan 55a35e662c memory elite 2019-07-18 10:39:17 +08:00
YiChin d386613e55 Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-18 10:36:09 +08:00
alan e8b365c966 memory elite 2019-07-18 10:34:50 +08:00
YiChin e8a6546e54 Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-18 10:33:24 +08:00
alan 10bf24e490 memory elite 2019-07-18 10:32:54 +08:00
YiChin ad4d0fcf0a Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-18 10:30:02 +08:00
alan f4a339d55e memory elite 2019-07-18 10:29:33 +08:00
YiChin 74c0d60b2f Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-18 10:12:22 +08:00
alan 5e56c37511 memory elite 2019-07-18 10:10:14 +08:00
YiChin 5a5d934a46 Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-17 18:50:32 +08:00
alan ddc606a9bd memory elite 2019-07-17 18:48:14 +08:00
YiChin 70ee55c5a0 Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-17 18:44:05 +08:00
alan 8179ce47d1 memory elite 2019-07-17 18:42:36 +08:00
YiChin a6e240cd52 Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-17 18:11:09 +08:00
alan dc87af411a memory elite 2019-07-17 18:09:32 +08:00
YiChin c1363da184 Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-17 17:45:55 +08:00
alan 58970cb3c3 memory elite 2019-07-17 17:44:54 +08:00
alan fc83f4f227 memory elite 2019-07-17 17:34:05 +08:00
YiChin f16bbccd69 I2C PIN 2019-07-17 15:31:33 +08:00
YiChin b0430fc05e I2C PIN 2019-07-17 15:27:58 +08:00
YiChin 754d07a06c Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-17 15:27:22 +08:00
alan 05fa80faa2 memory elite 2019-07-17 15:22:28 +08:00
alan 3fa823b193 memory elite 2019-07-17 15:21:54 +08:00
YiChin 3b661d6dc2 Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-17 15:16:11 +08:00
alan 9c7b9e44a1 memory elite 2019-07-17 15:14:43 +08:00
YiChin b30c3108b7 Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-17 14:10:43 +08:00
alan 1bc1a4e982 memory elite 2019-07-17 14:09:12 +08:00
YiChin d36f5c3b38 Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-17 14:00:34 +08:00
alan 8427271eb0 memory elite 2019-07-17 13:59:08 +08:00
YiChin 01a2c6e8cd Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-17 13:50:11 +08:00
alan 409ca3dd06 memory elite 2019-07-17 13:48:41 +08:00
YiChin 80f3b65c83 Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-17 13:43:25 +08:00
alan f6269fd244 memory elite 2019-07-17 13:41:35 +08:00
YiChin 9f02fee658 Merge remote-tracking branch 'origin/elite_memory' into elite_memory 2019-07-17 13:37:01 +08:00
YiChin 92a76e834f I2C PIN 2019-07-17 13:34:55 +08:00
alan 28b8b8ce9d memory elite 2019-07-17 13:34:41 +08:00
alan b0ef493774 memory elite 2019-07-17 12:27:54 +08:00
alan 01c11fabec memory elite 2019-07-17 12:18:53 +08:00
alan 6a57a8b107 memory elite 2019-07-17 10:49:15 +08:00
alan 64c24bf496 memory elite 2019-07-16 18:47:38 +08:00
alan ceab949ff1 memory elite 2019-07-16 18:33:55 +08:00
alan 7be310f4e7 memory elite 2019-07-16 18:26:27 +08:00
alan d64dff8e04 memory elite 2019-07-16 18:23:15 +08:00
alan ec55140718 memory elite 2019-07-16 18:11:06 +08:00
alan 69b32f6a1c memory elite 2019-07-16 18:10:17 +08:00
alan 38cd245907 memory elite 2019-07-16 18:06:28 +08:00
alan c1ced5f9ff LED brightness 2019-07-10 14:44:38 +08:00
alan cc437b89e9 disable 10V 2019-07-05 18:20:05 +08:00
YiChin 794c74c629 I2C PIN 2019-07-03 14:42:30 +08:00
YiChin 83db25142d I2C PIN 2019-07-03 14:27:38 +08:00
alan c4484d3cc1 I2C PIN assign 2019-07-03 14:09:08 +08:00
alan f9a5d8b093 Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-07-03 14:06:01 +08:00
alan 5b3c3f40e6 I2C delete wrong PIN 2019-07-03 14:05:47 +08:00
YiChin 8f2e2d5465 I2C PIN 2019-07-03 14:03:46 +08:00
YiChin 8e182ceb29 I2C 2019-07-03 13:40:47 +08:00
alan fc10503cdd I2C test 2019-07-03 12:15:48 +08:00
alan a2296d1822 I2C test 2019-07-03 12:14:52 +08:00
YiChin 66b57372cb I2C 2019-07-03 11:39:01 +08:00
alan 1e5299034f I2C test 2019-07-03 11:28:41 +08:00
alan 82afe90a60 I2C test 2019-07-03 11:28:29 +08:00
YiChin a0ca72082e I2C 2019-07-03 11:07:22 +08:00
alan 22e52e46ff I2C test 2019-07-03 10:55:28 +08:00
alan 20820648ad I2C test 2019-07-03 10:32:30 +08:00
alan f41790fff2 I2C test 2019-07-03 10:27:36 +08:00
alan fe4977c08d do nothing 2019-07-02 10:16:42 +08:00
YiChin e12dd54f2a delete warning 2019-07-01 11:52:41 +08:00
alan 7d4de8c0bc cyclic volt 2019-07-01 11:45:50 +08:00
alan 2bd5a3849f cyclic V 2019-06-28 18:36:03 +08:00
YiChin 0e7b9462c1 Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-06-28 11:12:02 +08:00
alan b14d4da555 read current 2019-06-28 11:11:04 +08:00
YiChin b61647e504 read current 2019-06-27 15:55:04 +08:00
YiChin 728ce5b19d read current 2019-06-27 11:36:30 +08:00
alan d11b9cdbe2 read current 2019-06-27 10:46:23 +08:00
YiChin 149e092181 read current 2019-06-27 10:34:48 +08:00
YiChin f5de72ad41 read current 2019-06-27 10:16:36 +08:00
YiChin 6fa2d4310b Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-06-27 10:06:32 +08:00
alan eb76f57688 read current 2019-06-27 10:03:22 +08:00
YiChin 096bb72eb1 read current 2019-06-26 15:24:51 +08:00
YiChin 10407d1529 read current 2019-06-26 11:27:43 +08:00
alan ae67ac3355 read current 2019-06-26 10:56:17 +08:00
YiChin 5eba8169c6 read current 2019-06-26 10:45:16 +08:00
alan e299a6e01d read current 2019-06-26 09:33:34 +08:00
YiChin 3ea4c0a147 read current 2019-06-26 08:46:19 +08:00
YiChin 8b1cee29b1 read current 2019-06-25 17:40:17 +08:00
alan c8cac98df6 read volt 2019-06-25 12:14:21 +08:00
alan e0f811c706 read volt 2019-06-24 17:03:05 +08:00
alan 7254bd8c07 read volt 2019-06-24 16:02:27 +08:00
YiChin c8b527c99a read current 2019-06-24 15:57:37 +08:00
alan 629088602a choose current-read channel 2019-06-24 15:01:48 +08:00
YiChin bdc1e1bf9e read current 2019-06-24 14:55:00 +08:00
YiChin e88368e4f5 stable turnon have 10v 2019-06-24 11:13:02 +08:00
alan df40ab38bc VT IT function 2019-06-24 09:51:47 +08:00
alan a115eb69d0 VT IT function 2019-06-24 09:50:30 +08:00
alan 57f84f4ebd VT IT function 2019-06-21 15:49:27 +08:00
alan 2cf42f3f66 VT IT function 2019-06-21 13:31:54 +08:00
alan 6d585f6a74 VT IT function 2019-06-21 12:26:08 +08:00
alan 7525795ac8 VT IT function 2019-06-21 12:00:46 +08:00
alan ba66c00010 VT IT function 2019-06-21 11:01:32 +08:00
alan 7a9f66a1ae VT IT function 2019-06-20 17:33:42 +08:00
alan 488d955fcd VT IT function 2019-06-20 17:27:21 +08:00
alan 4064fc3396 VT IT function 2019-06-20 12:14:09 +08:00
alan b731bd2faf decode AIN0 & 1 2019-06-19 17:33:17 +08:00
alan 1d5e6feafe decode AIN0 & 1 2019-06-19 17:15:16 +08:00
alan 12e00174d2 Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-06-19 16:57:38 +08:00
alan a381517458 turn on 10v 2019-06-19 16:57:15 +08:00
YiChin 54611577ba ADC check 2019-06-19 16:01:47 +08:00
alan 450572ad8f Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-06-19 15:44:57 +08:00
alan 877adc39df turn on 10v 2019-06-19 15:44:35 +08:00
alan 9feb2ea1e6 turn on 10v 2019-06-19 15:43:59 +08:00
YiChin afc7ae2cb5 ADC check 2019-06-18 18:02:09 +08:00
YiChin 4d7ce9fba4 ADC check 2019-06-18 17:59:00 +08:00
alan 6254b23b3a BT format 2019-06-18 17:53:20 +08:00
alan 9ac6c643b3 BT format 2019-06-18 16:28:46 +08:00
alan e7d7e6993d delay before read ADCrxbuf 2019-06-17 16:02:38 +08:00
alan b2393e88fa delay before read ADCrxbuf 2019-06-17 15:44:31 +08:00
alan 57738442d7 decode ADC data 2019-06-17 10:06:57 +08:00
alan 2126e2ffa6 decode ADC data 2019-06-14 17:39:59 +08:00
alan 0ed4a20505 decode ADC data 2019-06-13 18:52:17 +08:00
alan a3c00d0a6e decode ADC data 2019-06-13 18:03:59 +08:00
alan 1f00996142 decode ADC data 2019-06-13 17:54:00 +08:00
YiChin 56093efb5a ADC check 2019-06-13 17:46:00 +08:00
alan e0c7786752 auto enable 10v test 2019-06-13 15:44:24 +08:00
YiChin 8ba667bbb8 auto enable 10v 2019-06-13 15:36:47 +08:00
alan 7661d230f1 decode ADC 2019-06-13 14:33:05 +08:00
alan 577eaaef56 decode ADC 2019-06-13 13:50:11 +08:00
alan b64719acea delay enable_10v 2019-06-11 15:37:04 +08:00
YiChin 7e6050e721 bug fix 2019-06-11 15:28:24 +08:00
alan ca3c31d7f5 LED brightness 2019-06-06 09:58:43 +08:00
YiChin c89e493e67 bug fix 2019-06-05 15:39:16 +08:00
alan a856cdc7d2 decode ADC V & I 2019-06-05 15:35:17 +08:00
alan 76cdf969a5 decode ADC V & I 2019-06-05 12:34:59 +08:00
alan 48c85a4389 decode ADC V & I 2019-06-05 12:25:29 +08:00
alan 992bc26ff1 enable 10v 2019-06-04 17:54:21 +08:00
alan b5aa10a8b5 enable 10v 2019-06-04 17:40:26 +08:00
alan b5eec41f36 DAC reset parameter 2019-06-04 14:26:19 +08:00
alan 2fb8faefbd DAC reset parameter 2019-06-04 14:18:43 +08:00
alan bcd144d265 IV curve full function 2019-06-04 11:57:50 +08:00
alan be1e961c2e IV curve full function 2019-06-04 11:40:28 +08:00
alan 6832bdfff6 notify format 2019-06-03 18:41:39 +08:00
alan 98aeea5f76 notify format 2019-06-03 18:38:21 +08:00
YiChin 85ff9dc965 bug fix 2019-06-03 17:09:37 +08:00
alan c650618e48 Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-06-03 15:53:36 +08:00
alan 882d87e522 decode ADC 2019-06-03 15:22:22 +08:00
YiChin 80a7847e67 bug fix 2019-06-03 12:30:33 +08:00
alan 86f2a3b7f1 decode ADC 2019-06-03 12:25:59 +08:00
alan a735a613d6 decode ADC 2019-06-03 12:04:04 +08:00
alan 666725a5f0 decode ADC 2019-06-03 11:16:50 +08:00
YiChin 89fb479591 bug fix 2019-06-03 10:24:53 +08:00
YiChin 5c7dc68e12 bug fix 2019-05-31 17:14:33 +08:00
alan 8a5afab22f decode ADC 2019-05-31 17:09:15 +08:00
alan 589357b800 decode ADC 2019-05-31 17:05:37 +08:00
alan 3ea2f423cc decode ADC 2019-05-31 15:14:01 +08:00
alan 150187c1f5 decode ADC 2019-05-31 14:35:28 +08:00
YiChin ac1f2524f4 Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-05-31 14:23:09 +08:00
YiChin 72a000f0ff bug fix 2019-05-31 14:22:34 +08:00
alan 89b8f3fbdf decode ADC 2019-05-31 14:19:54 +08:00
alan 2518fac529 decode ADC 2019-05-31 12:25:22 +08:00
alan 447913d970 elite launch pad 2019-05-30 18:26:52 +08:00
alan a3c65a76a1 idk 2019-05-28 18:09:54 +08:00
alan 3e3ed17693 disable 10v 2019-05-28 14:39:38 +08:00
alan 60a79e4d63 disable 10v 2019-05-28 11:59:13 +08:00
alan bf99c38328 disable 10v 2019-05-28 11:16:13 +08:00
alan 5a336e92de Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-05-27 18:33:38 +08:00
alan f495369097 disable 10v 2019-05-27 18:33:20 +08:00
YiChin2018 8bd9149406 Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-05-27 14:17:14 +08:00
YiChin2018 c143fca1dd check elite version 2019-05-27 14:14:07 +08:00
alan 4be39160cb disable 10v 2019-05-27 11:45:32 +08:00
alan 2d32cdca79 test No.7 board 2019-05-27 11:30:58 +08:00
alan fe23291b22 test No.7 board 2019-05-27 11:19:58 +08:00
alan f9640eca33 test No.7 board 2019-05-27 11:04:08 +08:00
alan a1b77848ef 6994 turn on bug? 2019-05-24 12:25:32 +08:00
alan 5f45be8ae6 6994 turn on bug? 2019-05-24 12:21:55 +08:00
alan 4007c2f55d 6994 turn on bug? 2019-05-24 12:08:41 +08:00
alan afe3d87d80 6994 turn on bug? 2019-05-24 11:54:39 +08:00
alan d59346a05e 6994 turn on bug? 2019-05-24 11:39:57 +08:00
alan 627ba46781 6994 turn on bug? 2019-05-24 11:03:26 +08:00
alan 6586df1ccf 6994 turn on bug? 2019-05-24 11:01:37 +08:00
alan de4f3a6d93 test new Elite board 2019-05-24 10:56:27 +08:00
alan e7512a6896 test new Elite board 2019-05-24 10:43:53 +08:00
alan 030eb4234b test new Elite board 2019-05-24 10:31:30 +08:00
alan 8b551f91a4 test new Elite board 2019-05-24 10:07:30 +08:00
alan f5f8673d93 ADC formula 2019-05-23 16:18:48 +08:00
alan 4344429fbf ADC formula 2019-05-23 16:18:40 +08:00
alan f5aa6f44c1 ADC formula 2019-05-23 16:15:29 +08:00
alan eb61856009 sendnotify 2019-05-23 10:07:20 +08:00
alan 3282e85635 sendnotify 2019-05-22 17:03:24 +08:00
alan fc50f62678 SendNotify 2019-05-22 16:28:20 +08:00
alan 8c0d3f6873 Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-05-22 16:22:37 +08:00
alan b1028cb2da SendNotify 2019-05-22 16:22:23 +08:00
Ta-Shun Su 3074e7e3be update devlib Elite 2019-05-22 16:22:06 +08:00
Ta-Shun Su 0416b66ace update devlib Elite 2019-05-22 15:08:06 +08:00
alan 03ccd3de8a RIS VIS CIS 2019-05-22 15:05:07 +08:00
Ta-Shun Su 6a048e4caf Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-05-22 14:59:31 +08:00
Ta-Shun Su 0eb27aebc8 add devlib Elite 2019-05-22 14:58:23 +08:00
alan acc2ca6f41 RIS VIS CIS 2019-05-22 12:22:08 +08:00
alan bf03fcce62 RIS VIS CIS 2019-05-22 12:10:54 +08:00
alan aca289cb6c RIS VIS CIS 2019-05-22 11:33:21 +08:00
alan ca2296fd1b json 2019-05-22 11:13:02 +08:00
alan f5e43575e0 json 2019-05-22 10:58:14 +08:00
alan 666da6629e json 2019-05-21 18:40:09 +08:00
alan 63b21353d5 disable 10v (debug 2019-05-21 17:24:22 +08:00
alan 70818392bc add json 2019-05-21 15:42:46 +08:00
alan 4620798382 add json 2019-05-21 15:40:23 +08:00
alan 809ba648ff add json 2019-05-21 11:48:40 +08:00
alan 0901616b39 should be ok 2019-05-21 11:37:30 +08:00
alan 5c07352e4c should be ok 2019-05-21 11:09:11 +08:00
alan 7f3e15cb46 two way IV curve, fix reset LED BUG 2019-05-21 11:02:45 +08:00
alan 64926f8aa9 two way IV curve, fix reset LED BUG 2019-05-21 10:08:01 +08:00
alan fcf3e4bc17 two way IV curve, fix reset LED BUG 2019-05-20 18:36:19 +08:00
alan 00809b9022 two way IV curve, fix reset LED BUG 2019-05-20 18:17:03 +08:00
alan 0192c63ad3 Periodic DAC well function, add reset 2019-05-20 17:51:55 +08:00
alan 60db87b8ec Periodic DAC well function, add reset 2019-05-20 17:50:56 +08:00
alan 9b7571ddbf Periodic DAC well function, add reset 2019-05-20 17:44:23 +08:00
alan 8861b0480e Periodic DAC well function, add reset 2019-05-20 17:40:37 +08:00
alan d54827dfdd Periodic ADC with multi-input parameter 2019-05-20 16:54:27 +08:00
alan 0999a45f5e Periodic ADC with multi-input parameter 2019-05-20 16:47:40 +08:00
alan 887b046409 Periodic ADC with multi-input parameter 2019-05-20 16:32:02 +08:00
alan 4337d81951 Periodic ADC with multi-input parameter 2019-05-20 16:10:13 +08:00
alan 7fdb0f6e5f Periodic ADC with multi-input parameter 2019-05-20 15:54:39 +08:00
alan 263053a500 Periodic ADC with multi-input parameter 2019-05-20 14:39:23 +08:00
alan a8360e94a2 Periodic ADC with multi-input parameter 2019-05-20 14:36:43 +08:00
alan 5f01c568fd Periodic ADC with multi-input parameter 2019-05-20 14:33:35 +08:00
alan 6214b33965 Periodic ADC with multi-input parameter 2019-05-20 14:30:45 +08:00
alan 2bf1f9dc62 Periodic ADC with multi-input parameter 2019-05-20 14:26:56 +08:00
alan fc26383fa1 test Periodic DAC 2019-05-20 12:45:32 +08:00
alan a3e1d5f983 test Periodic DAC 2019-05-20 12:08:36 +08:00
alan d69ea4978a test Periodic DAC 2019-05-20 11:51:41 +08:00
alan fca331fefa test Periodic DAC 2019-05-20 11:37:51 +08:00
alan 5b43b36596 test Periodic DAC 2019-05-20 11:24:12 +08:00
alan 2e9d534ffe test Periodic DAC 2019-05-20 11:00:51 +08:00
alan 0eb128ff48 test Periodic DAC 2019-05-20 10:21:17 +08:00
alan aae2fb0591 test Periodic DAC 2019-05-20 10:12:16 +08:00
alan b63c01f25b IV = ADC test 2019-05-17 18:28:28 +08:00
alan d82bfa77ff IV = ADC test 2019-05-17 18:19:39 +08:00
alan 33ca96b15a IV = ADC test 2019-05-17 18:14:33 +08:00
alan 1c2659c0fc IV = ADC test 2019-05-17 18:09:12 +08:00
alan 3d43bbf501 IV = ADC test 2019-05-17 18:07:55 +08:00
YiChin 42bef16cbe bug fix 2019-05-17 17:03:57 +08:00
alan 1a172d5bde send ADC notify back 2019-05-17 16:26:31 +08:00
alan caea8ceb06 send ADC notify back 2019-05-17 16:05:16 +08:00
alan ff4a3fdb5e send ADC notify back 2019-05-17 15:45:48 +08:00
alan e9d27886ed send ADC notify back 2019-05-17 15:39:41 +08:00
alan 759f7dbc72 send ADC notify back 2019-05-17 15:30:17 +08:00
alan 646abd4d4a send ADC notify back 2019-05-17 15:16:37 +08:00
alan 2a0fade480 send ADC notify back 2019-05-17 14:42:30 +08:00
alan 23e85a173d Stable, char2,4 fine. Consume 75mA in idle,
130mA working
2019-05-16 18:15:34 +08:00
alan d6cc1124c8 try char4 2019-05-16 18:06:00 +08:00
alan c4c303a948 try char4 2019-05-16 17:42:51 +08:00
alan cd06b0fc5e try char2 2019-05-16 17:13:14 +08:00
alan d7344acdac try char2 2019-05-16 17:03:01 +08:00
alan 418b89848e Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-05-16 16:52:02 +08:00
alan 0641b6c79c try char2 2019-05-16 16:41:00 +08:00
YiChin ff5cb3ddc7 idk 2019-05-16 14:57:04 +08:00
YiChin 305de3891d Merge branch 'elite_zm/master' of https://bitbucket.org/YiChin2018/bioprocc2650 into elite_zm/master 2019-05-16 14:41:10 +08:00
alan 37ebae07c0 try char2 2019-05-16 14:39:03 +08:00
alan 10ba95e53c try char2 2019-05-16 14:15:48 +08:00
alan 7cf0c3070e Merge branch 'tmp' into elite_zm/master
# Conflicts:
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/impedance_meter.h
2019-05-16 13:48:42 +08:00
YiChin 3d1089bdaf LED darker, 10v enable first, 5v enable after press 1 sec 2019-05-16 11:25:17 +08:00
alan d6582b9da8 cyclic_Voltammetry 2019-05-15 18:25:12 +08:00
YiChin b6aaad5ffd pull high CS 2019-05-15 16:44:01 +08:00
YiChin 950f411b7f pull high ADC CS 2019-05-15 16:40:31 +08:00
alan 7f4eafc61f test ADC/DAC switch 2019-05-15 16:06:11 +08:00
alan 82540de425 Stable version (use pure color) 2019-05-15 13:58:18 +08:00
YiChin 3ce500735a do not use "combine color", use R G B pure color 2019-05-15 13:49:58 +08:00
alan 2b0ebbd911 modify key press LED 2019-05-15 12:38:38 +08:00
alan 4461df12fb cyclic 2019-05-13 12:50:32 +08:00
alan 8171d940a8 ADC w/r 2019-05-13 10:23:00 +08:00
alan 667ef30a86 ADC w/r 2019-05-13 09:56:48 +08:00
alan 40e621ca26 adc comment 2019-05-10 18:33:35 +08:00
alan 5227af8c97 open-close SPI0 2019-05-10 18:13:49 +08:00
alan 3ce57243aa open-close SPI0 2019-05-10 18:12:31 +08:00
alan 21c0bb59c3 open-close SPI0 2019-05-10 18:05:40 +08:00
alan 457030989a open-close SPI0 2019-05-10 18:04:05 +08:00
alan f8653b3749 open-close SPI0 2019-05-10 17:55:44 +08:00
alan 33b2aaf46e open-close SPI0 2019-05-10 15:21:47 +08:00
alan 7af2a69e8f DAC init 2019-05-10 12:11:47 +08:00
alan f3195f2111 ramp test 2019-05-09 18:14:44 +08:00
alan 568d2f7938 should be stable 2019-05-09 18:12:53 +08:00
alan a1cc97df35 add periodic event 2019-05-09 18:01:11 +08:00
alan b47c43466b add periodic event 2019-05-09 17:07:36 +08:00
alan 48e92df901 ramp in periodic task 2019-05-09 16:33:44 +08:00
alan f581156c9a TurnOnElite 2019-05-09 15:47:43 +08:00
alan d1ced61993 DAC power on reset = mid-scale 2019-05-09 15:08:02 +08:00
alan a055479140 DAC power on reset = mid-scale 2019-05-09 15:06:14 +08:00
alan a2c48bd8dc clock with PeriodicEvent 2019-05-09 14:48:59 +08:00
alan 6d274cddee move out clock 2019-05-09 14:34:24 +08:00
alan 6c640de827 delete old DAC code/comment 2019-05-09 12:29:10 +08:00
alan caaf15a835 ramp function 2019-05-08 18:28:02 +08:00
alan 5fa4f3564f hope can scan 2019-05-08 18:10:28 +08:00
alan e3dc39f1aa ADC spi 2019-05-08 17:54:09 +08:00
alan c12bf4dccd spi 1M 2019-05-08 17:41:51 +08:00
YiChin 040e7fc0d1 stable 2019-05-08 17:38:12 +08:00
YiChin 54e97545dc 1sec DAC 2019-05-08 17:27:20 +08:00
YiChin 68ff23df61 bug fix 2019-05-08 14:39:52 +08:00
alan 2fd95dac35 ADC spi 2019-05-08 13:18:38 +08:00
alan ea23cf7f6e ADC spi 2019-05-08 11:42:01 +08:00
alan 0ff285882e LED spi 1M 2019-05-08 11:12:34 +08:00
alan dfc135392f bug fix 2019-05-08 10:04:00 +08:00
alan b1ddee7c0b bug fix 2019-05-08 09:59:09 +08:00
YiChin e68552b740 bug fix 2019-05-07 18:40:07 +08:00
YiChin 812e35c6c1 bug fix 2019-05-07 18:39:26 +08:00
alan 2d4cf408f9 combine LED & ADC SPI 2019-05-07 18:34:58 +08:00
alan 750d4ad449 combine LED & ADC SPI 2019-05-07 18:29:20 +08:00
alan 34b0b6af46 combine LED & ADC SPI 2019-05-07 18:26:47 +08:00
YiChin f55d1d161d DAC stable version 2019-05-07 17:30:01 +08:00
alan 2d8a5bd4fb Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-05-07 16:52:00 +08:00
alan 1152ea3960 SPI u8 * 3 2019-05-07 16:51:29 +08:00
YiChin 1fae6abb15 bug fix 2019-05-07 16:41:07 +08:00
alan bb643cc79f SPI u8 * 3 2019-05-07 16:35:18 +08:00
alan cad336db0e test DAC 2019-05-07 16:31:48 +08:00
alan 1d15c7d7cd test DAC 2019-05-07 16:25:46 +08:00
YiChin fb3f2860ea bug fix 2019-05-07 16:19:21 +08:00
alan 6568045f46 test DAC 2019-05-07 16:14:56 +08:00
alan 6892bcf21e test DAC 2019-05-07 16:00:59 +08:00
alan 47aa461598 test DAC 2019-05-07 15:09:11 +08:00
alan f25fb340a9 test BT connect 2019-05-07 14:43:48 +08:00
alan 7a37647d72 Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-05-07 14:35:29 +08:00
alan b2509ac5d9 test BT connect 2019-05-07 14:35:09 +08:00
YiChin 6e351e9dce rebuild? 2019-05-07 14:19:58 +08:00
YiChin ad1e401476 fix too few argument 2019-05-07 12:04:03 +08:00
alan a3894ca51d SPI 00 => 01 2019-05-07 11:59:44 +08:00
alan 81127d81fe SPI 01 mode => 00, add command in DAC function 2019-05-06 18:00:41 +08:00
alan 277bd7dcfb do not too bright 2019-05-06 17:45:58 +08:00
alan 321bc497aa do not too bright 2019-05-06 17:14:29 +08:00
alan 88abb662d1 do not too bright 2019-05-06 17:11:27 +08:00
alan 6fa0a142fe do not too bright 2019-05-06 17:02:09 +08:00
alan b192fbb0e1 test DAC 2019-05-06 16:44:39 +08:00
alan 6438180082 test DAC 2019-05-06 16:28:53 +08:00
alan 3ae7000718 test DAC 2019-05-06 16:08:08 +08:00
alan 178c982acb test DAC 2019-05-06 15:57:49 +08:00
alan 3507b6d1d0 test DAC 2019-05-06 15:53:10 +08:00
alan 5045681045 Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-05-06 15:19:23 +08:00
alan b4dd7f0f30 test DAC 2019-05-06 15:19:07 +08:00
YiChin 272a66ee0c 6994 off 2019-05-06 15:04:29 +08:00
alan 4c61710ae7 test DAC 2019-05-06 15:03:32 +08:00
alan c9872a6ce9 test DAC 2019-05-06 14:58:27 +08:00
alan db9d36046a test DAC 2019-05-06 14:46:52 +08:00
alan f3dc2d9923 test DAC 2019-05-06 14:04:04 +08:00
alan 5e58a2ba02 EliteKey press 2019-05-06 13:47:42 +08:00
alan c8c6c82c0b Merge remote-tracking branch 'origin/elite_zm/master' into elite_zm/master 2019-05-06 13:44:04 +08:00
alan a31c33540e EliteKey press 2019-05-06 13:43:32 +08:00
YiChin 45dc14e181 rebuild pass 2019-05-06 12:47:12 +08:00
YiChin b086410846 Merge branch 'master' into elite_zm/master 2019-05-06 12:39:53 +08:00
alan 67e280004b EliteKey press 2019-05-06 11:41:02 +08:00
Ta-Shun Su 3b5c24311d Merge branch 'master' into elite_zm/master 2019-05-06 11:35:42 +08:00
Ta-Shun Su b75d54ce46 pull 2019-05-06 11:02:43 +08:00
Ta-Shun Su 0a90afecdb copy from Elite_alan 2019-04-30 18:06:28 +08:00
109 changed files with 6811 additions and 4936 deletions
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/common/cc26xx/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/controller/cc26xx/inc/
-1
View File
@@ -1 +0,0 @@
../tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/cc26xx/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/components/heapmgr/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/examples/host_test/cc26xx/app/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/icall/inc/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/components/icall/src/inc/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/inc/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/components/npi/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/profiles/roles/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/profiles/dev_info/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/rom/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/components/services/src/saddr/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/components/services/src/sdata/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/
-1
View File
@@ -1 +0,0 @@
../simplelink/ble_sdk_2_02_02_25/src/target/
@@ -9,6 +9,6 @@
<linkerCommandFile value="cc26x0f128.cmd"/>
<rts value="libc.a"/>
<createSlaveProjects value=""/>
<connection value="common/targetdb/connections/TIXDS100v3_Dot7_Connection.xml"/>
<connection value="common/targetdb/connections/TIXDS110_Connection.xml"/>
<isTargetManual value="false"/>
</projectOptions>
@@ -18,13 +18,13 @@
<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.308833195" name="TI Build Tools" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.2125878104">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.2138235341" 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"/>
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/>
<listOptionValue builtIn="false" value="XDC_VERSION=3.32.0.06_core"/>
<listOptionValue builtIn="false" value="XDC_VERSION=3.32.2.25_core"/>
<listOptionValue builtIn="false" value="INACTIVE_REPOS="/>
<listOptionValue builtIn="false" value="EXPANDED_REPOS="/>
<listOptionValue builtIn="false" value="RTSC_PRODUCTS=com.ti.rtsc.TIRTOSCC13XX_CC26XX:2.21.01.08;"/>
@@ -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.243195404" name="Compiler version" 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.955793533" 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.638576662" keepEnvironmentInBuildfile="false" name="GNU Make" 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.1016177761" 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.2070806136" name="Target processor version (--silicon_version, -mv)" 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.1411365061" name="Designate code state, 16-bit (thumb) or 32-bit (--code_state)" 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.193495829" name="Application binary interface. (--abi)" 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.1573436637" name="Little endian code [See 'General' page to edit] (--little_endian, -me)" 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.978889992" name="Optimization level (--opt_level, -O)" 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.1392883332" name="Speed vs. size trade-offs (--opt_for_speed, -mf)" 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.511635494" name="Add dir to #include search path (--include_path, -I)" 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,10 +70,11 @@
<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.521147483" name="Pre-define NAME (--define, -D)" 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"/>
<listOptionValue builtIn="false" value="HEADSTAGE_MA_USE_SPI2"/>
<listOptionValue builtIn="false" value="CC26XX"/>
<listOptionValue builtIn="false" value="GAPROLE_TASK_STACK_SIZE=540"/>
<listOptionValue builtIn="false" value="HEAPMGR_SIZE=0"/>
@@ -85,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.1861999587" name="Debugging model" 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.1867564782" name="C Dialect" 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.2052831394" name="Enable support for GCC extensions (DEPRECATED) (--gcc)" 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.1102242787" name="Suppress diagnostic &lt;id&gt; (--diag_suppress, -pds)" 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.727880917" name="Treat diagnostic &lt;id&gt; as warning (--diag_warning, -pdsw)" 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.996618365" name="Wrap diagnostic messages (--diag_wrap)" 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.858761211" name="Emit diagnostic identifier numbers (--display_error_number, -pden)" 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.96303422" name="Place each function in a separate subsection (--gen_func_subsections, -ms)" 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.1634706392" name="Read options from specified file (--cmd_file, -@)" 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.1149005836" 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.404213358" 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.1356338499" 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.1609020645" 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.2125878104" 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.1993482378" name="Set C system stack size (--stack_size, -stack)" 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.833137428" name="Heap size for C/C++ dynamic memory allocation (--heap_size, -heap)" 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.1072440081" name="Link information (map) listed into &lt;file&gt; (--map_file, -m)" 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.95815077" name="Specify output file name (--output_file, -o)" 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.1766117832" name="Include library file or command file as input (--library, -l)" 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.1149343368" name="Add &lt;dir&gt; to library search path (--search_path, -i)" 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.512740056" name="Suppress diagnostic &lt;id&gt; (--diag_suppress)" 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.755787473" name="Wrap diagnostic messages (--diag_wrap)" 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.1039632635" name="Emit diagnostic identifier numbers (--display_error_number)" 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.160090718" name="Detailed link information data-base into &lt;file&gt; (--xml_link_info, -xml_link_info)" 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.1907564273" name="Aggressively reduce size of the DWARF information (--compress_dwarf)" 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.1278577864" name="Eliminate sections not needed in the executable (--unused_section_elimination)" 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.1166775149" 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.1192919935" 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.1491242603" 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.1967400950" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.1242139870" name="Specify rom width (--romwidth, -romwidth=width)" 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.1863065780" name="Specify memory width (--memwidth, -memwidth=width)" 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.47746446" name="Output format" 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.1864525425" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.46430604" name="Package repositories (--xdcpath)" 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.313008504" name="Target (-t)" 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.807892561" name="Platform (-p)" 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.1808973543" name="Platform (-p)" 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.1028195441" name="Build-profile (-r)" 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.295955151" name="Compiler tools directory (-c)" 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.128448790" name="Additional compiler options (--compileOptions)" 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>
@@ -1,19 +1,20 @@
<?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 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"/>
<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"/>
</choice>
</property>
<platform XML_version="1.2" id="platform_0">
@@ -16,7 +16,7 @@
# sources were generated) is:
# C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\config\src
#
GEN_SRC_DIR ?= ../../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/
@@ -22,8 +22,8 @@ CC = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/bin/armcl -c $(CCOPTS) -I
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,:)
@@ -16,7 +16,7 @@
# sources were generated) is:
# C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650lp\host_test\ccs\config\src
#
GEN_SRC_DIR ?= ../../config/src
GEN_SRC_DIR ?= ../../../../../ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650lp/host_test/ccs/config/src
ifeq (,$(wildcard $(GEN_SRC_DIR)))
$(error "ERROR: GEN_SRC_DIR must be set to the directory containing the generated sources")
@@ -16,11 +16,11 @@ BIOS_INC = -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/pa
TARGET_INC = -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/"
INCS = $(BIOS_INC) $(TARGET_INC) --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/examples/host_test/cc26xx/app/cc2650" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/examples/host_test/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/common/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/npi/src" --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_16.9.4.LTS/include" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/examples/host_test/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/common/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/npi/src" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/heapmgr" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/controller/cc26xx/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/target" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/sdata" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/saddr" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/icall/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/rom" --include_path="C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272" -IC:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/
CC = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include
ASM = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include
AR = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/bin/armar rq
CC = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv8/tools/compiler/ti-cgt-arm_16.9.4.LTS/include
ASM = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv8/tools/compiler/ti-cgt-arm_16.9.4.LTS/include
AR = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_16.9.4.LTS/bin/armar rq
DEL = C:/ti/xdctools_3_32_00_06_core/packages/../bin/rm -f
CP = C:/ti/xdctools_3_32_00_06_core/packages/../bin/cp -f
@@ -16,7 +16,7 @@
# sources were generated) is:
# C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650lp\simple_peripheral\ccs\config\src
#
GEN_SRC_DIR ?= ../../config/src
GEN_SRC_DIR ?= ../../../../../ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650lp/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")
@@ -80,6 +80,7 @@ const PIN_Config BoardGpioInitTable[] = {
Board_UART_TX | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, /* UART TX */
Board_SRDY | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL, /* SRDY */
Board_MRDY | PIN_INPUT_EN | PIN_PULLDOWN, /* MRDY */
PIN_TERMINATE
};
@@ -189,57 +190,6 @@ const UDMACC26XX_Config UDMACC26XX_config[] = {
* ============================= UDMA end =====================================
*/
/*
* ========================== SPI DMA begin ===================================
*/
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(SPI_config, ".const:SPI_config")
#pragma DATA_SECTION(spiCC26XXDMAHWAttrs, ".const:spiCC26XXDMAHWAttrs")
#endif
/* Include drivers */
#include <ti/drivers/spi/SPICC26XXDMA.h>
/* SPI objects */
SPICC26XXDMA_Object spiCC26XXDMAObjects[BOOSTXL_CC2650MA_SPICOUNT];
/* SPI configuration structure, describing which pins are to be used */
const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[BOOSTXL_CC2650MA_UDMACOUNT] = {
{
.baseAddr = SSI0_BASE,
.intNum = INT_SSI0_COMB,
.intPriority = ~0,
.swiPriority = 0,
.powerMngrId = PowerCC26XX_PERIPH_SSI0,
.defaultTxBufValue = 0,
.rxChannelBitMask = 1<<UDMA_CHAN_SSI0_RX,
.txChannelBitMask = 1<<UDMA_CHAN_SSI0_TX,
.mosiPin = Board_SPI0_MOSI,
.misoPin = Board_SPI0_MISO,
.clkPin = Board_SPI0_CLK,
.csnPin = Board_SPI0_CS
},
};
/* SPI configuration structure */
const SPI_Config SPI_config[] = {
{
.fxnTablePtr = &SPICC26XXDMA_fxnTable,
.object = &spiCC26XXDMAObjects[0],
.hwAttrs = &spiCC26XXDMAHWAttrs[0]
},
{
.fxnTablePtr = &SPICC26XXDMA_fxnTable,
.object = &spiCC26XXDMAObjects[1],
.hwAttrs = &spiCC26XXDMAHWAttrs[1]
},
{NULL, NULL, NULL}
};
/*
* ========================== SPI DMA end =====================================
*/
/*
* ========================== Crypto begin ====================================
@@ -89,24 +89,24 @@ extern const PIN_Config BoardGpioInitTable[];
*/
/* Connector J1 */
#define Board_BP_Pin_J1_2 DIO7
#define Board_BP_Pin_J1_2 IOID_UNUSED
#define Board_BP_Pin_J1_3 DIO0
#define Board_BP_Pin_J1_4 DIO1
#define Board_BP_Pin_J1_5 DIO2
#define Board_BP_Pin_J1_6 DIO3
#define Board_BP_Pin_J1_7 DIO10
#define Board_BP_Pin_J1_7 DIO11 /* SCLK */
#define Board_BP_Pin_J1_8 DIO4
#define Board_BP_Pin_J1_9 DIO5
#define Board_BP_Pin_J1_10 DIO6
/* Connector J2 */
#define Board_BP_Pin_J2_19 DIO8
#define Board_BP_Pin_J2_18 DIO9 /* CS */
#define Board_BP_Pin_J2_19 IOID_UNUSED
#define Board_BP_Pin_J2_18 IOID_UNUSED
#define Board_BP_Pin_J2_17 IOID_UNUSED /* NC */
#define Board_BP_Pin_J2_15 DIO11 /* MOSI */
#define Board_BP_Pin_J2_14 DIO12 /* MISO */
#define Board_BP_Pin_J2_13 DIO13
#define Board_BP_Pin_J2_12 DIO14
#define Board_BP_Pin_J2_15 DIO8 /* MOSI */
#define Board_BP_Pin_J2_14 DIO7 /* MISO */
#define Board_BP_Pin_J2_13 DIO9 /* DAC_CS */
#define Board_BP_Pin_J2_12 DIO12 /* ADC_CS */
#define Board_BP_Pin_J2_11 IOID_UNUSED /* NC */
/* Mapping of BoosterPack Connector Pins to BoosterPack Standard Functions (reflecting the BoosterPack Standard)
@@ -125,12 +125,12 @@ extern const PIN_Config BoardGpioInitTable[];
/* Connector J2 */
#define Board_BP_PWM_0 Board_BP_Pin_J2_19
#define Board_BP_SPI_CS_Wireless Board_BP_Pin_J2_18
#define Board_BP_SPI_CS_Wireless PIN_UNASSIGNED
#define Board_BP_GPIO_3 Board_BP_Pin_J2_17
#define Board_BP_SPI_MOSI Board_BP_Pin_J2_15
#define Board_BP_SPI_MISO Board_BP_Pin_J2_14
#define Board_BP_SPI_CS_Display Board_BP_Pin_J2_13
#define Board_BP_SPI_CS_Other Board_BP_Pin_J2_12
#define Board_BP_SPI_CS_Display PIN_UNASSIGNED
#define Board_BP_SPI_CS_Other PIN_UNASSIGNED
#define Board_BP_GPIO_2 Board_BP_Pin_J2_11
@@ -145,11 +145,11 @@ extern const PIN_Config BoardGpioInitTable[];
#define Board_UART_TX Board_BP_UART_Rx /* RXD */
#define Board_UART_RX Board_BP_UART_Tx /* TXD */
/* SPI Board */
#define Board_SPI0_MISO Board_BP_SPI_MISO
#define Board_SPI0_MOSI Board_BP_SPI_MOSI
#define Board_SPI0_CLK Board_BP_SPI_CLK
#define Board_SPI0_CS Board_BP_SPI_CS_Wireless
//#define Board_SPI0_MISO PIN_UNASSIGNED
//#define Board_SPI0_MOSI PIN_UNASSIGNED
/* Power Management Board */
#define Board_SRDY Board_BP_Pin_J2_19
@@ -170,6 +170,7 @@ extern const PIN_Config BoardGpioInitTable[];
* ==========================================================================*/
/* Generic SPI instance identifiers */
#define Board_SPI0 BOOSTXL_CC2650MA_SPI0
#define Board_SPI1 BOOSTXL_CC2650MA_SPI1
/* Generic UART instance identifiers */
#define Board_UART BOOSTXL_CC2650MA_UART0
/* Generic TRNG instance identiifer */
@@ -208,15 +209,7 @@ typedef enum BOOSTXL_CC2650MA_CryptoName {
} BOOSTXL_CC2650MA_CryptoName;
/*!
* @def BOOSTXL_CC2650MA_SPIName
* @brief Enum of SPI names on the CC2650 Booster Pack
*/
typedef enum BOOSTXL_CC2650MA_SPIName {
BOOSTXL_CC2650MA_SPI0 = 0,
BOOSTXL_CC2650MA_SPICOUNT
} BOOSTXL_CC2650MA_SPIName;
/*!
* @def BOOSTXL_CC2650MA_TRNGName
@@ -39,6 +39,7 @@ extern "C" {
#include <ti/drivers/Power.h>
//#include "BOOSTXL_CC2650MA.h"
#include "BOOSTXL_CC2650MA.h"
/* These #defines allow us to reuse TI-RTOS across other device families */
@@ -79,23 +79,22 @@ extern const PIN_Config BoardGpioInitTable[];
/* UART Board */
#define Board_UART_RX IOID_2 /* RXD */
#define Board_UART_TX IOID_3 /* TXD */
#define Board_UART_TX PIN_UNASSIGNED /* TXD */
#define Board_UART_CTS IOID_19 /* CTS */
#define Board_UART_RTS IOID_18 /* RTS */
/* SPI Board */
#define Board_SPI0_MISO IOID_8 /* RF1.20 */
#define Board_SPI0_MOSI IOID_9 /* RF1.18 */
#define Board_SPI0_CLK IOID_10 /* RF1.16 */
#define Board_SPI0_MISO IOID_0 /* RF1.20 */
#define Board_SPI0_MOSI IOID_1 /* RF1.18 */
#define Board_SPI0_CLK IOID_3 /* RF1.16 */
#define Board_SPI0_CSN PIN_UNASSIGNED
#define Board_SPI1_MISO PIN_UNASSIGNED
#define Board_SPI1_MOSI PIN_UNASSIGNED
#define Board_SPI1_CLK PIN_UNASSIGNED
#define Board_SPI1_MOSI IOID_8 /* LED_MOSI */
#define Board_SPI1_CLK IOID_9 /* LED_CLK */
#define Board_SPI1_CSN PIN_UNASSIGNED
/* I2C */
#define Board_I2C0_SCL0 IOID_4
#define Board_I2C0_SDA0 IOID_5
/* SPI */
#define Board_SPI_FLASH_CS IOID_20
@@ -103,8 +102,8 @@ extern const PIN_Config BoardGpioInitTable[];
#define Board_FLASH_CS_OFF 1
/* Booster pack generic */
#define Board_DIO0 IOID_0
#define Board_DIO1_RFSW IOID_1
#define Board_DIO0 PIN_UNASSIGNED
#define Board_DIO1_RFSW PIN_UNASSIGNED
#define Board_DIO12 IOID_12
#define Board_DIO15 IOID_15
#define Board_DIO16_TDO IOID_16
View File
View File
View File
View File
View File
View File
View File
@@ -55,7 +55,7 @@ extern "C"
// includes
// ****************************************************************************
#include "hal_types.h"
#include "npi/src/inc/npi_config.h"
#include "inc/npi_config.h"
// ****************************************************************************
// defines
View File
View File
View File
View File
View File
View File
@@ -9,7 +9,7 @@
Target Device: CC2650, CC2640
******************************************************************************
Copyright (c) 2013-2018, Texas Instruments Incorporated
All rights reserved.
@@ -45,121 +45,87 @@
Release Date: 2018-04-02 18:03:35
*****************************************************************************/
/*********************************************************************
* INCLUDES
*/
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/hal/Hwi.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/knl/Queue.h>
#include <string.h>
#include "hal_types.h"
#include "hci_tl.h"
#include "hci_ext.h"
#include "gatt.h"
#include "hci.h"
#include "gapgattserver.h"
#include "gattservapp.h"
#include "gapbondmgr.h"
#define OSAL_SNV 0
#include "osal_snv.h"
#include "icall_apimsg.h"
#include "util.h"
#include <ti/mw/display/Display.h>
#include "inc/npi_ble.h"
#include "inc/npi_task.h"
#include <inc/hw_types.h>
#include "hal_defs.h"
#if defined ( USE_RCOSC )
#include "rcosc_calibration.h"
#endif // USE_RCOSC
#if defined ( GATT_TEST ) || defined ( GATT_QUAL )
#include "gatttest.h"
#if defined(GATT_TEST) || defined(GATT_QUAL)
#include "gatttest.h"
#endif
#include "host_test_app.h"
#if defined( USE_FPGA ) || defined( DEBUG_SW_TRACE )
#include <driverlib/ioc.h>
#endif // USE_FPGA | DEBUG_SW_TRACE
//#define PERIODIC_USE_GPTIMER
/*********************************************************************
* CONSTANTS
*/
#include "cc2650/cc2650_util.h"
//#include "cc2650/cc2650_slave.h"
#include "cc2650/cc2650_master.h"
// LE Event Lengths
#define HCI_CMD_COMPLETE_EVENT_LEN 3
#define HCI_CMD_VS_COMPLETE_EVENT_LEN 2
#define HCI_CMD_STATUS_EVENT_LEN 4
#define HCI_PHY_UPDATE_COMPLETE_EVENT_LEN 6
#define HCI_CMD_COMPLETE_EVENT_LEN 3
#define HCI_CMD_VS_COMPLETE_EVENT_LEN 2
#define HCI_CMD_STATUS_EVENT_LEN 4
#define HCI_PHY_UPDATE_COMPLETE_EVENT_LEN 6
static void HTA_init(void);
static void HTA_main(UArg a0, UArg a1);
static void HTA_handle_gap_event(ICall_HciExtEvt *message);
static void HTA_handle_att_event(gattMsgEvent_t *message);
static void HTA_handle_ble_event(ICall_HciExtEvt *message);
static void send_command_complete_event(uint8 eventCode, uint16 opcode, uint8 numParam, uint8 *param);
static void send_command_status_event(uint8_t eventCode, uint16_t status, uint16_t opcode);
static void send_ble_complete_event(uint8 eventLen, uint8 *pEvent);
extern void AssertHandler(uint8 assertCause, uint8 assertSubCause);
// Task configuration
#define HTA_TASK_PRIORITY 1
#define HTA_TASK_STACK_SIZE 644
#define HTA_TASK_STACK_SIZE 512
Task_Struct hta_task;
Char hta_task_stack[HTA_TASK_STACK_SIZE];
/*********************************************************************
* GLOBAL VARIABLES
*/
// Display Interface
Display_Handle dispHandle = NULL;
/*********************************************************************
* LOCAL VARIABLES
*/
// Entity ID globally used to check for source and/or destination of messages
static ICall_EntityID selfEntity;
// Semaphore globally used to post events to the application thread
static ICall_Semaphore sem;
// Task configuration
Task_Struct htaTask;
Char htaTaskStack[HTA_TASK_STACK_SIZE];
#if !defined ( GATT_DB_OFF_CHIP )
static uint8 deviceName[GAP_DEVICE_NAME_LEN] = { 0 };
static uint16 appearance = 17;
#endif
// Stack build revision
ICall_BuildRevision buildRev;
/*********************************************************************
* LOCAL FUNCTIONS
*/
static void HostTestApp_init(void);
static void HostTestApp_taskFxn(UArg a0, UArg a1);
static void HostTestApp_processGapEvent(ICall_HciExtEvt *pMsg);
static void HostTestApp_processBLEEvent(ICall_HciExtEvt *pMsg);
static void sendCommandCompleteEvent(uint8 eventCode, uint16 opcode,
uint8 numParam, uint8 *param);
static void sendCommandStatusEvent(uint8_t eventCode, uint16_t status,
uint16_t opcode);
static void sendBLECompleteEvent(uint8 eventLen, uint8 *pEvent);
/*********************************************************************
* EXTERN FUNCTIONS
*/
extern void AssertHandler(uint8 assertCause, uint8 assertSubcause);
/*********************************************************************
* PUBLIC FUNCTIONS
*/
/*********************************************************************
/*
* @fn HostTestApp_createTask
*
* @brief Task creation function for the Host Test App.
@@ -168,21 +134,30 @@ extern void AssertHandler(uint8 assertCause, uint8 assertSubcause);
*
* @return none
*/
void HostTestApp_createTask(void)
{
Task_Params taskParams;
void HostTestApp_createTask(void) {
/* main task */
Task_Params task_main_parameter;
Task_Params_init(&task_main_parameter);
task_main_parameter.stack = hta_task_stack;
task_main_parameter.stackSize = HTA_TASK_STACK_SIZE;
task_main_parameter.priority = 1;
// Configure task
Task_Params_init(&taskParams);
taskParams.stack = htaTaskStack;
taskParams.stackSize = HTA_TASK_STACK_SIZE;
taskParams.priority = HTA_TASK_PRIORITY;
Task_construct(&htaTask, HostTestApp_taskFxn, &taskParams, NULL);
Task_construct(&hta_task, HTA_main, &task_main_parameter, NULL);
}
/*********************************************************************
* @fn HostTestApp_init
// Entity ID globally used to check for source and/or destination of messages
static ICall_EntityID self;
// Semaphore globally used to post events to the application thread
extern ICall_Semaphore semaphore;
extern uint16_t event_flags;
// Stack build revision
ICall_BuildRevision build_reversion;
/*
* @fn HTA_init
*
* @brief Called during initialization and contains application
* specific initialization (ie. hardware initialization/setup,
@@ -193,118 +168,30 @@ void HostTestApp_createTask(void)
*
* @return none
*/
static void HostTestApp_init(void)
{
// Register the current thread as an ICall dispatcher application
// so that the application can send and receive messages.
ICall_registerApp(&selfEntity, &sem);
static void HTA_init(void) {
// Register the current thread as an ICall dispatcher application
// so that the application can send and receive messages.
ICall_registerApp(&self, &semaphore);
#if defined( USE_FPGA )
// configure RF Core SMI Data Link
IOCPortConfigureSet(IOID_12, IOC_PORT_RFC_GPO0, IOC_STD_OUTPUT);
IOCPortConfigureSet(IOID_11, IOC_PORT_RFC_GPI0, IOC_STD_INPUT);
// Initialize GATT Client
VOID GATT_InitClient();
// configure RF Core SMI Command Link
IOCPortConfigureSet(IOID_10, IOC_IOCFG0_PORT_ID_RFC_SMI_CL_OUT, IOC_STD_OUTPUT);
IOCPortConfigureSet(IOID_9, IOC_IOCFG0_PORT_ID_RFC_SMI_CL_IN, IOC_STD_INPUT);
// Register to receive incoming ATT Indications or Notifications of attribute values.
GATT_RegisterForInd(self);
// configure RF Core tracer IO
IOCPortConfigureSet(IOID_8, IOC_PORT_RFC_TRC, IOC_STD_OUTPUT);
#else // !USE_FPGA
#if defined( DEBUG_SW_TRACE )
// configure RF Core tracer IO
IOCPortConfigureSet(IOID_8, IOC_PORT_RFC_TRC, IOC_STD_OUTPUT | IOC_CURRENT_4MA | IOC_SLEW_ENABLE);
#endif // DEBUG_SW_TRACE
#endif // USE_FPGA
// Register for GATT local events and ATT Responses pending for transmission.
GATT_RegisterForMsgs(self);
// Set device's Sleep Clock Accuracy
//HCI_EXT_SetSCACmd(40);
#if defined( USE_RCOSC )
RCOSC_enableCalibration();
#endif // USE_RCOSC
dispHandle = Display_open(Display_Type_LCD, NULL);
// Register for unprocessed HCI/Host event messages
GAP_RegisterForMsgs(selfEntity);
// Initialize GATT Client
VOID GATT_InitClient();
// Get build revision
VOID Util_buildRevision(&buildRev);
#if !defined ( GATT_DB_OFF_CHIP )
#if defined ( GATT_QUAL )
VOID GATTQual_AddService( GATT_ALL_SERVICES ); // Includes GAP and GATT Services
#else
// Add our services to GATT Server
VOID GGS_AddService( GATT_ALL_SERVICES );
VOID GATTServApp_AddService( GATT_ALL_SERVICES );
#if defined ( GATT_TEST )
VOID GATTTest_AddService( GATT_ALL_SERVICES );
#endif
#endif
GGS_AddService(GATT_ALL_SERVICES);
GATTServApp_AddService(GATT_ALL_SERVICES);
// Set device name
if ((buildRev.hostInfo & CENTRAL_CFG) && (buildRev.hostInfo & PERIPHERAL_CFG))
{
memcpy(deviceName, "TI BLE All", 10);
}
else if (buildRev.hostInfo & CENTRAL_CFG)
{
memcpy(deviceName, "TI BLE Central", 14);
}
else if (buildRev.hostInfo & PERIPHERAL_CFG)
{
memcpy(deviceName, "TI BLE Peripheral", 17);
}
else
{
memcpy(deviceName, "TI BLE Unknown", 14);
}
VOID GGS_SetParameter(GGS_DEVICE_NAME_ATT, strlen((char *)deviceName), deviceName);
VOID GGS_SetParameter(GGS_APPEARANCE_ATT, sizeof(uint16), (void*)&appearance);
#endif // GATT_DB_OFF_CHIP
Display_print0(dispHandle, 0, 0, "TI BLEv2.0");
Display_print0(dispHandle, 1, 0, "HostTestApp");
// Display Host build configuration
if ((buildRev.hostInfo & CENTRAL_CFG) && (buildRev.hostInfo & PERIPHERAL_CFG))
{
Display_print0(dispHandle, 2, 0, "All");
}
else if ((buildRev.hostInfo & CENTRAL_CFG) &&
(buildRev.hostInfo & BROADCASTER_CFG))
{
Display_print0(dispHandle, 2, 0, "Cent+Bcast");
}
else if ((buildRev.hostInfo & PERIPHERAL_CFG) &&
(buildRev.hostInfo & OBSERVER_CFG))
{
Display_print0(dispHandle, 2, 0, "Peri+Observ");
}
else if (buildRev.hostInfo & CENTRAL_CFG)
{
Display_print0(dispHandle, 2, 0, "Central");
}
else if (buildRev.hostInfo & PERIPHERAL_CFG)
{
Display_print0(dispHandle, 2, 0, "Peripheral");
}
else
{
Display_print1(dispHandle, 2, 0, "Unknown build cfg %d", buildRev.hostInfo);
}
// Register for unprocessed HCI/Host event messages
GAP_RegisterForMsgs(self);
}
/*********************************************************************
* @fn HostTestApp_taskFxn
/*
* @fn HTA_main
*
* @brief Application task entry point for the Host Test App.
*
@@ -312,365 +199,340 @@ static void HostTestApp_init(void)
*
* @return none
*/
static void HostTestApp_taskFxn(UArg a0, UArg a1)
{
// Initialize application
HostTestApp_init();
static void HTA_main(UArg a0, UArg a1) {
// Initialize application
HTA_init();
HTA_util_init();
HTA_main_init();
// Application main loop
for (;;)
{
// Waits for a signal to the semaphore associated with the calling thread.
// Note that the semaphore associated with a thread is signaled when a
// message is queued to the message receive queue of the thread or when
// ICall_signal() function is called onto the semaphore.
ICall_Errno errno = ICall_wait(ICALL_TIMEOUT_FOREVER);
// Application main loop
for (;;) {
// Waits for a signal to the semaphore associated with the calling thread.
// Note that the semaphore associated with a thread is signaled when a
// message is queued to the message receive queue of the thread or when
// ICall_signal() function is called onto the semaphore.
ICall_Errno errno = ICall_wait(ICALL_TIMEOUT_FOREVER);
if (errno == ICALL_ERRNO_SUCCESS)
{
ICall_EntityID dest;
ICall_ServiceEnum src;
ICall_HciExtEvt *pMsg = NULL;
if (errno == ICALL_ERRNO_SUCCESS) {
ICall_EntityID dest;
ICall_ServiceEnum src;
ICall_HciExtEvt * message = NULL;
if (ICall_fetchServiceMsg(&src, &dest,
(void **)&pMsg) == ICALL_ERRNO_SUCCESS)
{
bool dealloc = true;
if (ICall_fetchServiceMsg(&src, &dest, (void **)&message) == ICALL_ERRNO_SUCCESS) {
bool dealloc = true;
if ((src == ICALL_SERVICE_CLASS_BLE) && (dest == selfEntity))
{
// Process incoming messages
switch (pMsg->hdr.event)
{
case HCI_GAP_EVENT_EVENT:
HostTestApp_processGapEvent(pMsg);
break;
if ((src == ICALL_SERVICE_CLASS_BLE) && (dest == self)) {
// Process incoming messages
switch (message->hdr.event) {
case HCI_GAP_EVENT_EVENT:
HTA_handle_gap_event(message);
break;
default:
break;
}
case GATT_MSG_EVENT:
HTA_handle_att_event((gattMsgEvent_t *)message);
break;
case GAP_MSG_EVENT:
break;
}
}
if (dealloc && message) {
ICall_freeMsg(message);
}
}
}
if (dealloc == true)
{
ICall_freeMsg(pMsg);
if (event_flags > 0) {
HTA_event_call();
}
}
}
}
}
/*********************************************************************
* @fn HostTestApp_processGapEvent
/*
* @fn HTA_handle_gap_event
*
* @brief Process an incoming GAP Event.
*
* @param pMsg - message to process
* @param message - message to process
*
* @return none
*/
static void HostTestApp_processGapEvent(ICall_HciExtEvt *pMsg)
{
switch(pMsg->hdr.status)
{
case HCI_COMMAND_COMPLETE_EVENT_CODE:
{
hciEvt_CmdComplete_t *pkt = (hciEvt_CmdComplete_t *)pMsg;
static void HTA_handle_gap_event(ICall_HciExtEvt *message) {
switch (message->hdr.status) {
case HCI_COMMAND_COMPLETE_EVENT_CODE: {
hciEvt_CmdComplete_t *pkt = (hciEvt_CmdComplete_t *)message;
if (lastAppOpcodeSent == pkt->cmdOpcode)
{
// app processes this as it was embedded msg to stack
if (lastAppOpcodeSent == pkt->cmdOpcode) {
// application processes this as it was embedded message to stack
// Reset last opcode sent
lastAppOpcodeSent = 0xFFFF;
// Reset last opcode sent
lastAppOpcodeSent = 0xFFFF;
} else {
osal_msg_hdr_t *msgHdr;
uint8 len;
msgHdr = (osal_msg_hdr_t *)message;
msgHdr--; // Backup to the message header
len = (uint8)(msgHdr->len - sizeof(hciEvt_CmdComplete_t));
send_command_complete_event(HCI_COMMAND_COMPLETE_EVENT_CODE, pkt->cmdOpcode, len, pkt->pReturnParam);
}
else
{
osal_msg_hdr_t *msgHdr;
uint8 len;
msgHdr = (osal_msg_hdr_t *)pMsg;
msgHdr--; // Backup to the msg header
len = (uint8)(msgHdr->len - sizeof ( hciEvt_CmdComplete_t ));
sendCommandCompleteEvent(HCI_COMMAND_COMPLETE_EVENT_CODE,
pkt->cmdOpcode, len, pkt->pReturnParam);
}
}
break;
break;
}
case HCI_DISCONNECTION_COMPLETE_EVENT_CODE:
break;
break;
case HCI_COMMAND_STATUS_EVENT_CODE:
{
hciEvt_CommandStatus_t *pkt = (hciEvt_CommandStatus_t *)pMsg;
case HCI_COMMAND_STATUS_EVENT_CODE: {
hciEvt_CommandStatus_t *pkt = (hciEvt_CommandStatus_t *)message;
if (lastAppOpcodeSent == pkt->cmdOpcode)
{
// app processes this as it was embedded msg to stack
if (lastAppOpcodeSent == pkt->cmdOpcode) {
// app processes this as it was embedded msg to stack
// Reset last opcode sent
lastAppOpcodeSent = 0xFFFF;
// Reset last opcode sent
lastAppOpcodeSent = 0xFFFF;
} else if (pkt->cmdOpcode == HCI_LE_SET_PHY) {
send_command_status_event(HCI_COMMAND_STATUS_EVENT_CODE, pkt->cmdStatus, pkt->cmdOpcode);
}
else if (pkt->cmdOpcode == HCI_LE_SET_PHY)
{
sendCommandStatusEvent(HCI_COMMAND_STATUS_EVENT_CODE, pkt->cmdStatus,
pkt->cmdOpcode);
break;
}
case HCI_LE_EVENT_CODE: {
HTA_handle_ble_event(message);
break;
}
case HCI_BLE_HARDWARE_ERROR_EVENT_CODE: {
AssertHandler(HAL_ASSERT_CAUSE_HARDWARE_ERROR, 0);
break;
}
case HCI_VE_EVENT_CODE: {
hciEvt_VSCmdComplete_t *pkt = (hciEvt_VSCmdComplete_t *)message;
if (lastAppOpcodeSent == pkt->cmdOpcode) {
// app processes this as it was embedded msg to stack
// Reset last opcode sent
lastAppOpcodeSent = 0xFFFF;
} else {
send_command_complete_event(HCI_VE_EVENT_CODE, pkt->cmdOpcode, pkt->length, pkt->pEventParam);
}
}
break;
case HCI_LE_EVENT_CODE:
{
HostTestApp_processBLEEvent(pMsg);
}
break;
case HCI_BLE_HARDWARE_ERROR_EVENT_CODE:
{
AssertHandler(HAL_ASSERT_CAUSE_HARDWARE_ERROR,0);
}
break;
case HCI_VE_EVENT_CODE:
{
hciEvt_VSCmdComplete_t *pkt = (hciEvt_VSCmdComplete_t *)pMsg;
if (lastAppOpcodeSent == pkt->cmdOpcode)
{
// app processes this as it was embedded msg to stack
// Reset last opcode sent
lastAppOpcodeSent = 0xFFFF;
}
else
{
sendCommandCompleteEvent(HCI_VE_EVENT_CODE, pkt->cmdOpcode,
pkt->length, pkt->pEventParam);
}
}
break;
default:
break;
}
break;
}
}
}
/*********************************************************************
* @fn HostTestApp_processBLEEvent
static void HTA_handle_att_event(gattMsgEvent_t *message) {
uint8_t method = message->method;
if (message->hdr.status == blePending) {
// pass
} else if ((method == ATT_READ_RSP) || (method == ATT_ERROR_RSP && message->msg.errorRsp.reqOpcode == ATT_READ_REQ)) {
// pass
} else if ((method == ATT_WRITE_RSP) || (method == ATT_ERROR_RSP && message->msg.errorRsp.reqOpcode == ATT_WRITE_REQ)) {
// pass
} else if (method == ATT_HANDLE_VALUE_NOTI) {
#ifdef HTA_PIN_RS
if (!PIN_getInputValue(HTA_PIN_RS)) {
#endif
attHandleValueNoti_t *att_notify = (attHandleValueNoti_t *)(&message->msg);
HTA_main_handle_notify(att_notify->len, att_notify->pValue);
#ifdef HTA_PIN_RS
}
#endif
}
// Free message. Needed only for ATT Protocol messages
GATT_bm_free(&message->msg, message->method);
}
/*
* @fn HTA_handle_ble_event
*
* @brief Process an incoming BLE Event.
* @param pMsg - message to process
* @param message - message to process
*
* @return None.
*/
static void HostTestApp_processBLEEvent(ICall_HciExtEvt *pMsg)
{
hciEvt_BLEPhyUpdateComplete_t *pEvt = (hciEvt_BLEPhyUpdateComplete_t *)pMsg;
uint8 event[HCI_PHY_UPDATE_COMPLETE_EVENT_LEN];
uint8 eventLen;
static void HTA_handle_ble_event(ICall_HciExtEvt *message) {
hciEvt_BLEPhyUpdateComplete_t *pEvt = (hciEvt_BLEPhyUpdateComplete_t *)message;
switch (pEvt->BLEEventCode)
{
case HCI_BLE_PHY_UPDATE_COMPLETE_EVENT:
{
event[0] = HCI_BLE_PHY_UPDATE_COMPLETE_EVENT; // event code
event[1] = pEvt->status; // status
event[2] = LO_UINT16(pEvt->connHandle); // connection handle (LSB)
event[3] = HI_UINT16(pEvt->connHandle); // connection handle (MSB)
event[4] = pEvt->txPhy; // TX PHY
event[5] = pEvt->rxPhy; // RX PHY
uint8 event[HCI_PHY_UPDATE_COMPLETE_EVENT_LEN];
uint8 eventLen = 0;
switch (pEvt->BLEEventCode) {
case HCI_BLE_PHY_UPDATE_COMPLETE_EVENT: {
event[0] = HCI_BLE_PHY_UPDATE_COMPLETE_EVENT; // event code
event[1] = pEvt->status; // status
event[2] = LO_UINT16(pEvt->connHandle); // connection handle (LSB)
event[3] = HI_UINT16(pEvt->connHandle); // connection handle (MSB)
event[4] = pEvt->txPhy; // TX PHY
event[5] = pEvt->rxPhy; // RX PHY
eventLen = HCI_PHY_UPDATE_COMPLETE_EVENT_LEN;
}
break;
break;
}
}
default:
eventLen = 0;
break;
}
if (eventLen > 0)
{
// Send BLE Complete Event
sendBLECompleteEvent(eventLen, event);
}
if (eventLen) {
// Send BLE Complete Event
send_ble_complete_event(eventLen, event);
}
}
//*****************************************************************************
// the function prototypes
/*******************************************************************************
/*
* This generic function sends a Command Complete or a Vendor Specific Command
* Complete Event to the Host.
*
*/
static void sendCommandCompleteEvent(uint8_t eventCode, uint16_t opcode,
uint8_t numParam, uint8_t *param)
{
npiPkt_t *msg;
uint8_t totalLength;
uint8_t txLen = 0; // Length to transmit
static void send_command_complete_event(uint8_t eventCode, uint16_t opcode, uint8_t numParam, uint8_t *param) {
npiPkt_t *msg;
uint8_t totalLength;
uint8_t txLen = 0; // Length to transmit
// The initial length will be:
// OSAL message header(4) - not part of packet sent to HCI Host!
// Minimum Event Data: Packet Type(1) + Event Code(1) + Length(1)
// Return Parameters (0..N)
totalLength = sizeof(npiPkt_t) + HCI_EVENT_MIN_LENGTH + numParam;
// The initial length will be:
// OSAL message header(4) - not part of packet sent to HCI Host!
// Minimum Event Data: Packet Type(1) + Event Code(1) + Length(1)
// Return Parameters (0..N)
totalLength = sizeof(npiPkt_t) + HCI_EVENT_MIN_LENGTH + numParam;
// adjust the size of the event packet based on event code
// Note: If not a vendor specific event, then the event includes:
// Command Complete Data: Number of HCI Commands Allowed(1) + Command Opcode(2)
// Note: If a vendor specific event, then the event includes:
// Vendor Specific Command Complete Data: Vendor Specific Event Opcode(2)
totalLength += ( (eventCode != HCI_VE_EVENT_CODE) ?
HCI_CMD_COMPLETE_EVENT_LEN :
HCI_CMD_VS_COMPLETE_EVENT_LEN );
// adjust the size of the event packet based on event code
// Note: If not a vendor specific event, then the event includes:
// Command Complete Data: Number of HCI Commands Allowed(1) + Command Opcode(2)
// Note: If a vendor specific event, then the event includes:
// Vendor Specific Command Complete Data: Vendor Specific Event Opcode(2)
totalLength += ((eventCode != HCI_VE_EVENT_CODE) ? HCI_CMD_COMPLETE_EVENT_LEN : HCI_CMD_VS_COMPLETE_EVENT_LEN);
// allocate memory for OSAL hdr + packet
msg = (npiPkt_t *)ICall_allocMsg(totalLength);
if (msg)
{
// OSAL message event, status, and pointer to packet
msg->hdr.event = HCI_EVENT_PACKET;
msg->hdr.status = 0xFF;
msg->pData = (uint8*)(msg+1);
// allocate memory for OSAL hdr + packet
msg = (npiPkt_t *)ICall_allocMsg(totalLength);
// fill in Command Complete Event data
msg->pData[0] = HCI_EVENT_PACKET;
msg->pData[1] = eventCode;
if (msg) {
// OSAL message event, status, and pointer to packet
msg->hdr.event = HCI_EVENT_PACKET;
msg->hdr.status = 0xFF;
msg->pData = (uint8 *)(msg + 1);
txLen += 2;
// fill in Command Complete Event data
msg->pData[0] = HCI_EVENT_PACKET;
msg->pData[1] = eventCode;
// check if this isn't a vendor specific event
if ( eventCode != HCI_VE_EVENT_CODE )
{
msg->pData[2] = numParam + HCI_CMD_COMPLETE_EVENT_LEN;
msg->pData[3] = 1;// hciCtrlCmdToken; // event parameter 1
msg->pData[4] = LO_UINT16( opcode ); // event parameter 2
msg->pData[5] = HI_UINT16( opcode ); // event parameter 2
txLen += 2;
txLen += 4;
// check if this isn't a vendor specific event
if (eventCode != HCI_VE_EVENT_CODE) {
msg->pData[2] = numParam + HCI_CMD_COMPLETE_EVENT_LEN;
msg->pData[3] = 1; // hciCtrlCmdToken; // event parameter 1
msg->pData[4] = LO_UINT16(opcode); // event parameter 2
msg->pData[5] = HI_UINT16(opcode); // event parameter 2
// remaining event parameters
(void)memcpy(&msg->pData[6], param, numParam);
txLen += 4;
txLen += numParam;
// remaining event parameters
(void)memcpy(&msg->pData[6], param, numParam);
txLen += numParam;
} else { // it is a vendor specific event
// less one byte as number of complete packets not used in vendor specific event
msg->pData[2] = numParam + HCI_CMD_VS_COMPLETE_EVENT_LEN;
msg->pData[3] = param[0]; // event parameter 0: event opcode LSB
msg->pData[4] = param[1]; // event parameter 1: event opcode MSB
msg->pData[5] = param[2]; // event parameter 2: status
msg->pData[6] = LO_UINT16(opcode); // event parameter 3: command opcode LSB
msg->pData[7] = HI_UINT16(opcode); // event parameter 3: command opcode MSB
txLen += 6;
// remaining event parameters
// Note: The event opcode and status were already placed in the msg packet.
(void)memcpy(&msg->pData[8], &param[3], numParam - HCI_EVENT_MIN_LENGTH);
txLen += (numParam - HCI_EVENT_MIN_LENGTH);
}
msg->pktLen = txLen;
NPITask_sendToHost((uint8_t *)msg);
}
else // it is a vendor specific event
{
// less one byte as number of complete packets not used in vendor specific event
msg->pData[2] = numParam + HCI_CMD_VS_COMPLETE_EVENT_LEN;
msg->pData[3] = param[0]; // event parameter 0: event opcode LSB
msg->pData[4] = param[1]; // event parameter 1: event opcode MSB
msg->pData[5] = param[2]; // event parameter 2: status
msg->pData[6] = LO_UINT16( opcode ); // event parameter 3: command opcode LSB
msg->pData[7] = HI_UINT16( opcode ); // event parameter 3: command opcode MSB
txLen += 6;
// remaining event parameters
// Note: The event opcode and status were already placed in the msg packet.
(void)memcpy(&msg->pData[8], &param[3], numParam-HCI_EVENT_MIN_LENGTH);
txLen += (numParam-HCI_EVENT_MIN_LENGTH);
}
msg->pktLen = txLen;
NPITask_sendToHost((uint8_t *)msg);
}
}
/*******************************************************************************
/*
* This generic function sends a Command Complete or a Vendor Specific Command
* Complete Event to the Host.
*
*/
static void sendCommandStatusEvent(uint8_t eventCode, uint16_t status,
uint16_t opcode)
{
npiPkt_t *msg;
uint8_t totalLength;
static void send_command_status_event(uint8_t eventCode, uint16_t status, uint16_t opcode) {
npiPkt_t *msg;
uint8_t totalLength;
// The initial length will be:
// OSAL message header(4) - not part of packet sent to HCI Host!
// Minimum Event Data: Packet Type(1) + Event Code(1) + Length(1)
// Command Status Event Data: Status (1) + Num HCI Cmd Pkt (1) + Cmd Opcode (2)
totalLength = sizeof(npiPkt_t) +
HCI_EVENT_MIN_LENGTH +
HCI_CMD_STATUS_EVENT_LEN;
// The initial length will be:
// OSAL message header(4) - not part of packet sent to HCI Host!
// Minimum Event Data: Packet Type(1) + Event Code(1) + Length(1)
// Command Status Event Data: Status (1) + Num HCI Cmd Pkt (1) + Cmd Opcode (2)
totalLength = sizeof(npiPkt_t) + HCI_EVENT_MIN_LENGTH + HCI_CMD_STATUS_EVENT_LEN;
// allocate memory for OSAL hdr + packet
msg = (npiPkt_t *)ICall_allocMsg(totalLength);
if (msg)
{
// OSAL message event, status, and pointer to packet
msg->hdr.event = HCI_EVENT_PACKET;
msg->hdr.status = 0xFF;
// allocate memory for OSAL hdr + packet
msg = (npiPkt_t *)ICall_allocMsg(totalLength);
if (msg) {
// OSAL message event, status, and pointer to packet
msg->hdr.event = HCI_EVENT_PACKET;
msg->hdr.status = 0xFF;
// fill in length and data pointer
msg->pktLen = HCI_EVENT_MIN_LENGTH + HCI_CMD_STATUS_EVENT_LEN;
msg->pData = (uint8*)(msg+1);
// fill in length and data pointer
msg->pktLen = HCI_EVENT_MIN_LENGTH + HCI_CMD_STATUS_EVENT_LEN;
msg->pData = (uint8 *)(msg + 1);
// fill in Command Complete Event data
msg->pData[0] = HCI_EVENT_PACKET;
msg->pData[1] = eventCode;
msg->pData[2] = HCI_CMD_STATUS_EVENT_LEN;
msg->pData[3] = status;
msg->pData[4] = 1; // number of HCI command packets
msg->pData[5] = LO_UINT16(opcode); // opcode (LSB)
msg->pData[6] = HI_UINT16(opcode); // opcode (MSB)
// fill in Command Complete Event data
msg->pData[0] = HCI_EVENT_PACKET;
msg->pData[1] = eventCode;
msg->pData[2] = HCI_CMD_STATUS_EVENT_LEN;
msg->pData[3] = status;
msg->pData[4] = 1; // number of HCI command packets
msg->pData[5] = LO_UINT16(opcode); // opcode (LSB)
msg->pData[6] = HI_UINT16(opcode); // opcode (MSB)
NPITask_sendToHost((uint8_t *)msg);
}
}
/*******************************************************************************
* This is a generic function used to send BLE Complete Event to the
* Host processor.
*
*/
static void sendBLECompleteEvent(uint8 eventLen, uint8 *pEvent)
{
npiPkt_t *msg;
uint8_t totalLength;
// The initial length will be:
// OSAL message header(4) - not part of packet sent to HCI Host!
// Minimum Event Data: Packet Type(1) + Event Code(1) + Length(1)
// Event Data: eventLen
totalLength = sizeof(npiPkt_t) + HCI_EVENT_MIN_LENGTH + eventLen;
// allocate memory for OSAL hdr + packet
msg = (npiPkt_t *)ICall_allocMsg(totalLength);
if (msg)
{
// OSAL message event, status, and pointer to packet
msg->hdr.event = HCI_EVENT_PACKET;
msg->hdr.status = 0xFF;
// fill in length and data pointer
msg->pktLen = HCI_EVENT_MIN_LENGTH + eventLen;
msg->pData = (uint8*)(msg+1);
// fill in BLE Complete Event data
msg->pData[0] = HCI_EVENT_PACKET;
msg->pData[1] = HCI_LE_EVENT_CODE;
msg->pData[2] = eventLen;
// populate event data
if (eventLen > 0)
{
memcpy(&msg->pData[3], pEvent, eventLen);
NPITask_sendToHost((uint8_t *)msg);
}
NPITask_sendToHost((uint8_t *)msg);
}
}
/*********************************************************************
*********************************************************************/
/*
* This is a generic function used to send BLE Complete Event to the Host processor.
*/
static void send_ble_complete_event(uint8 eventLen, uint8 *pEvent) {
npiPkt_t *msg;
uint8_t totalLength;
// The initial length will be:
// OSAL message header(4) - not part of packet sent to HCI Host!
// Minimum Event Data: Packet Type(1) + Event Code(1) + Length(1)
// Event Data: eventLen
totalLength = sizeof(npiPkt_t) + HCI_EVENT_MIN_LENGTH + eventLen;
// allocate memory for OSAL hdr + packet
msg = (npiPkt_t *)ICall_allocMsg(totalLength);
if (msg) {
// OSAL message event, status, and pointer to packet
msg->hdr.event = HCI_EVENT_PACKET;
msg->hdr.status = 0xFF;
// fill in length and data pointer
msg->pktLen = HCI_EVENT_MIN_LENGTH + eventLen;
msg->pData = (uint8 *)(msg + 1);
// fill in BLE Complete Event data
msg->pData[0] = HCI_EVENT_PACKET;
msg->pData[1] = HCI_LE_EVENT_CODE;
msg->pData[2] = eventLen;
// populate event data
if (eventLen > 0) {
memcpy(&msg->pData[3], pEvent, eventLen);
}
NPITask_sendToHost((uint8_t *)msg);
}
}
@@ -9,7 +9,7 @@
Target Device: CC2650, CC2640
******************************************************************************
Copyright (c) 2013-2018, Texas Instruments Incorporated
All rights reserved.
@@ -49,37 +49,16 @@
#define HOSTESTAPP_H
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
/*********************************************************************
* INCLUDES
*/
/*********************************************************************
* CONSTANTS
*/
/*********************************************************************
* MACROS
*/
/*********************************************************************
* FUNCTIONS
*/
/*
* Task creation function for the Host Test App.
*/
extern void HostTestApp_createTask(void);
/*********************************************************************
*********************************************************************/
#ifdef __cplusplus
}
#endif
#endif /* HOSTESTAPP_H */
#endif
@@ -8,7 +8,7 @@
Target Device: CC2650, CC2640
******************************************************************************
Copyright (c) 2013-2018, Texas Instruments Incorporated
All rights reserved.
@@ -44,26 +44,29 @@
Release Date: 2018-04-02 18:03:35
*****************************************************************************/
/*******************************************************************************
* INCLUDES
*/
#include <xdc/runtime/Error.h>
#include <ti/drivers/Power.h>
#include <ti/drivers/power/PowerCC26XX.h>
#include <ti/sysbios/BIOS.h>
#include "icall.h"
#include "hal_assert.h"
#include "board.h"
#include "hal_assert.h"
#include "icall.h"
#include "inc/npi_task.h"
#include "host_test_app.h"
/* Header files required to enable instruction fetch cache */
#include <inc/hw_memmap.h>
#include <driverlib/vims.h>
#include <inc/hw_memmap.h>
#ifndef USE_DEFAULT_USER_CFG
#include "ble_user_config.h"
@@ -71,70 +74,12 @@
// BLE user defined configuration
bleUserCfg_t user0Cfg = BLE_USER_CFG;
#endif // USE_DEFAULT_USER_CFG
#endif // USE_DEFAULT_USER_CFG
#include <ti/mw/display/Display.h>
#ifdef USE_FPGA
#include <inc/hw_prcm.h>
#endif // USE_FPGA
/*******************************************************************************
* MACROS
*/
/*******************************************************************************
* CONSTANTS
*/
#if defined( USE_FPGA )
#define RFC_MODE_BLE PRCM_RFCMODESEL_CURR_MODE1
#define RFC_MODE_ANT PRCM_RFCMODESEL_CURR_MODE4
#define RFC_MODE_EVERYTHING_BUT_ANT PRCM_RFCMODESEL_CURR_MODE5
#define RFC_MODE_EVERYTHING PRCM_RFCMODESEL_CURR_MODE6
//
#define SET_RFC_BLE_MODE(mode) HWREG( PRCM_BASE + PRCM_O_RFCMODESEL ) = (mode)
#endif // USE_FPGA
/*******************************************************************************
* TYPEDEFS
*/
/*******************************************************************************
* LOCAL VARIABLES
*/
/*******************************************************************************
* GLOBAL VARIABLES
*/
#ifdef CC1350_LAUNCHXL
#ifdef POWER_SAVING
// Power Notify Object for wake-up callbacks
Power_NotifyObj rFSwitchPowerNotifyObj;
static uint8_t rFSwitchNotifyCb(uint8_t eventType, uint32_t *eventArg,
uint32_t *clientArg);
#endif //POWER_SAVING
PIN_State radCtrlState;
PIN_Config radCtrlCfg[] =
{
Board_DIO1_RFSW | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* RF SW Switch defaults to 2.4GHz path*/
Board_DIO30_SWPWR | PIN_GPIO_OUTPUT_EN | PIN_GPIO_HIGH | PIN_PUSHPULL | PIN_DRVSTR_MAX, /* Power to the RF Switch */
PIN_TERMINATE
};
PIN_Handle radCtrlHandle;
#endif //CC1350_LAUNCHXL
/*******************************************************************************
* EXTERNS
*/
extern void AssertHandler(uint8 assertCause, uint8 assertSubcause);
extern Display_Handle dispHandle;
/*******************************************************************************
/*
* @fn Main
*
* @brief Application Main
@@ -149,68 +94,38 @@ extern Display_Handle dispHandle;
*
* @return None.
*/
int main()
{
#if defined( USE_FPGA )
HWREG(PRCM_BASE + PRCM_O_PDCTL0) &= ~PRCM_PDCTL0_RFC_ON;
HWREG(PRCM_BASE + PRCM_O_PDCTL1) &= ~PRCM_PDCTL1_RFC_ON;
#endif // USE_FPGA
int main() {
/* Register Application callback to trap asserts raised in the Stack */
RegisterAssertCback(AssertHandler);
/* Register Application callback to trap asserts raised in the Stack */
RegisterAssertCback(AssertHandler);
PIN_init(BoardGpioInitTable);
PIN_init(BoardGpioInitTable);
#ifdef CC1350_LAUNCHXL
// Enable 2.4GHz Radio
radCtrlHandle = PIN_open(&radCtrlState, radCtrlCfg);
// Enable iCache prefetching
VIMSConfigure(VIMS_BASE, TRUE, TRUE);
#ifdef POWER_SAVING
Power_registerNotify(&rFSwitchPowerNotifyObj,
PowerCC26XX_ENTERING_STANDBY | PowerCC26XX_AWAKE_STANDBY,
(Power_NotifyFxn) rFSwitchNotifyCb, NULL);
#endif //POWER_SAVING
#endif //CC1350_LAUNCHXL
// Enable cache
VIMSModeSet(VIMS_BASE, VIMS_MODE_ENABLED);
#if defined( USE_FPGA )
// set RFC mode to support BLE
// Note: This must be done before the RF Core is released from reset!
SET_RFC_BLE_MODE(RFC_MODE_BLE);
#endif // USE_FPGA
/* Initialize ICall module */
ICall_init();
// Enable iCache prefetching
VIMSConfigure(VIMS_BASE, TRUE, TRUE);
/* Start tasks of external images */
ICall_createRemoteTasks();
// Enable cache
VIMSModeSet(VIMS_BASE, VIMS_MODE_ENABLED);
/* Kick off application */
HostTestApp_createTask();
#if !defined( POWER_SAVING ) || defined( USE_FPGA )
/* Set constraints for Standby, powerdown and idle mode */
// PowerCC26XX_SB_DISALLOW may be redundant
Power_setConstraint(PowerCC26XX_SB_DISALLOW);
Power_setConstraint(PowerCC26XX_IDLE_PD_DISALLOW);
#endif // POWER_SAVING | USE_FPGA
/* Kick off NPI */
NPITask_createTask(ICALL_SERVICE_CLASS_BLE);
/* Initialize ICall module */
ICall_init();
/* enable interrupts and start SYS/BIOS */
BIOS_start();
/* Start tasks of external images */
ICall_createRemoteTasks();
/* Kick off application */
HostTestApp_createTask();
/* Kick off NPI */
NPITask_createTask(ICALL_SERVICE_CLASS_BLE);
/* enable interrupts and start SYS/BIOS */
BIOS_start();
return 0;
return 0;
}
/*******************************************************************************
/*
* @fn AssertHandler
*
* @brief This is the Application's callback handler for asserts raised
@@ -246,57 +161,9 @@ int main()
*
* @return None.
*/
void AssertHandler(uint8 assertCause, uint8 assertSubcause)
{
// Open the display if the app has not already done so
if ( !dispHandle )
{
dispHandle = Display_open(Display_Type_LCD, NULL);
}
void AssertHandler(uint8 assertCause, uint8 assertSubcause) {}
Display_print0(dispHandle, 0, 0, ">>>STACK ASSERT");
// check the assert cause
switch (assertCause)
{
// This assert is raised from the BLE Stack when a malloc failure occurs.
case HAL_ASSERT_CAUSE_OUT_OF_MEMORY:
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> OUT OF MEMORY!");
break;
case HAL_ASSERT_CAUSE_INTERNAL_ERROR:
// check the subcause
if (assertSubcause == HAL_ASSERT_SUBCAUSE_FW_INERNAL_ERROR)
{
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> INTERNAL FW ERROR!");
}
else
{
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> INTERNAL ERROR!");
}
break;
// An assert originating from an ICall failure.
case HAL_ASSERT_CAUSE_ICALL_ABORT:
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> ICALL ABORT!");
HAL_ASSERT_SPINLOCK;
break;
default:
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> DEFAULT SPINLOCK!");
HAL_ASSERT_SPINLOCK;
}
return;
}
/*******************************************************************************
/*
* @fn exceptionHandler
*
* @brief Generic spinlock to trap RTOS raised errors.
@@ -311,13 +178,11 @@ void AssertHandler(uint8 assertCause, uint8 assertSubcause)
*
* @return None.
*/
void exceptionHandler( void )
{
volatile uint8 i = 1;
while(i);
void exceptionHandler(void) {
for (;;);
}
/*******************************************************************************
/*
* @fn smallErrorHook
*
* @brief Error handler to be hooked into TI-RTOS.
@@ -332,45 +197,6 @@ void exceptionHandler( void )
*
* @return None.
*/
void smallErrorHook(Error_Block *eb)
{
for (;;);
void smallErrorHook(Error_Block *eb) {
for (;;);
}
#if defined (CC1350_LAUNCHXL) && defined (POWER_SAVING)
/*******************************************************************************
* @fn rFSwitchNotifyCb
*
* @brief Power driver callback to toggle RF switch on Power state
* transitions.
*
* input parameters
*
* @param eventType - The state change.
* @param eventArg - Not used.
* @param clientArg - Not used.
*
* @return Power_NOTIFYDONE to indicate success.
*/
static uint8_t rFSwitchNotifyCb(uint8_t eventType, uint32_t *eventArg,
uint32_t *clientArg)
{
if (eventType == PowerCC26XX_ENTERING_STANDBY)
{
// Power down RF Switch
PIN_setOutputValue(radCtrlHandle, Board_DIO30_SWPWR, 0);
}
else if (eventType == PowerCC26XX_AWAKE_STANDBY)
{
// Power up RF Switch
PIN_setOutputValue(radCtrlHandle, Board_DIO30_SWPWR, 1);
}
// Notification handled successfully
return Power_NOTIFYDONE;
}
#endif //CC1350_LAUNCHXL || POWER_SAVING
/*******************************************************************************
*/
@@ -0,0 +1,179 @@
{
"name": "Elite-ZM",
"version": "1.2.30",
"match_rule": {
"local_name_pattern": "Elite-ZM.+",
"major_product_number": 0,
"minor_product_number": 2,
"major_version_number": 1,
"minor_version_number": 2
},
"constant": {
"ADC_CHANNEL_NUMBER": [
12,
13,
14,
15
],
"VOLT_MAX": 4095
},
"parameters": {
"CHANNEL": {
"description": "record channels",
"record_meta": true,
"domain": "property",
"value": [
0,
1,
2
]
},
"SAMPLE_RATE": {
"description": "data sampling rate",
"record_meta": true,
"domain": "constant",
"value": 1
},
"AMP_GAIN": {
"description": "amp gain",
"record_meta": true,
"domain": "constant",
"value": 1
},
"MODE": {
"description": "working mode",
"value": [
"I-V Curve",
"Cyclic Voltammetry",
"Function Generator",
"Z-T Curve",
"V-T Curve",
"I-T Curve",
"ADC test"
]
},
"VOLT_ORIGIN": {
"description": "Origin Voltage of Scan",
"domain": [
"VOLT_MAX"
]
},
"VOLT_FINAL": {
"description": "The last Voltage of Scan",
"domain": [
"VOLT_MAX"
],
"value": "1365 * VALUE"
},
"VOLT_STEP": {
"description": "Voltage Step",
"domain": [
5
]
},
"STEP_TIME": {
"description": "How much time between two step",
"domain": [
4
]
},
"DAC_VOLT": {
"description": "DAC output Voltage",
"domain": [
"VOLT_MAX"
]
},
"ADC_CHANNEL": {
"description": "read ADC data",
"value": [
"ANA0",
"ANA1",
"ANA2",
"ANA3"
]
}
},
"instruction": {
"start": [
{
"expression": "MODE",
"when": {
"0": "curve_iv",
"1": "curve_cv",
"2": "func_gen",
"6": "adc_test"
}
}
],
"data_format": [
"_data_format('TDC4VAF2')"
],
"curve_iv": [
"data_format",
"_notify(True)",
"curve_iv0",
"_sync(True)",
"VIS_STI"
],
"curve_iv0": {
"type": "RIS",
"parameter": {
"va": "(VOLT_ORIGIN + 1) * 0x0010",
"vb": "(VOLT_FINAL + 1) * 0x0010",
"dv": "VOLT_STEP * 0x40",
"dt": "STEP_TIME * 0x12"
},
"data": [
"1X10;2B>va;2B>vb;B>dv;B>dt"
]
},
"curve_cv": [
"data_format",
"_notify(True)",
"curve_cv0",
"_sync(True)",
"VIS_STI"
],
"curve_cv0": {
"type": "RIS",
"parameter": {
"va": "(VOLT_ORIGIN + 1) * 0x0010",
"vb": "(VOLT_FINAL + 1) * 0x0010",
"dv": "VOLT_STEP * 0x40",
"dt": "STEP_TIME * 0x12"
},
"data": [
"1X20;2B>va;2B>vb;B>dv;B>dt"
]
},
"func_gen": [
"data_format",
"func_gen0",
"VIS_STI"
],
"func_gen0": {
"type": "RIS",
"parameter": {
"v": "(DAC_VOLT + 1) * 0x0010"
},
"data": [
"X30;X30;2B>v"
]
},
"adc_test": [
"data_format",
"_notify(True)",
"adc_test0",
"_sync(True)",
"VIS_STI"
],
"adc_test0": {
"type": "RIS",
"data": [
"X90;B>ADC_CHANNEL"
]
}
}
}
@@ -0,0 +1,227 @@
#ifndef EliteADC
#define EliteADC
#include "Elite_PIN.h"
#include "EliteSPI.h"
#include "EliteNotify.h"
// Elite ADC macro
// ADC command, Elite will use these cmd to control ADC
#define CMD_CURRENT_MEASURE 0xC5
#define CMD_VOLT_MEASURE 0xD5
#define CMD_DAC_MEASURE 0xE5
#define CMD_BATTERY_MEASURE 0xF5
// controller command, these are command from control box
#define ADC_CH_CURRENT 0x00
#define ADC_CH_VOLT 0x01
#define ADC_CH_DAC 0x02
#define ADC_CH_BAT 0x03
static void ADC_write(uint8_t ADCin) {
/*
* This function can only define [15]~[8] through ADCin
* [7]~[0] should always be 0b11101011
*
* [15] : SS, 0 = no effect, 1 = start work, default 0b0
* [14]~[12] : MUX[2:0], default 0b000
* [11]~[9] : PGA[2:0], default 0b010 = FSR is ±2.048
* [8] : mode, 0 = continuous, 1 = one shot, default 0b1 (Power-down and single-shot mode )
*
* [7]~[5] : data rate, default 0b100 = 128 SPS
* [4] : Temperature? default 0b0 = ADC mode
* [3] : Pullup enable, default 0b1 = Pullup resistor enabled
* [2]~[1] : NOP, default 0b01
* [0] : reserved, default 0b1
*
*/
// spi_ADC_txbuf[0] = 0b00000101;
for(int i=0 ; i<SPI_ADC_SIZE ; i++){
spi_ADC_txbuf[i] = 0;
spi_ADC_rxbuf[i] = 0;
}
spi_ADC_txbuf[0] = ADCin;
spi_ADC_txbuf[1] = 0b11101011;
ADC_SPI(2, spi_ADC_txbuf, spi_ADC_rxbuf);
}
static void ADC_read(uint8_t *ADCdata){
for(int i=0 ; i<SPI_ADC_SIZE ; i++){
spi_ADC_txbuf[i] = 0;
spi_ADC_rxbuf[i] = 0;
}
ADC_SPI(SPI_ADC_SIZE, spi_ADC_txbuf, ADCdata);
}
static void ADCGainControl(uint8_t ADCLevel){
if(ADCLevel == 0){
// ADC gain level = 0, using 200R resister
PIN_setOutputValue(pin_handle, Turnon10K, 0);
PIN_setOutputValue(pin_handle, Turnon100R, 0);
}
else if(ADCLevel == 1){
// ADC gain level = 1, using 10K resister
PIN_setOutputValue(pin_handle, Turnon10K, 1);
PIN_setOutputValue(pin_handle, Turnon100R, 0);
}
else if(ADCLevel == 2){
// ADC gain level = 2, using 100R resister
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);
PIN_setOutputValue(pin_handle, Turnon100R, 0);
}
}
static void ADCChannelSelect(uint8_t ADCChannel){
// set ADC parameter
// 0xC1~F1 = reading AIN0~AIN3. Using FSR+-6V, resolution = 187.5uV
// 0xC5~F5 = reading AIN0~AIN3. Using FSR+-2V, resolution = 62.5 uV
switch(ADCChannel){
// AINp is AIN0; AINn is GND
// measure AIN0, which is a current measure
case ADC_CH_CURRENT :{
ADC_write(CMD_CURRENT_MEASURE);
break;
}
// AINp is AIN1; AINn is GND
// AIN1, which is a volt measure
case ADC_CH_VOLT :{
ADC_write(CMD_VOLT_MEASURE);
break;
}
// AINp is AIN2; AINn is GND
// AIN2, measure DAC voltage (Note that this is NOT DAC real output value!!)
case ADC_CH_DAC :{
ADC_write(CMD_DAC_MEASURE);
break;
}
// measure battery volt
case ADC_CH_BAT :{
ADC_write(CMD_BATTERY_MEASURE);
break;
}
default :{
break;
}
}
}
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
@@ -0,0 +1,232 @@
#ifndef ELITECCMODE
#define ELITECCMODE
static void CCModeDACControl(int32_t IUC_Measure_Difference);
static int32_t CCModeReadCurrent(CCMode *CC){
static uint8_t VoltCurrentSwitch = 0;
CCModeDACEnable = 1; // This flag will control DAC working
// set current value and ADC gain level
CCCurrent2IUC(CC);
// decode ADC value and put it into notify buffer
// Use 9-th measure value as real-measure value
// because some value in the begin are garbage
if(VoltCurrentSwitch < 9){
ReadCurrent(spi_ADC_rxbuf);
VoltCurrentSwitch ++;
}
else if(VoltCurrentSwitch == 9){
// read current
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);
}
VoltCurrentSwitch ++;
}
else if(VoltCurrentSwitch <18){
// read volt
ReadVolt(spi_ADC_rxbuf);
VoltCurrentSwitch++;
}
else if(VoltCurrentSwitch == 18){
// read volt
ReadVolt(spi_ADC_rxbuf);
CC->BatteryV = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
// if Iin connect to battery +, Vout connect to battery -
// CC->BatteryV = CC->BatteryV - (CC->value - CC_ZERO_POINT)*10/1e5; // I_set * 10R = V_Iin2GND (mA * ohm)
// if Iin connect to battery -, Vout connect to battery +
CC->BatteryV = CC->BatteryV + (CC->value - CC_ZERO_POINT)*10/1e5; // I_set * 10R = V_Iin2GND (mA * ohm)
VoltCurrentSwitch++;
}
else{
VoltCurrentSwitch = 0;
}
// /** read battery voltage **/
// // read ADC volt
// ReadVolt(spi_ADC_rxbuf);
//
// // decode ADC value and put it into notify buffer
// CC->BatteryV = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_VOLT, spi_ADC_rxbuf);
//
NotifyVolt[0] = (uint8_t) (CC->BatteryV >> 24);
NotifyVolt[1] = (uint8_t) ((CC->BatteryV & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t) ((CC->BatteryV & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t) (CC->BatteryV & 0x000000FF);
return CC->_MeasureData;
}
static int32_t CCModeVoltOut(CCMode *CC){
int32_t MeasureCurrent = 0, IUCCurrent = 0, ADCRealVolt = 0;
if(!CCModeDACEnable){
// DAC should not work now
return 0;
}
IUCCurrent = CC->_Transform2RealnA(CC);
MeasureCurrent = CC->_MeasureData;
CCModeDACControl(IUCCurrent - MeasureCurrent);
NotifyCurrent[0] = (uint8_t) (IUCCurrent >> 24);
NotifyCurrent[1] = (uint8_t) ((IUCCurrent & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((IUCCurrent & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (IUCCurrent & 0x000000FF);
NotifyImpedance[0] = (uint8_t) (MeasureCurrent >> 24);
NotifyImpedance[1] = (uint8_t) ((MeasureCurrent & 0x00FF0000) >> 16);
NotifyImpedance[2] = (uint8_t) ((MeasureCurrent & 0x0000FF00) >> 8);
NotifyImpedance[3] = (uint8_t) (MeasureCurrent & 0x000000FF);
// DACCode2Real2Notify(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
// if(IUCCurrent > 1000){
// ADCRealVolt = 2*(INSTRUCTION.VoltConstant - 25000)/10 - IUCCurrent*200/1e6;
// }
// else{
// CC->BatteryV = 2*(INSTRUCTION.VoltConstant - 25000)/10 - IUCCurrent*200/1e7;
// }
// 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);
CCModeDACEnable = 0;
return MeasureCurrent;
}
static void CCModeDACControl(int32_t IUC_Measure_Difference){
int32_t step;
if(IUC_Measure_Difference < 100 && IUC_Measure_Difference > -100){
step = (IUC_Measure_Difference > 0) ? 1:-1;
}
else if(IUC_Measure_Difference < 1000 && IUC_Measure_Difference > -1000){
step = IUC_Measure_Difference / 100;
}
else if(IUC_Measure_Difference < 10000 && IUC_Measure_Difference > -10000){
step = IUC_Measure_Difference / 1000;
}
else{
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{
INSTRUCTION.VoltConstant = (INSTRUCTION.VoltConstant + MIN_DAC_UC)/2;
}
}
else{
INSTRUCTION.VoltConstant = INSTRUCTION.VoltConstant + step;
}
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
}
// XXX : should we reset DAC output after STOP?
static void CCModeReverseCurrent(CCMode *CC){
if(CC->StandBy){
if(CT.StandByCounter == CC->StandByTime){
CC->StandBy = false;
CT.StandByCounter = 0;
}
else{
CT.StandByCounter ++;
}
}
else{
// reverse charge/discharge
if(CC->BatteryV == CC->VMax){
CC->StandBy = true;
CC->value = CC->DischargeCurrent;
}
else if(CC->BatteryV == CC->VMin){
CC->StandBy = true;
CC->value = CC->ChargeCurrent;
}
}
}
/* 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;
CC->value = INSTRUCTION.ConstantCurrent;
CurrentValue = CC->value - CC_ZERO_POINT;
/* set ADC level */
// largest current
if (CurrentValue > 10000 || CurrentValue < -10000){
CC->lv = GAIN_200R;
}
// mid range current
else if (CurrentValue > 1000 || CurrentValue < -1000){
CC->lv = GAIN_10K;
}
// least range current
else{
CC->lv = GAIN_200K;
}
}
/*********************************************************************
* @fn Transform2RealnA
*
* @brief transform an IUC into real current value in nA.
*
* @param self, which is an IUC
*
* @return an int32_t current value in nA
*/
//static int32_t _Transform2RealnA(CCMode *self){
// int32_t IUCReal;
//
// // self->value : 0 ~ 3000000 (which is -1500000 ~ 1500000 (10nA) )
// IUCReal = (self->value - CC_ZERO_POINT) * 10;
// return IUCReal;
//}
//
//static void SetMeasureCurrent(CCMode *self, int32_t current){
// self->_MeasureCurrent = current;
//}
//
//static int32_t GetMeasureCurrent(CCMode *self){
// return self->_MeasureCurrent;
//}
//static CURRENT_USER_CODE *InitCurrentUserCode(){
// CCMode *CurrentUserCode = malloc(sizeof(CCMode));
// CurrentUserCode->value = CC_ZERO_POINT;
// CurrentUserCode->lv = GAIN_AUTO;
// CurrentUserCode->Vmax = MAX_DAC_UC; // max DAC UserCode
// CurrentUserCode->Vmin = MIN_DAC_UC; // min DAC UserCode
// CurrentUserCode-> _MeasureData = 0;
// CurrentUserCode->_Transform2RealnA = &_Transform2RealnA;
// CurrentUserCode->SetMeasureData = &SetMeasureCurrent;
// CurrentUserCode->GetMeasureData = &GetMeasureCurrent;
// return CurrentUserCode;
//}
#endif
@@ -0,0 +1,245 @@
#ifndef ELITECV
#define ELITECV
static uint16_t SWVCurve(WorkMode *WorkModeData) {
static uint8_t counter;
static uint16_t outputV;
static uint16_t Volt;
static bool direction_up;
// reset origin volt at the begin
if (DACReset) {
Volt = INSTRUCTION.VoltOrigin;
outputV = INSTRUCTION.VoltOrigin;
if (INSTRUCTION.VoltOrigin < INSTRUCTION.VoltFinal)
direction_up = true;
else
direction_up = false;
counter = 1;
DACReset = false;
}
if (counter == 2 * PulseWidth)
counter = 1;
else
counter++;
// output a certain volt
outputV = Volt;
DAC_outputV(outputV);
// VoltValue = (ramp1*16 + ramp0/16) * 3.05;
// check if we reach the final volt
if ((outputV >= INSTRUCTION.VoltFinal && direction_up) || (outputV <= INSTRUCTION.VoltFinal && !direction_up)) {
PeriodicEvent = false;
DACReset = true;
}
// prepare the next output volt
if (direction_up) {
if (counter == PulseWidth)
Volt = Volt + Amplitude;
else if (counter == 2 * PulseWidth)
Volt = Volt - (Amplitude - INSTRUCTION.Step);
else
Volt = Volt;
} else {
if (counter == PulseWidth)
Volt = Volt - Amplitude;
else if (counter == 2 * PulseWidth)
Volt = Volt + (Amplitude - INSTRUCTION.Step);
else
Volt = Volt;
}
return outputV;
}
static uint16_t DPVCurve(WorkMode *WorkModeData) {
static uint8_t counter;
static uint16_t Volt1;
static uint16_t Volt2;
static uint16_t outputV;
static bool direction_up;
// reset origin volt at the begin
if (DACReset) {
if (INSTRUCTION.VoltOrigin < INSTRUCTION.VoltFinal)
direction_up = true;
else
direction_up = false;
Volt1 = INSTRUCTION.VoltOrigin;
if (direction_up)
Volt2 = INSTRUCTION.VoltOrigin + Amplitude;
else
Volt2 = INSTRUCTION.VoltOrigin - Amplitude;
counter = 1;
DACReset = false;
}
if (counter == PulsePeriod)
counter = 1;
else
counter++;
// output a certain volt
if (counter <= (PulsePeriod - PulseWidth)) {
outputV = Volt1;
DAC_outputV(Volt1);
} else {
outputV = Volt2;
DAC_outputV(Volt2);
}
// VoltValue = (ramp1*16 + ramp0/16) * 3.05;
// check if we reach the final volt
if (((outputV >= INSTRUCTION.VoltFinal) && direction_up) || ((outputV <= INSTRUCTION.VoltFinal) && !direction_up)) {
PeriodicEvent = false;
DACReset = true;
}
// check overflow/underflow and prepare for next output
if (direction_up) {
if (Volt1 + INSTRUCTION.Step < Volt1)
Volt1 = 0xffff;
else
Volt1 = Volt1 + INSTRUCTION.Step;
if (Volt2 + INSTRUCTION.Step < Volt2)
Volt2 = 0xffff;
else
Volt2 = Volt2 + INSTRUCTION.Step;
} else {
if (Volt1 - INSTRUCTION.Step > Volt1)
Volt1 = 0x0000;
else
Volt1 = Volt1 - INSTRUCTION.Step;
if (Volt2 - INSTRUCTION.Step > Volt2)
Volt2 = 0x0000;
else
Volt2 = Volt2 - INSTRUCTION.Step;
}
if (counter + 1 <= (PulsePeriod - PulseWidth)) {
return Volt1;
} else {
return Volt2;
}
}
static uint16_t CVCurve(CVMode *CV) {
static uint16_t DACOutCode;
static bool direction_up; // direction_up = true, if Vfinal > Vorigin
static bool current_direction_up; // current_direction_up = true, Vstep => positive. vice versa
// reset origin volt at the begin
if (DACReset) {
DACUserCode = CV->_VOrigin;
if (INSTRUCTION.VoltFinal > CV->_VOrigin) {
direction_up = true;
current_direction_up = true;
} else {
direction_up = false;
current_direction_up = false;
}
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
DAC_outputV(DACOutCode); // output VOLT_ORIGIN
DACReset = false;
return DACOutCode;
}
if (CT.StepTimeCounter == CV->_StepTime) {
// Decide next direction
if (direction_up) {
if (DACUserCode >= CV->_VStop) {
current_direction_up = false; // problem occurs when origin == 0000 final == ffff!!!!!!
} else if (DACUserCode <= CV->_VOrigin) {
current_direction_up = true;
if (CV->_CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
}
CV->_CycleNumber--;
}
} else {
if (DACUserCode <= CV->_VStop) {
current_direction_up = true; // problem occurs when origin == 0000 final == ffff!!!!!!
} else if (DACUserCode >= CV->_VOrigin) {
current_direction_up = false;
if (CV->_CycleNumber == 0) {
PeriodicEvent = false; // periodic event end
DACReset = true;
}
CV->_CycleNumber--;
}
}
// Next output voltage
if (direction_up) {
if (current_direction_up) {
// DACUserCode overflow ?
if (DACUserCode + CV->_Step < DACUserCode) {
DACUserCode = CV->_VStop;
}
else if (DACUserCode + CV->_Step > CV->_VStop) {
DACUserCode =CV->_VStop;
}
else {
DACUserCode = DACUserCode + CV->_Step;
}
}
else {
// DACUserCode underflow ?
if (DACUserCode - CV->_Step > DACUserCode || DACUserCode > 60000) {
DACUserCode = CV->_VOrigin;
}
// reach Vorigin ?
else if (DACUserCode - CV->_Step < CV->_VOrigin) {
DACUserCode = CV->_VOrigin;
}
else {
DACUserCode = DACUserCode - CV->_Step;
}
}
}
else {
if (current_direction_up) {
if (DACUserCode + CV->_Step < DACUserCode) {
DACUserCode = CV->_VOrigin;
}
else if (DACUserCode + CV->_Step > CV->_VOrigin) {
DACUserCode = CV->_VOrigin;
}
else {
DACUserCode = DACUserCode + CV->_Step;
}
}
else {
if (DACUserCode - CV->_Step > DACUserCode || DACUserCode > 60000) {
DACUserCode = CV->_VStop ;
}
else if (DACUserCode - CV->_Step < CV->_VStop) {
DACUserCode = CV->_VStop;
}
else {
DACUserCode = DACUserCode - CV->_Step;
}
}
}
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
DAC_outputV(DACOutCode);
}
return DACOutCode;
}
#endif
@@ -0,0 +1,65 @@
#ifndef EliteDAC
#define EliteDAC
static bool DACReset;
//#ifdef ELITE_VERSION_1_3
//#define DACOUT 0x30
//
//static void DAC_outputV(uint16_t voltLV) {
// // C = command, X = don't care, D = data
// // CCCC XXXX = command
// // DDDD DDDD = v1
// // DDDD XXXX = v2
//
// uint8_t v1, v2 = 0;
// v1 = (uint8_t) (voltLV >> 4) & 0xFF;
// v2 = (uint8_t) ((voltLV & 0x000F) << 4) & 0xF0;
//
// spi_DACtxbuf[0] = command;
// spi_DACtxbuf[1] = v1;
// spi_DACtxbuf[2] = v2;
// for (int i = 3; i < SPI_DAC_SIZE; i++) {
// spi_DACtxbuf[i] = 0;
// }
//
// DAC_SPI(SPI_DAC_SIZE, spi_DACtxbuf, spi_rxbuf);
//}
//#endif
#ifdef ELITE_VERSION_1_4
#define DACCLS 0x02
#define DACOUT 0x31
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] = DACOUT;
spi_DACtxbuf[1] = v1;
spi_DACtxbuf[2] = v2;
DAC_SPI(SPI_DAC_SIZE, spi_DACtxbuf, spi_rxbuf);
return voltLV;
}
#endif
static int32_t User2Real(uint16_t UserCode){
/* transfer usercode to real voltage value (mV) */
return (int32_t) ((UserCode - 25000)*2)/10;
}
#endif
@@ -0,0 +1,789 @@
#ifndef EliteCorrection
#define EliteCorrection
#include "EliteDAC.h"
#include "EliteADC.h"
/*
* Correction Array include all the correction coeff and offset
*
* Correction formula format is " RealValue = coeff * code + offset "
* RealValue can be RealCurrent, RealVolt, or RealResister ...
* code is the code we read from ADC buffer
*
* ADC measure Voltage
* RealVolt = Correction.ADC_volt.coeff * code + Correction.ADC_volt.offset
*
* ADC measure Current
* ADCGain: 0 => 200k, 1 => 10k, 2 => 200R
* RealCurrent = Correction.ADC_current[ADCGain].coeff * code + Correction.ADC_current[ADCGain].offset
*
* DAC output Voltage
* RealVolt = Correction.DAC2RealV.coeff * DACcode + Correction.DAC2RealV.offset
*
* Usercode to DACcode
* DACcode = Correction.Usercode2DAC.coeff * code + Correction.Usercode2DAC.offset
*
*/
#define BOARD_MERCURY
typedef struct _formula{
long long coeff;
long long offset;
}Formula;
struct _correction{
Formula ADC_volt;
Formula ADC_current[3];
Formula DAC2RealV;
Formula Usercode2DAC;
uint16_t Gain0Boundary[2];
uint16_t Gain1Boundary[4];
uint16_t Gain2Boundary[2];
} Correction =
#ifdef BOARD_CLASS_LEADER
{
.ADC_volt.coeff = (-6292889),
.ADC_volt.offset = 103042367157,
.ADC_current[0].coeff = 310073435,
.ADC_current[0].offset = -5059684947850,
.ADC_current[1].coeff = 655940088,
.ADC_current[1].offset = -10703396200801,
.ADC_current[2].coeff = 31129894,
.ADC_current[2].offset = -507980196120,
.DAC2RealV.coeff = (-18959656),
.DAC2RealV.offset = 565743281498,
.Usercode2DAC.coeff = (-10517325),
.Usercode2DAC.offset = 561574831511,
.Gain0Boundary[0] = 0x5F75,
.Gain0Boundary[1] = 0x5FB2,
.Gain1Boundary[0] = 0x5999,
.Gain1Boundary[1] = 0x6589
};
#endif
#ifdef BORAD_TRICERATOPS
{
.ADC_volt.coeff = (-6259045),
.ADC_volt.offset = 150606390230,
.ADC_current[0].coeff = 30675739,
.ADC_current[0].offset = (-736666253953),
.ADC_current[1].coeff = 749057318,
.ADC_current[1].offset = (-17984432358007),
.ADC_current[2].coeff = 31242587,
.ADC_current[2].offset = (-750184492407),
.DAC2RealV.coeff = (-18909689),
.DAC2RealV.offset = 644251481046,
.Usercode2DAC.coeff = (-10576588),
.Usercode2DAC.offset = 605113842000,
.Gain0Boundary[0] = 0x5DAA,
.Gain0Boundary[1] = 0x5DF2,
.Gain1Boundary[0] = 0x57E8,
.Gain1Boundary[1] = 0x63B1
};
#endif
#ifdef BORAD_CHAO_I
{
.ADC_volt.coeff = (-6278082),
.ADC_volt.offset = 151228681410,
.ADC_current[0].coeff = 30908391,
.ADC_current[0].offset = (-741477595514),
.ADC_current[1].coeff = 661271310,
.ADC_current[1].offset = (-15864495597969),
.ADC_current[2].coeff = 31183513,
.ADC_current[2].offset = (-748178468530),
.DAC2RealV.coeff = (-18975108),
.DAC2RealV.offset = 644442607989,
.Usercode2DAC.coeff = (-10540121),
.Usercode2DAC.offset = 603128277368,
.Gain0Boundary[0] = 0x5D96,
.Gain0Boundary[1] = 0x5DD9,
.Gain1Boundary[0] = 0x57CD,
.Gain1Boundary[1] = 0x639F
};
#endif
#ifdef BOARD_TWENTY_ONE
{
.ADC_volt.coeff = (-6258074),
.ADC_volt.offset = 152210580945,
.ADC_current[0].coeff = 30022512,
.ADC_current[0].offset = -729552647201,
.ADC_current[1].coeff = 658398533000,
.ADC_current[1].offset = -16001498741131000,
.ADC_current[2].coeff = 30908351000,
.ADC_current[2].offset = -746548614824000,
.DAC2RealV.coeff = (-19007867),
.DAC2RealV.offset = 646316924837,
.Usercode2DAC.coeff = (-10521952),
.Usercode2DAC.offset = 603074812599,
.Gain0Boundary[0] = 0x5ECD,
.Gain0Boundary[1] = 0x5F0D,
.Gain1Boundary[0] = 0x5900,
.Gain1Boundary[1] = 0x64DD
};
#endif
#ifdef BOARD_JOHN_CENA
{
.ADC_volt.coeff = (-6286465),
.ADC_volt.offset = 151630618248,
.ADC_current[0].coeff = 30960625,
.ADC_current[0].offset = -747979808432,
.ADC_current[1].coeff = 652738209,
.ADC_current[1].offset = -15767733896990,
.ADC_current[2].coeff = 30959456000,
.ADC_current[2].offset = -748026885843000,
.DAC2RealV.coeff = (-18880478),
.DAC2RealV.offset = 629012735316,
.Usercode2DAC.coeff = (-10592952),
.Usercode2DAC.offset = 604535526400,
.Gain0Boundary[0] = 0x7653, // 20 uA
.Gain0Boundary[1] = 0x4504, // -20 uA
.Gain1Boundary[0] = 0x7C69, // 500 uA
.Gain1Boundary[1] = 0x405D, // -500 uA
.Gain1Boundary[2] = 0x5F4A, // 10 uA
.Gain1Boundary[3] = 0x5D7D, // -10 uA
.Gain2Boundary[0] = 0x5EC2, // 300 uA
.Gain2Boundary[1] = 0x5E01, // -300 uA
//.Gain0SupportRange =
//.Gain1SupportRange[0] =
//.Gain1SupportRange[1] =
//.Gain2SupportRange =
};
#endif
#ifdef BOARD_GENIUS
{
.ADC_volt.coeff = (-6236652),
.ADC_volt.offset = 101533279052,
.ADC_current[0].coeff = 31094976,
.ADC_current[0].offset = (-507114075439),
.ADC_current[1].coeff = 31218018,
.ADC_current[1].offset = (-508593562044),
.ADC_current[2].coeff = 557826631,
.ADC_current[2].offset = (-9088752534070),
.DAC2RealV.coeff = (-18990774),
.DAC2RealV.offset = 570886531263,
.Usercode2DAC.coeff = (-10605006),
.Usercode2DAC.offset = 566878948150,
.Gain0Boundary[0] = 0x5D96,
.Gain0Boundary[1] = 0x5DD9,
.Gain1Boundary[0] = 0x57CD,
.Gain1Boundary[1] = 0x639F
};
#endif
#ifdef BOARD_DA_SHUN
{
.ADC_volt.coeff = (-6280824),
.ADC_volt.offset = 151787055168,
.ADC_current[0].coeff = 25109217,
.ADC_current[0].offset = (-606888506534),
.ADC_current[1].coeff = 657619639,
.ADC_current[1].offset = (-15894373245404),
.ADC_current[2].coeff = 31040178,
.ADC_current[2].offset = (-750263570000),
.DAC2RealV.coeff = (-18975834),
.DAC2RealV.offset = 647359124391,
.Usercode2DAC.coeff = (-10539718),
.Usercode2DAC.offset = 604829309500,
.Gain0Boundary[0] = 0x5E2F,
.Gain0Boundary[1] = 0x5E96,
.Gain1Boundary[0] = 0x5878,
.Gain1Boundary[1] = 0x645A
};
#endif
#ifdef BOARD_CHIEN_YU
{
.ADC_volt.coeff = (-6279056),
.ADC_volt.offset = 150985844279,
.ADC_current[0].coeff = 31788227 ,
.ADC_current[0].offset = (-765340735866),
.ADC_current[1].coeff = 657619858,
.ADC_current[1].offset = (-15835988865283),
.ADC_current[2].coeff = 31116362,
.ADC_current[2].offset = (-749402214847),
.DAC2RealV.coeff = (-18935149),
.DAC2RealV.offset = 643063752893,
.Usercode2DAC.coeff = (-10567567),
.Usercode2DAC.offset = 603991718526,
.Gain0Boundary[0] = 0x5DE5,
.Gain0Boundary[1] = 0x5E30,
.Gain1Boundary[0] = 0x5820,
.Gain1Boundary[1] = 0x6408
};
#endif
#ifdef BOARD_LITTLE_STAR
{
.ADC_volt.coeff = (-6224192),
.ADC_volt.offset = 101472884698,
.ADC_current[0].coeff = 31293602,
.ADC_current[0].offset = (-510187416959),
.ADC_current[1].coeff = 655130048,
.ADC_current[1].offset = (-10680093830418),
.ADC_current[2].coeff = 31450484,
.ADC_current[2].offset = (-512697942950),
.DAC2RealV.coeff = (-18690126),
.DAC2RealV.offset = 564319610294 ,
.Usercode2DAC.coeff = (-10524846),
.Usercode2DAC.offset = 561713962333,
.Gain0Boundary[0] = 0x5E2F,
.Gain0Boundary[1] = 0x5E96,
.Gain1Boundary[0] = 0x5878,
.Gain1Boundary[1] = 0x645A
};
#endif
#ifdef BOARD_517
{
.ADC_volt.coeff = (-6244769),
.ADC_volt.offset = 101714685687,
.ADC_current[0].coeff = 30919726,
.ADC_current[0].offset = (-503489101786),
.ADC_current[1].coeff = 654824495,
.ADC_current[1].offset = (-10660542778914),
.ADC_current[2].coeff = 31376265,
.ADC_current[2].offset = (-510797752348),
.DAC2RealV.coeff = (-18690126),
.DAC2RealV.offset = 564319610294 ,
.Usercode2DAC.coeff = (-10500774),
.Usercode2DAC.offset = 560779455904,
.Gain0Boundary[0] = 0x5E2F,
.Gain0Boundary[1] = 0x5E96,
.Gain1Boundary[0] = 0x5878,
.Gain1Boundary[1] = 0x645A
};
#endif
#ifdef BOARD_FISH_VET
{
.ADC_volt.coeff = (-6243954),
.ADC_volt.offset = 101956814341,
.ADC_current[0].coeff = 6208753,
.ADC_current[0].offset = (-101076436901),
.ADC_current[1].coeff = 68760643,
.ADC_current[1].offset = (-1123221851971),
.ADC_current[2].coeff = 61882330000,
.ADC_current[2].offset = (-10103859661590),
.DAC2RealV.coeff = (-18690126),
.DAC2RealV.offset = 564319610294,
.Usercode2DAC.coeff = (-10517326),
.Usercode2DAC.offset = 561574831512,
.Gain0Boundary[0] = 0x5E2F,
.Gain0Boundary[1] = 0x5E96,
.Gain1Boundary[0] = 0x5878,
.Gain1Boundary[1] = 0x645A
};
#endif
#ifdef BOARD_KELLY
{
.ADC_volt.coeff = (-6238112),
.ADC_volt.offset = 101628014509,
.ADC_current[0].coeff = 6087943,
.ADC_current[0].offset = (-99768174580),
.ADC_current[1].coeff = 68915156,
.ADC_current[1].offset = (-1121470119188),
.ADC_current[2].coeff = 61800515,
.ADC_current[2].offset = (-1006755993534),
.DAC2RealV.coeff = (-18690126),
.DAC2RealV.offset = 564319610294,
.Usercode2DAC.coeff = (-10528309),
.Usercode2DAC.offset = 561035476688,
.Gain0Boundary[0] = 0x5E2F,
.Gain0Boundary[1] = 0x5E96,
.Gain1Boundary[0] = 0x5878,
.Gain1Boundary[1] = 0x645A
};
#endif
#ifdef BOARD_BAY_BAY
{
.ADC_volt.coeff = (-6223734),
.ADC_volt.offset = 101647006833,
.ADC_current[0].coeff = 31039179,
.ADC_current[0].offset = (-506383432096),
.ADC_current[1].coeff = 647940355,
.ADC_current[1].offset = (-10611041889224),
.ADC_current[2].coeff = 31094976,
.ADC_current[2].offset = (-507114075439),
.DAC2RealV.coeff = (-18690126),
.DAC2RealV.offset = 564319610294,
.Usercode2DAC.coeff = (-10541677),
.Usercode2DAC.offset = 562208801371,
.Gain0Boundary[0] = 0x5E2F,
.Gain0Boundary[1] = 0x5E96,
.Gain1Boundary[0] = 0x5878,
.Gain1Boundary[1] = 0x645A
};
#endif
#ifdef BOARD_MEOWMI
{
.ADC_volt.coeff = (-6265015),
.ADC_volt.offset = 101843650153,
.ADC_current[0].coeff = 62522034,
.ADC_current[0].offset = (-1016702373525),
.ADC_current[1].coeff = 31613132,
.ADC_current[1].offset = (-514033175600),
.ADC_current[2].coeff = 565897139,
.ADC_current[2].offset = (-9201204539440),
.DAC2RealV.coeff = (-18990774),
.DAC2RealV.offset = 570886531263,
.Usercode2DAC.coeff = (-10541427),
.Usercode2DAC.offset = 562159124753,
.Gain0Boundary[0] = 0x5D96,
.Gain0Boundary[1] = 0x5DD9,
.Gain1Boundary[0] = 0x57CD,
.Gain1Boundary[1] = 0x639F
};
#endif
#ifdef BOARD_EUROPEAN
{
.ADC_volt.coeff = (-6264190),
.ADC_volt.offset = 101683809669,
.ADC_current[0].coeff = 31301451,
.ADC_current[0].offset = (-508301866021),
.ADC_current[1].coeff = 656423459,
.ADC_current[1].offset = (-10660544072862),
.ADC_current[2].coeff = 31414514000,
.ADC_current[2].offset = (-510185549182000),
.DAC2RealV.coeff = (-18990774),
.DAC2RealV.offset = 570886531263,
.Usercode2DAC.coeff = (-10513774),
.Usercode2DAC.offset = 559795292677,
.Gain0Boundary[0] = 0x5D96,
.Gain0Boundary[1] = 0x5DD9,
.Gain1Boundary[0] = 0x57CD,
.Gain1Boundary[1] = 0x639F
};
#endif
#ifdef BOARD_EARTH
{
.ADC_volt.coeff = (-6256660),
.ADC_volt.offset = 101658275678,
.ADC_current[0].coeff = 31271240,
.ADC_current[0].offset = (-508496329863),
.ADC_current[1].coeff = 659931818,
.ADC_current[1].offset = (-10729666444387),
.ADC_current[2].coeff = 31485559000,
.ADC_current[2].offset = (-511907957163000),
.DAC2RealV.coeff = (-19047143),
.DAC2RealV.offset = 565935714286,
.Usercode2DAC.coeff = (-10500262),
.Usercode2DAC.offset = 559630236100,
.Gain0Boundary[0] = 0x5D96,
.Gain0Boundary[1] = 0x5DD9,
.Gain1Boundary[0] = 0x57CD,
.Gain1Boundary[1] = 0x639F
};
#endif
#ifdef BOARD_MARS
{
.ADC_volt.coeff = (-6270623),
.ADC_volt.offset = 102383421553,
.ADC_current[0].coeff = 31187022,
.ADC_current[0].offset = (-509159321195),
.ADC_current[1].coeff = 655981611,
.ADC_current[1].offset = (-10709717111320),
.ADC_current[2].coeff = 31256968,
.ADC_current[2].offset = (-510275213115),
.DAC2RealV.coeff = (-18937347),
.DAC2RealV.offset = 568558163265,
.Usercode2DAC.coeff = (-10561141),
.Usercode2DAC.offset = 564249134291,
.Gain0Boundary[0] = 0x5D96,
.Gain0Boundary[1] = 0x5DD9,
.Gain1Boundary[0] = 0x57CD,
.Gain1Boundary[1] = 0x639F
};
#endif
#ifdef BOARD_VENUS
{
.ADC_volt.coeff = (-6268996),
.ADC_volt.offset = 102204055818,
.ADC_current[0].coeff = 31131930,
.ADC_current[0].offset = (-507382432547),
.ADC_current[1].coeff = 654620883,
.ADC_current[1].offset = (-10668953588943),
.ADC_current[2].coeff = 31245260000,
.ADC_current[2].offset = (-509181085054000),
.DAC2RealV.coeff = (-19009388),
.DAC2RealV.offset = 567032653061,
.Usercode2DAC.coeff = (-10521117),
.Usercode2DAC.offset = 561308254899,
.Gain0Boundary[0] = 0x5D96,
.Gain0Boundary[1] = 0x5DD9,
.Gain1Boundary[0] = 0x57CD,
.Gain1Boundary[1] = 0x639F
};
#endif
#ifdef BOARD_MERCURY
{
.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 = (-19009388),
.DAC2RealV.offset = 567032653061,
.Usercode2DAC.coeff = (-10548297),
.Usercode2DAC.offset = 562611756757,
.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){
long long ADCRealVolt = 0;
ADCRealVolt = (Correction.ADC_volt.coeff * ADC_measure + Correction.ADC_volt.offset);
ADCRealVolt = ADCRealVolt / 1e7;
return (int32_t) (ADCRealVolt);
}
// this function turn ADC measure value (0xXXXX) into real current
// unit should be pA
static int32_t DecodeADCCurrent(uint8_t ADCGain, uint16_t ADC_measure){
long long ADCRealCurrent = 0;
ADCRealCurrent = (Correction.ADC_current[ADCGain].coeff * ADC_measure + Correction.ADC_current[ADCGain].offset)/1e7;
// Current unit is pA;
// If ADCGain is GAIN_200R unit is nA
return (int32_t) (ADCRealCurrent);
}
static int32_t DecodeResister(uint8_t ADCGainLevel, uint16_t CurrentMeasure, uint16_t VoltMeasure){
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;
// 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;
// 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);
NotifyImpedance[2] = (uint8_t) ((resister_32 & 0x0000FF00) >> 8);
NotifyImpedance[3] = (uint8_t) (resister_32 & 0x000000FF);
return resister_32;
}
// Decode ADC measure value (could be a volt or current) and put it into notify buffer
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;
// return real volt to controller
if(ADCChannel == ADC_CH_VOLT){
ADCRealVolt = DecodeADCVolt(ADC_measure);
ret = ADCRealVolt;
}
// return real current to controller
else if(ADCChannel == ADC_CH_CURRENT){
if ( (INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE)) {
// wait 0.1 sec until circuit stable => discard first data means wait 0.1 sec
if(DiscardIVFirstData){
DiscardIVFirstData ++;
DecodeADCCurrent(ADCGain, ADC_measure);
ret = DecodeADCCurrent(ADCGain, ADC_measure);
// DiscardIVFirstData :1,2; discard two data
// DiscardIVFirstData = 0; recording data
if(DiscardIVFirstData == 3){
DiscardIVFirstData = 0;
}
return ret;
}
// return a real time current (used for deciding auto gain)
ret = DecodeADCCurrent(ADCGain, ADC_measure);
ADCRealCurrent_long = ADCRealCurrent_long + ret;
avg_number ++;
if (CT.StepTimeCounter == INSTRUCTION.StepTime - 1) {
DiscardIVFirstData = 1;
ADCRealCurrent_long = ADCRealCurrent_long / avg_number;
NotifyCurrent[0] = (uint8_t) (ADCRealCurrent_long >> 24);
NotifyCurrent[1] = (uint8_t) ((ADCRealCurrent_long & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((ADCRealCurrent_long & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (ADCRealCurrent_long & 0x000000FF);
avg_number = 0;
ADCRealCurrent_long = 0;
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);
}
}
// IT curve
else {
ADCRealCurrent = DecodeADCCurrent(ADCGain, ADC_measure);
NotifyCurrent[0] = (uint8_t) (ADCRealCurrent >> 24);
NotifyCurrent[1] = (uint8_t) ((ADCRealCurrent & 0x00FF0000) >> 16);
NotifyCurrent[2] = (uint8_t) ((ADCRealCurrent & 0x0000FF00) >> 8);
NotifyCurrent[3] = (uint8_t) (ADCRealCurrent & 0x000000FF);
ret = ADCRealCurrent;
}
}
else{
// not support AIN2 / AIN3 yet
}
return ret;
}
// #0 board, (0x5f75 <= rawdata) && (rawdata <= 0x5fb2)
// ((0x5f97 < rawdata) && (rawdata < 0x6589)) || ((0x5999 < rawdata) && (rawdata < 0x5f93))
static void ADC_overflow(uint8_t gain, uint8_t *rawdata){
// Gain boundary defines different ADC gain level working area
// Gain0Boundary = {lowerbound, upperbound}, is the lower and upper bound of gain level 0 working area.
uint16_t U16Rawdata = 0;
U16Rawdata = (((uint16_t) (rawdata[0]))<<8) | ((uint16_t) (rawdata[1]));
if(gain == GAIN_200K){
if( U16Rawdata <= Correction.Gain0Boundary[0]){
rawdata[0] = Correction.Gain0Boundary[0] >> 4;
rawdata[1] = (uint8_t) (Correction.Gain0Boundary[0] & 0x00FF);
}
else if(U16Rawdata >= Correction.Gain0Boundary[1]){
rawdata[0] = (uint8_t) (Correction.Gain0Boundary[1] >> 4);
rawdata[1] = (uint8_t) (Correction.Gain0Boundary[1] & 0x00FF);
}
}
else if(gain == GAIN_10K){
if( U16Rawdata <= Correction.Gain1Boundary[0]){
rawdata[0] = Correction.Gain1Boundary[0] >> 4;
rawdata[1] = (uint8_t) (Correction.Gain1Boundary[0] & 0x00FF);
}
else if(U16Rawdata >= Correction.Gain1Boundary[1]){
rawdata[0] = (uint8_t) (Correction.Gain1Boundary[1] >> 4);
rawdata[1] = (uint8_t) (Correction.Gain1Boundary[1] & 0x00FF);
}
}
}
// User will enter -5V~+5V in UI.
// websever and controler use 0~50000 represent -5~+5V
// this function should turn 0~50000 into DACcode which output the exactly voltage user want
static uint16_t Usercode_Correction_to_DAC(uint16_t usercode)
{
long long usercode_32;
uint16_t DACcode = 0;
usercode_32 = (long long)(usercode);
DACcode = (uint16_t) ((Correction.Usercode2DAC.coeff * usercode_32 + Correction.Usercode2DAC.offset)/1e7);
return DACcode;
}
static int32_t DAC_to_realV(uint16_t DACcode)
{
int32_t RealV = 0;
long long usercode_32;
usercode_32 = ((DACcode * 1e7) - Correction.Usercode2DAC.offset) / Correction.Usercode2DAC.coeff;
RealV = (int32_t) (usercode_32 / 5) - 5000;
// return mV
return RealV;
}
#endif
@@ -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
@@ -0,0 +1,38 @@
/* Copyright (c) 2019. BioPro. Scientific.
*/
#ifndef HEADSTAGE_GPTIMER_H
#define HEADSTAGE_GPTIMER_H
#include <Board.h>
#include <ti/drivers/timer/GPTimerCC26XX.h>
#include <ti/sysbios/BIOS.h>
#include <xdc/runtime/Types.h>
#define EVT_PERIODIC_GPTIMER EVT_PERIODIC_0
static GPTimerCC26XX_Handle gptimer_handle;
static void elite_gptimer_callback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask);
#define elite_gptimer_start() GPTimerCC26XX_start(gptimer_handle)
#define elite_gptimer_stop() GPTimerCC26XX_stop(gptimer_handle)
#define elite_gptimer_close() GPTimerCC26XX_close(gptimer_handle)
#define CLOCK_FREQ 4000 // clock freq = 0.1 ms
#define elite_gptimer_open() \
do { \
GPTimerCC26XX_Params params; \
GPTimerCC26XX_Params_init(&params); \
params.width = GPT_CONFIG_16BIT; \
params.mode = GPT_MODE_PERIODIC_DOWN; \
params.debugStallMode = GPTimerCC26XX_DEBUG_STALL_OFF; \
gptimer_handle = GPTimerCC26XX_open(Board_GPTIMER0A, &params); \
Types_FreqHz freq; \
BIOS_getCpuFreq(&freq); \
GPTimerCC26XX_Value loadVal = freq.lo / 1000 - 1; /*47999*/ \
GPTimerCC26XX_setLoadValue(gptimer_handle, loadVal); \
GPTimerCC26XX_setLoadValue(gptimer_handle, CLOCK_FREQ); /* 0.1 ms*/ \
GPTimerCC26XX_registerInterrupt(gptimer_handle, elite_gptimer_callback, GPT_INT_TIMEOUT); \
} while (0)
#endif // HEADSTAGE_GPTIMER_H
@@ -0,0 +1,95 @@
#ifndef ELITE_I2C
#define ELITE_I2C
/*
* Read I2C example in
* http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/2_14_02_22/
* exports/tirtos_full_2_14_02_22/docs/doxygen/html/_i2_c_c_c26_x_x_8h.html
*
*/
#include <ti/drivers/I2C.h>
#include <ti/drivers/Power.h>
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
// I2C
static I2C_Handle I2Chandle;
static I2C_Params I2Cparams;
static I2C_Transaction i2cTrans;
#define I2CBufSize 4
static uint8_t I2CtxBuf[I2CBufSize]; // Transmit buffer
static uint8_t I2CrxBuf[I2CBufSize]; // Receive buffer
bool transferDone = false;
static void I2CCallbackFunction(I2C_Handle handle, I2C_Transaction *msg, bool transfer) {
if(transfer){
transferDone = true;
}
}
static void I2Cinit(){
I2C_init();
// Configure I2C parameters.
I2C_Params_init(&I2Cparams);
I2Cparams.transferMode = I2C_MODE_CALLBACK;
I2Cparams.transferCallbackFxn = I2CCallbackFunction;
I2Cparams.bitRate = I2C_100kHz;
// Initialize master I2C transaction structure
i2cTrans.writeCount = I2CBufSize;
i2cTrans.writeBuf = I2CtxBuf;
i2cTrans.readCount = I2CBufSize;
i2cTrans.readBuf = I2CrxBuf;
i2cTrans.slaveAddress = 0xA0;
for(int i=0 ; i<10 ; i++){
I2CtxBuf[i] = 0;
I2CrxBuf[i] = 0;
}
// Open I2C
I2Chandle = I2C_open(Board_I2C, &I2Cparams);
}
#define WriteMem 0b10100001
#define ReadMem 0b10100000
static void I2CWrite(uint8_t addr, uint8_t data){
for(int i=0 ; i<I2CBufSize ; i++){
I2CtxBuf[i] = 0;
I2CrxBuf[i] = 0;
}
I2CtxBuf[0] = WriteMem;
I2CtxBuf[1] = addr;
I2CtxBuf[2] = data;
// I2Chandle = I2C_open(Board_I2C, &I2Cparams);
I2C_transfer(I2Chandle, &i2cTrans);
// I2C_close(I2Chandle);
}
static void I2CRead(uint8_t addr){
for(int i=0 ; i<I2CBufSize ; i++){
I2CtxBuf[i] = 0;
I2CrxBuf[i] = 0;
}
I2CtxBuf[0] = ReadMem;
I2CtxBuf[1] = addr;
// I2Chandle = I2C_open(Board_I2C, &I2Cparams);
I2C_transfer(I2Chandle, &i2cTrans);
// I2C_close(I2Chandle);
}
#endif // ELITE_I2C
@@ -0,0 +1,75 @@
#ifndef ELITEIT
#define ELITEIT
#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;
}
default: {
#define CURRENT_MODE WorkModeData->IV
break;
}
}
// read ADC current
int32_t Real_Current = 0;
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();
// }
// }
return Real_Current;
}
#endif
@@ -0,0 +1,86 @@
#ifndef ELITEIV
#define ELITEIV
static uint16_t VoltScan(WorkMode *WorkModeData) {
uint16_t Voltage;
if (INSTRUCTION.VoltOrigin == INSTRUCTION.VoltFinal) {
Voltage = Usercode_Correction_to_DAC(INSTRUCTION.VoltOrigin);
DAC_outputV(Voltage);
PeriodicEvent = false;
return Voltage;
} else if (INSTRUCTION.eliteFxn == SQUARE_WAVE_VOLTAMMETRY) {
Voltage = SWVCurve(WorkModeData);
} else if (INSTRUCTION.eliteFxn == DIFFERENTIAL_PULSE_VOLTAMMETRY) {
Voltage = DPVCurve(WorkModeData);
} else if (INSTRUCTION.eliteFxn == CV_CURVE) {
Voltage = CVCurve(WorkModeData->CV);
}
// IV plot mode
else {
Voltage = OneWayVoltScan(WorkModeData->IV);
}
return Voltage;
}
static uint16_t OneWayVoltScan(IVMode *IV) {
static uint16_t DACOutCode;
// reset origin volt at the begin
if (DACReset) {
// DACUserCode = IV->GetVOrigin((struct VoltOutPara *) IV);
DACUserCode = IV->_VOrigin;
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
DACReset = false;
// output VOLT_ORIGIN
DAC_outputV(DACOutCode);
return DACOutCode;
}
if (CT.StepTimeCounter == IV->_StepTime){
if (IV->_VOrigin < IV->_VStop) {
// output the next output volt
DACUserCode = DACUserCode + IV->_Step;
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
DAC_outputV(DACOutCode);
// end IV task if we reach 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
DACOutCode = Usercode_Correction_to_DAC(DACUserCode);
DAC_outputV(DACOutCode);
// end IV task if we reach INSTRUCTION.VoltFinal
if (DACUserCode <= IV->_VStop){
PeriodicEvent = false;
DACReset = true;
// reset();
}
}
}
return DACOutCode;
}
#endif
@@ -0,0 +1,130 @@
#ifndef ELITEINSTRUCTION
#define ELITEINSTRUCTION
/** ADC gain level **/
#define GAIN_200K 0x00 // largest gain
#define GAIN_10K 0x01
#define GAIN_200R 0x02 // the least gain
#define GAIN_AUTO 0x03
/** Resister meter **/
#define RESISTER_METER_SMALL 0x00
#define RESISTER_METER_MIDDLE1 0x01
#define RESISTER_METER_MIDDLE2 0x02
#define RESISTER_METER_LARGE 0x03
/** CC mode parameter **/
// CurrentLV
#define CURRENT_LV_NA 0x00
#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 ====
=============================*/
struct HEADSTAGE_INSTRUCTION {
/** chip ID */
uint8_t chip_id;
/** Sample rate **/
// SampleRate = SampleRateTable[SampleRateIndex]
uint8_t SampleRateIndex;
uint32_t SampleRate;
/** DAC parameter **/
// volt san parameter
uint16_t VoltOrigin;
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 **/
int32_t ConstantCurrent;
/** Resister Measure **/
uint8_t ResisterMeter;
// elite function
uint8_t eliteFxn;
uint8_t CycleNumber;
} INSTRUCTION = {0};
/*********************************************************************
* @fn InitEliteInstruction
*
* @brief Init all INSTRUCTION variable.
*
* @param None.
*
* @return None.
*/
static void InitEliteInstruction(){
INSTRUCTION.chip_id = 0;
INSTRUCTION.SampleRateIndex = 1;
INSTRUCTION.SampleRate = 100;
INSTRUCTION.VoltOrigin = DAC_ZERO;
INSTRUCTION.VoltFinal = DAC_ZERO;
INSTRUCTION.Step = 0x0005; // 0x0005 = 1mV
INSTRUCTION.StepTime = STEPTIME_HALF_SEC; // about 0.5 sec
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.ConstantCurrent = 0x00000000;
INSTRUCTION.eliteFxn = 0; // default is a null event
INSTRUCTION.CycleNumber = 0;
}
/*********************************************************************
* @fn GetInstructionParameter
*
* @brief Get Constant Current mode parameter.
*
* @param ins - instruction including current value and unit
*
* @return None.
*/
static void GetInstructionParameter(uint8 *ins){
// CurrentLV=0 => unit is nA
// CurrentLV=1 => unit is uA
// CurrentLV=2 => unit is mA
// INSTRUCTION.CurrentLV = (*ins);
// ConstantCurrentRange=0 => current value is 0~499
// ConstantCurrentRange=1 => current value is 500~999
// INSTRUCTION.ConstantCurrentRange = (*ins) & 0x0F;
// ConstantCurrent divide ConstantCurrentRange into 50000 count (thus each count is 0.01)
// e.g. 485.7 uA can be represent by
// CurrentLV = 1 (unit is uA)
// ConstantCurrentRange = 0 (current range is 0~499)
// ConstantCurrent = 48570
INSTRUCTION.ConstantCurrent = (uint32_t) (*(ins+1))<<24 | (uint32_t) (*(ins+2))<<16 | (uint32_t) (*(ins+3))<<8 | (uint32_t) (*(ins+4));
}
#endif
@@ -0,0 +1,70 @@
#ifndef ELITEKEYDETECT
#define ELITEKEYDETECT
#define CLOCK_ONE_SECOND 10000
static bool TurnOnElite(uint8_t key) {
static uint16_t TurnOnCounter = 0;
if (key == 0) {
// press 1 sec, power on LED
if (TurnOnCounter >= CLOCK_ONE_SECOND) {
PIN_setOutputValue(pin_handle, enable_5v, 1); // enable 5V
TurnOn10V();
LEDPowerON();
return true;
} else {
TurnOnCounter++;
return false;
}
} else {
TurnOnCounter = 0;
PIN_setOutputValue(pin_handle, enable_5v, 0); // enable 5V
return false;
}
}
static void EliteKeyPress(uint8_t key) {
static uint16_t ShutDownCounter = 0;
static uint8_t OriginEliteFxn = 0;
if (key == 0) {
// key = 0 if press
// press key => bight LED
if (ShutDownCounter == CLOCK_ONE_SECOND) {
KeyWorkModeLED();
}
// press 3~4 sec, shutdown 2650
else if (ShutDownCounter > (CLOCK_ONE_SECOND*3) ) {
LED_color(DARKLED, 0xFF, 0xFF, 0x00);
PIN_setOutputValue(pin_handle, enable_5v, 0); // disable 5V
}
ShutDownCounter ++;
} else {
if (OriginEliteFxn == INSTRUCTION.eliteFxn) { // old function == currunt instruction
if (ShutDownCounter != 0) {
// dark LED
WorkModeLED();
ShutDownCounter = 0;
}
} else { // old function != currunt instruction
OriginEliteFxn = INSTRUCTION.eliteFxn;
if (ShutDownCounter != 0) {
ShutDownCounter = 0;
}
// dark mode LED
WorkModeLED();
}
}
}
static void TurnOn10V() {
If10Von = true;
PIN_setOutputValue(pin_handle, enable_10v, 1);
CPUdelay(8000);
}
#endif
@@ -0,0 +1,134 @@
#ifndef ELITELED
#define ELITELED
#define DARKLED 0xE1
#define LIGHTLED 0xE8
static void LED_color(uint8_t bright, uint8_t red, uint8_t green, uint8_t blue);
#define LEDPowerON() LED_color(DARKLED, 0x00, 0xFA, 0x00)
#define WORKLED() LED_color(0xE2, 0x00, 0x40, 0x40)
#define KEYLED() LED_color(LIGHTLED, 0xF0, 0xA0, 0x00)
static void LED_color(uint8_t bright, uint8_t red, uint8_t green, uint8_t blue) {
spi_LEDtxbuf[0] = 0x0000;
spi_LEDtxbuf[1] = 0x0000;
for (int i = 2; i < SPI_LED_SIZE - 2; i += 2) {
spi_LEDtxbuf[i] = 0xE000 | ((uint16_t)bright << 8) | blue;
spi_LEDtxbuf[i + 1] = ((uint16_t)green << 8) | red;
}
spi_LEDtxbuf[SPI_LED_SIZE - 2] = 0xffff;
spi_LEDtxbuf[SPI_LED_SIZE - 1] = 0xffff;
LED_SPI(SPI_LED_SIZE, spi_LEDtxbuf, spi_LEDrxbuf);
}
static void WorkModeLED() {
switch (INSTRUCTION.eliteFxn) {
case IV_CURVE: {
WORKLED();
break;
}
case CV_CURVE: {
WORKLED();
break;
}
case DIFFERENTIAL_PULSE_VOLTAMMETRY: {
WORKLED();
break;
}
case SQUARE_WAVE_VOLTAMMETRY: {
WORKLED();
break;
}
case VOLT_OUTPUT: {
WORKLED();
break;
}
case ZT_CURVE: {
WORKLED();
break;
}
case VT_CURVE: {
WORKLED();
break;
}
case IT_CURVE: {
WORKLED();
break;
}
case CONSTANT_CURRENT:{
WORKLED();
break;
}
case VIS_RST: {
LEDPowerON();
break;
}
case ADC_TEST: {
WORKLED();
break;
}
default: {
LEDPowerON();
break;
}
}
}
static void KeyWorkModeLED() {
KEYLED();
/*
switch(INSTRUCTION.eliteFxn){
case IV_CURVE:{
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
break;
}
case CV_CURVE:{
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
break;
}
case DIFFERENTIAL_PULSE_VOLTAMMETRY:{
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
break;
}
case SQUARE_WAVE_VOLTAMMETRY:{
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
break;
}
case VOLT_OUTPUT:{
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
break;
}
case ZT_CURVE:{
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
break;
}
case VT_CURVE:{
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
break;
}
case IT_CURVE:{
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
break;
}
case VIS_RST:{
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
break;
}
case ADC_TEST:{
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
break;
}
default:{
LED_color(LIGHTLED, 0xF0, 0xF0, 0x00);
break;
}
}
*/
}
#endif
@@ -0,0 +1,112 @@
#ifndef ELITENOTIFY
#define ELITENOTIFY
#include "headstage.h"
/**
* notify data buffer.
* the length equals to the characteristic 4 which value is 20 bytes.
*
*/
#define NOT_BUF_OFFSET_INIT 8
/**
* the index where to start insert data into buffer.
* start from 6.
*/
static size_t not_buf_offset = NOT_BUF_OFFSET_INIT;
static uint32_t not_time_stamp;
static uint8_t NotifyCurrent[4] = {0};
static uint8_t NotifyVolt[4] = {0};
static uint8_t NotifyImpedance[4] = {0};
/**
* counter of notify send.
*/
static uint32_t notify_counter = 0;
// ****************** New Notify Format ******************************** //
/*
* Notify format
*
*
| | 1 | 2 | 3 |
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
-----------------------------------------------------------------
| header |
| current |
| voltage or impedance |
| mode & gain |
| time stamp |
| cycle number |
mode & gain
this byte include Elite working mode and ADC gain level
we use "(mode & 0xF0) | (gain & 0x0F)" to encode these two information
cycle number
for cyclic voltammetry use, we save it as channel number.
0xFF
* header = device ID
* I = current (0.001nA), V = voltage (mV),
* Z = impedance (k ohm), T = time (ms)
*
*
*/
// ********* End New Format Notify ***************************************** //
/*
* Notify format
*
*
| | 1 | 2 | 3 |
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
-----------------------------------------------------------------
| header |
| current |
| voltage |
| impedance |
| time stamp |
| cycle number |
cycle number
for cyclic voltammetry use, we save it as channel number.
0xFF
* header = device ID
* I = current (0.001nA), V = voltage (mV),
* Z = impedance (k ohm), T = time (ms)
*
*
*/
static void SendNotify() {
not_buf[0] = INSTRUCTION.chip_id;
for (int i = 0; i < 4; i++) {
not_buf[i + 1] = NotifyCurrent[i];
not_buf[i + 5] = NotifyVolt[i];
not_buf[i + 9] = NotifyImpedance[i];
}
// 1 Timestamp = 32 usec; 31 Timestamp ~= 1 msec
not_time_stamp = (Timestamp_get32()) / 31; // msec
not_buf[13] = not_time_stamp & 0xff;
not_buf[14] = (not_time_stamp >> 8) & 0xff;
not_buf[15] = (not_time_stamp >> 16) & 0xff;
not_buf[16] = (not_time_stamp >> 24) & 0xff;
// cyclic voltametry cycle number
not_buf[17] = INSTRUCTION.CycleNumber;
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
}
#endif
@@ -0,0 +1,123 @@
#ifndef ELITERESET
#define ELITERESET
static void reset() {
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));
if (INSTRUCTION.eliteFxn == CONSTANT_CURRENT){
INSTRUCTION.eliteFxn = 0;
}
LEDPowerON();
for (int i = 0; i < BLE_INS_BUFF_SIZE; i++) {
ins_buf[i] = 0;
}
for (int i = 0; i < SPI_LED_SIZE; i++) {
spi_LEDtxbuf[i] = 0;
spi_LEDrxbuf[i] = 0;
}
for (int i = 0; i < SPI_DAC_SIZE; i++) {
spi_DACtxbuf[i] = 0;
spi_rxbuf[i] = 0;
}
for (int i = 0; i < SPI_ADC_SIZE; i++) {
spi_ADC_txbuf[i] = 0;
spi_ADC_rxbuf[i] = 0;
}
for (int i = 0; i < BLE_DAT_BUFF_SIZE; i++) {
not_buf[i] = 0;
}
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
CPUdelay(1600);
}
static void Eliteinterrupt() {
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));
LEDPowerON();
for (int i = 0; i < BLE_INS_BUFF_SIZE; i++) {
ins_buf[i] = 0;
}
for (int i = 0; i < SPI_LED_SIZE; i++) {
spi_LEDtxbuf[i] = 0;
spi_LEDrxbuf[i] = 0;
}
for (int i = 0; i < SPI_DAC_SIZE; i++) {
spi_DACtxbuf[i] = 0;
spi_rxbuf[i] = 0;
}
for (int i = 0; i < SPI_ADC_SIZE; i++) {
spi_ADC_txbuf[i] = 0;
spi_ADC_rxbuf[i] = 0;
}
for (int i = 0; i < BLE_DAT_BUFF_SIZE; i++) {
not_buf[i] = 0;
}
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
CPUdelay(8000);
}
static void CleanBuffer() {
InitFlag();
InitEliteInstruction();
InitCT();
DiscardIVFirstData = 0;
avg_number = 0;
ADCRealCurrent_long = 0;
for (int i = 0; i < SPI_LED_SIZE; i++) {
spi_LEDtxbuf[i] = 0;
spi_LEDrxbuf[i] = 0;
}
for (int i = 0; i < SPI_DAC_SIZE; i++) {
spi_DACtxbuf[i] = 0;
spi_rxbuf[i] = 0;
}
for (int i = 0; i < SPI_ADC_SIZE; i++) {
spi_ADC_txbuf[i] = 0;
spi_ADC_rxbuf[i] = 0;
}
for (int i = 0; i < BLE_DAT_BUFF_SIZE; i++) {
not_buf[i] = 0;
}
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
CPUdelay(8000);
}
#endif
@@ -0,0 +1,88 @@
#ifndef ELITE_SPI
#define ELITE_SPI
/*
* Read SPI example in
* http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/2_14_02_22/
* exports/tirtos_full_2_14_02_22/docs/doxygen/html/_s_p_i_c_c26_x_x_d_m_a_8h.html
*/
#include <Board.h>
#include <ti/drivers/SPI.h>
#include <ti/drivers/dma/UDMACC26XX.h>
#include <ti/drivers/spi/SPICC26XXDMA.h>
#include "Elite_PIN.h"
/* application use SPI parameters and buffers */
#define SPI_LED_SIZE 28
#define SPI_DAC_SIZE 3
#define SPI_ADC_SIZE 4
static uint16_t spi_LEDtxbuf[SPI_LED_SIZE] = {0};
static uint16_t spi_LEDrxbuf[SPI_LED_SIZE] = {0};
static uint8_t spi_DACtxbuf[SPI_DAC_SIZE] = {0};
static uint8_t spi_rxbuf[SPI_DAC_SIZE] = {0};
static uint8_t spi_ADC_txbuf[SPI_ADC_SIZE] = {0};
static uint8_t spi_ADC_rxbuf[SPI_ADC_SIZE] = {0};
/* system use SPI parameters */
static SPI_Handle spiHandle0 = NULL; // SPI0 = LED
static SPI_Handle spiHandle1 = NULL; // SPI1 = ADC +DAC
static SPI_Params spiParams0;
static SPI_Params spiParams1;
static SPI_Transaction LED_transaction;
static SPI_Transaction ADC_DAC_transaction;
static void Elite_SPI_init(){
SPI_init();
SPI_Params_init(&spiParams0);
spiParams0.bitRate = 2000; // 12k
spiParams0.mode = SPI_MASTER;
spiParams0.dataSize = 16;
spiParams0.frameFormat = SPI_POL0_PHA1;
spiHandle0 = SPI_open(Board_SPI0, &spiParams0); // LED SPI
SPI_Params_init(&spiParams1);
spiParams1.bitRate = 1000000; // 1M
spiParams1.mode = SPI_MASTER;
spiParams1.dataSize = 8;
spiParams1.frameFormat = SPI_POL0_PHA1;
spiHandle1 = SPI_open(Board_SPI1, &spiParams1); // ADC DAC SPI
}
static void LED_SPI(uint8_t length, uint16_t *spi_txbuf, uint16_t *spi_rxbuf) {
LED_transaction.count = length;
LED_transaction.txBuf = spi_txbuf;
LED_transaction.rxBuf = spi_rxbuf;
SPI_transfer(spiHandle0, &LED_transaction);
}
static void ADC_SPI(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
ADC_DAC_transaction.count = length;
ADC_DAC_transaction.txBuf = spi_txbuf;
ADC_DAC_transaction.rxBuf = spi_rxbuf;
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
PIN_setOutputValue(pin_handle, ADC_CS, 0); // ADC_CS LOW
SPI_transfer(spiHandle1, &ADC_DAC_transaction);
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
}
static void DAC_SPI(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
ADC_DAC_transaction.count = length;
ADC_DAC_transaction.txBuf = spi_txbuf;
ADC_DAC_transaction.rxBuf = spi_rxbuf;
PIN_setOutputValue(pin_handle, ADC_CS, 1); // ADC_CS HIGH
PIN_setOutputValue(pin_handle, DAC_CS, 0); // DAC_CS LOW
SPI_transfer(spiHandle1, &ADC_DAC_transaction);
PIN_setOutputValue(pin_handle, DAC_CS, 1); // DAC_CS HIGH
}
#endif // ELITE_SPI
@@ -0,0 +1,22 @@
#ifndef ELITEVT
#define ELITEVT
static void VT_Plot(VTMode *VT) {
// ADC gain is don't care when measuring voltage
uint8_t ADCGain = 0;
// read ADC volt
ReadVolt(spi_ADC_rxbuf);
// decode ADC value and put it into notify buffer
VT->SetMeasureData((struct Measure *) VT, DecodeADCValue(ADCGain, ADC_CH_VOLT, spi_ADC_rxbuf));
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,574 @@
/**
*
* 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;
VOUT_PARA;
LIMIT;
}IVMode;
IVMode *InitIVMode(){
IVMode *ret = malloc(sizeof(IVMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
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
int32_t ReferenceVolt;
VOUT_PARA;
}PSMode;
PSMode *InitPSMode(){
PSMode *ret = malloc(sizeof(PSMode));
ret->_MeasureData = 0;
ret->SetMeasureData = &_SetMeasureData;
ret->GetMeasureData = &_GetMeasureData;
ret->ReferenceVolt = 0;
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;
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;
default:
if(WM->IV != NULL){
free(WM->IV);
WM->IV = NULL;
}
break;
}
// free(WM);
}
#endif
@@ -0,0 +1,108 @@
#ifndef ELITEZT
#define ELITEZT
static void ZT_notify(int32_t impedance);
// output a certain voltage e.g. 2v
// and measure the input voltage
// => calculate the resister
// change the output voltage step
// => get a R-T curve (with resolution = 1 sample/volt step )
static void ZT_Plot(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;
int32_t volt_32 = 0;
int32_t current_32 = 0;
int32_t resister_32 = 0;
if(INSTRUCTION.AutoGainEnable){
current_32 = AutoGainReadCurrent(SPICurrent);
}
else{
ReadCurrent(spi_ADC_rxbuf);
current_32 = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
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;
// }
// decode ADC value and put it into notify buffer
// DecodeResister(INSTRUCTION.ADCGainLevel, CurrentMeasure, VoltMeasure);
// Real_Resister = DecodeADCValue(INSTRUCTION.ADCGainLevel, ADC_CH_CURRENT, spi_ADC_rxbuf);
}
#endif
@@ -0,0 +1,190 @@
#ifndef Elite_PIN
#define Elite_PIN
#include <ti/drivers/pin/PINCC26XX.h>
#include <Board.h>
#include <ti/drivers/PIN.h>
/* SPI Board */
#define Board_SPI0_MISO PIN_UNASSIGNED
#define Board_SPI0_MOSI IOID_1
#define Board_SPI0_CLK IOID_0
#define Board_SPI0_CS PIN_UNASSIGNED
#define Board_SPI1_MISO IOID_3
#define Board_SPI1_MOSI IOID_2
#define Board_SPI1_CLK IOID_4
#define Board_SPI1_CS PIN_UNASSIGNED
#define ADC_CS IOID_8
#define DAC_CS IOID_9
#define Turnon100R IOID_5
#define Turnon10K IOID_6
/* I2C */
#ifdef ELITE_VERSION_1_4
#define Board_I2C0_SCL0 IOID_7
#define Board_I2C0_SDA0 IOID_1
#endif
#define shutdown_6994 IOID_10
#define switch_on IOID_11
#define enable_10v IOID_12
#define enable_5v IOID_13
PIN_Handle pin_handle;
static PIN_State ZM_rst;
const PIN_Config BLE_IO[] = {
//
ADC_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // ADC_CS
DAC_CS | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX, // DAC_CS
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,
PIN_TERMINATE
};
/*!
* @def BOOSTXL_CC2650MA_SPIName
* @brief Enum of SPI names on the CC2650 Booster Pack
*/
typedef enum BOOSTXL_CC2650MA_SPIName {
BOOSTXL_CC2650MA_SPI0 = 0,
BOOSTXL_CC2650MA_SPI1 = 1,
BOOSTXL_CC2650MA_SPICOUNT
} BOOSTXL_CC2650MA_SPIName;
/*
* ========================== SPI DMA begin ===================================
*/
/* Place into subsections to allow the TI linker to remove items properly */
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_SECTION(SPI_config, ".const:SPI_config")
#pragma DATA_SECTION(spiCC26XXDMAHWAttrs, ".const:spiCC26XXDMAHWAttrs")
#endif
/* Include drivers */
#include <ti/drivers/spi/SPICC26XXDMA.h>
/* SPI objects */
SPICC26XXDMA_Object spiCC26XXDMAObjects[BOOSTXL_CC2650MA_SPICOUNT];
/* SPI configuration structure, describing which pins are to be used */
const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[BOOSTXL_CC2650MA_SPICOUNT] = {
{
.baseAddr = SSI0_BASE,
.intNum = INT_SSI0_COMB,
.intPriority = ~0,
.swiPriority = 0,
.powerMngrId = PowerCC26XX_PERIPH_SSI0,
.defaultTxBufValue = 0,
.rxChannelBitMask = 1<<UDMA_CHAN_SSI0_RX,
.txChannelBitMask = 1<<UDMA_CHAN_SSI0_TX,
.mosiPin = Board_SPI0_MOSI,
.misoPin = Board_SPI0_MISO,
.clkPin = Board_SPI0_CLK,
.csnPin = Board_SPI0_CS
},
{
.baseAddr = SSI1_BASE,
.intNum = INT_SSI1_COMB,
.intPriority = ~0,
.swiPriority = 0,
.powerMngrId = PowerCC26XX_PERIPH_SSI1,
.defaultTxBufValue = 0,
.rxChannelBitMask = 1<<UDMA_CHAN_SSI1_RX,
.txChannelBitMask = 1<<UDMA_CHAN_SSI1_TX,
.mosiPin = Board_SPI1_MOSI,
.misoPin = Board_SPI1_MISO,
.clkPin = Board_SPI1_CLK,
.csnPin = Board_SPI1_CS
},
};
/* SPI configuration structure */
const SPI_Config SPI_config[] = {
{
.fxnTablePtr = &SPICC26XXDMA_fxnTable,
.object = &spiCC26XXDMAObjects[0],
.hwAttrs = &spiCC26XXDMAHWAttrs[0]
},
{
.fxnTablePtr = &SPICC26XXDMA_fxnTable,
.object = &spiCC26XXDMAObjects[1],
.hwAttrs = &spiCC26XXDMAHWAttrs[1]
},
{NULL, NULL, NULL}
};
/*
* ========================== SPI DMA end =====================================
*/
/*
* ============================= I2C Begin=====================================
*/
#ifdef ELITE_VERSION_1_4
/* 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
@@ -0,0 +1,305 @@
#ifndef HEADSTAGE_H
#error "headstage.h not include"
#endif
#ifdef HEADSTAGE_H_H
#error "headstage_*.h has be included"
#endif
#ifndef HEADSTAGE_TNI_H
#define HEADSTAGE_H_H
#define HEADSTAGE_TNI_H
// product information
#define DEVICE_NAME "Elite-v0.1"
#define MAJOR_PRODUCT_NUMBER 0
#define MINOR_PRODUCT_NUMBER 1
#define MAJOR_VERSION_NUMBER 0
#define MINOR_VERSION_NUMBER 1
// header
#include <ti/drivers/PIN.h>
#include "board.h"
/*============
==== SPI ====
===========*/
/* application use SPI parameters and buffers */
#define SPI_BUFFER_SIZE 16
static uint8_t spi_txbuf[SPI_BUFFER_SIZE] = {0};
static uint8_t spi_rxbuf[SPI_BUFFER_SIZE] = {0};
/*=============================
==== headstage variable ====
============================*/
PIN_Handle pin_handle;
static PIN_State DBS_rst;
// DBS reset pin
const PIN_Config BLE_IO[] = {
//
IOID_9 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
IOID_2 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
IOID_3 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
IOID_13 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
PIN_TERMINATE //
};
/**
* ADC clock switch signal.
*/
static bool adc_clock_signal = FALSE;
/*=======================================
==== headstage function declaration ====
======================================*/
static void headstage_tni_update_instruction_callback(uint8_t ins_type, uint8_t ins_op, uint8_t ins_len, uint8_t *ins);
/*=============================
==== ramp data generating ====
============================*/
static uint16_t ramp_data_counter = 0;
static void create_ramp(uint8_t *buff) {
buff[0] = 0b10110000 | (0b00001111 & (uint8_t)(ramp_data_counter >> 6));
buff[1] = (uint8_t)(ramp_data_counter << 2);
ramp_data_counter += 1;
}
/*=======================================
==== headstage function implemented ====
======================================*/
/**
* change channel value to little endian
*/
static uint8 encode_channel(uint8 channel) {
return 0x0F & (((channel & 0b1000) >> 3) | //
((channel & 0b0100) >> 1) | //
((channel & 0b0010) << 1) | //
((channel & 0b0001) << 3));
}
static void headstage_init() {
set_update_instruction_callback(headstage_tni_update_instruction_callback);
// initialize the DBS reset pin
pin_handle = PIN_open(&DBS_rst, BLE_IO);
PIN_setOutputValue(pin_handle, IOID_9, 1);
PIN_setOutputValue(pin_handle, IOID_2, 0);
PIN_setOutputValue(pin_handle, IOID_3, 0);
}
/**
* change the recording clock bit in the instruction buffer.
*/
static void update_ins_rec_clock(uint8_t *buf, bool adc_clock_signal) {
buf[3] = (buf[3] & 0b11110000) | ((adc_clock_signal) ? 0b1000 : 0);
}
/**
* change the recording channel bit in the instruction buffer.
*/
static void update_ins_rec_channel(uint8_t *buf, uint8 channel) {
buf[1] = (buf[1] & 0b00001111) | (encode_channel(channel) << 4);
}
/**
* change the stimulation enable bit in the instruction buffer.
*/
static void update_ins_sti_enable(uint8_t *buf, bool enable) {
buf[1] = (buf[1] & 0b11111101) | ((enable) ? 0b10 : 0);
}
/**
* change the stimulating channel bit in the instruction buffer.
*/
static void update_ins_sti_channel(uint8_t *buf, uint8 sti_chp, uint8 sti_chn) {
buf[2] = (buf[2] & 0b11110000) | encode_channel(sti_chp);
buf[3] = (buf[3] & 0b00001111) | (encode_channel(sti_chn) << 4);
}
static void update_ins_buffer() {
uint8 header = 0b10100000;
uint8 amp_gain = (INSTRUCTION.amp_gain & 0b11) << 3;
uint8 amp_lbf = INSTRUCTION.amp_low_band_freq & 0b111;
uint8 channel = 0; // should be call update_ins_channel to modify this value
uint8 chopper = (INSTRUCTION.chopper) ? 0b00001000 : 0;
uint8 fast_settle = (INSTRUCTION.fast_settle) ? 0b00000100 : 0;
uint8 sti_enable = (INSTRUCTION.work_mode != STI_MODE_DISABLE) ? 0b00000010 : 0;
uint8 sti_volt_l = (INSTRUCTION.sti_volt & 0b11111) >> 4;
uint8 sti_volt_h = (INSTRUCTION.sti_volt & 0b01111) << 4;
uint8 sti_chp = INSTRUCTION.sti_channel_pmos & 0b1111;
uint8 sti_chn = (INSTRUCTION.sti_channel_nmos & 0b1111) << 4;
uint8 clk_signal = 0; // should be call update_ins_clock to modify this value
spi_txbuf[0] = header | amp_gain | amp_lbf;
spi_txbuf[1] = channel | chopper | fast_settle | sti_enable | sti_volt_l;
spi_txbuf[2] = sti_volt_h | sti_chp;
spi_txbuf[3] = sti_chn | clk_signal;
}
static bool update_ins_rec_buffer() {
adc_clock_signal = (adc_clock_signal) ? FALSE : TRUE; // switch adc_clock
update_ins_rec_clock(spi_txbuf, adc_clock_signal);
if (adc_clock_signal) {
// change to next channel
if (next_active_channel()) {
update_ins_rec_channel(spi_txbuf, channel_pointer);
} else {
// no channel active
return false;
}
}
return true;
}
/**
* Change the instruction content for SPI buffer, which is depended on the
* work_mode. Expend the remind instruction according to the base instruction
* which allocated at the beginning 4 bytes of the SPI buffer.
*
* ========= ===========
* work_mode ins pattern
* ========= ===========
* POS, NEG 4 F D 0
* P2N, N2P 4 4' F D
* AWF not impl
* ========= ===========
*
* pattern *4*
* stimulation instruction.
*
* pattern *F*
* set pmos channel to 0xF, release the remain voltage in the capacitance.
*
* pattern *D*
* disable stimulation
*
* pattern *0*
* nop.
*
* @param: buf: pointer of the SPI buffer.
*/
static void update_ins_sti_buffer() {
switch (INSTRUCTION.work_mode) {
case STI_MODE_POS:
case STI_MODE_NEG:
// copy [4:7]
spi_txbuf[4] = spi_txbuf[0];
spi_txbuf[5] = spi_txbuf[1];
spi_txbuf[6] = spi_txbuf[2];
spi_txbuf[7] = spi_txbuf[3];
// copy [8:B]
spi_txbuf[8] = spi_txbuf[0];
spi_txbuf[9] = spi_txbuf[1];
spi_txbuf[10] = spi_txbuf[2];
spi_txbuf[11] = spi_txbuf[3];
// reset [C:F]
spi_txbuf[12] = 0;
spi_txbuf[13] = 0;
spi_txbuf[14] = 0;
spi_txbuf[15] = 0;
// change content
update_ins_sti_enable(spi_txbuf, TRUE);
// ins buf [4:7]
update_ins_sti_enable(spi_txbuf + 4, TRUE);
update_ins_sti_channel(spi_txbuf + 4, 0xF, INSTRUCTION.sti_channel_pmos);
// ins buf [8:B]
update_ins_sti_enable(spi_txbuf + 8, FALSE);
break;
case STI_MODE_P2N:
case STI_MODE_N2P:
// copy [4:7]
spi_txbuf[4] = spi_txbuf[0];
spi_txbuf[5] = spi_txbuf[1];
spi_txbuf[6] = spi_txbuf[2];
spi_txbuf[7] = spi_txbuf[3];
// copy [8:B]
spi_txbuf[8] = spi_txbuf[0];
spi_txbuf[9] = spi_txbuf[1];
spi_txbuf[10] = spi_txbuf[2];
spi_txbuf[11] = spi_txbuf[3];
// copy [C:F]
spi_txbuf[12] = spi_txbuf[0];
spi_txbuf[13] = spi_txbuf[1];
spi_txbuf[14] = spi_txbuf[2];
spi_txbuf[15] = spi_txbuf[3];
// change content
update_ins_sti_enable(spi_txbuf + 0, TRUE);
update_ins_sti_channel(spi_txbuf + 0, INSTRUCTION.sti_channel_pmos, INSTRUCTION.sti_channel_nmos);
// ins buf [4:7]
update_ins_sti_enable(spi_txbuf + 4, TRUE);
update_ins_sti_channel(spi_txbuf + 4, INSTRUCTION.sti_channel_nmos, INSTRUCTION.sti_channel_pmos);
// ins buf [8:B]
update_ins_sti_enable(spi_txbuf + 8, TRUE);
update_ins_sti_channel(spi_txbuf + 8, 0xF, INSTRUCTION.sti_channel_nmos);
// ins buf [C:F]
update_ins_sti_enable(spi_txbuf + 12, FALSE);
break;
case STI_MODE_AWF:
// XXX define the voltage change
break;
default:
// do nothing
break;
}
}
static void headstage_tni_update_instruction_callback(uint8_t ins_type, uint8_t ins_op, uint8_t ins_len, uint8_t *ins) {
switch (ins_type) {
case INS_TYPE_VIS: {
// reset
case VIS_RST:
// reset. reset all variable
adc_clock_signal = FALSE;
memset(spi_txbuf, 0, SPI_BUFFER_SIZE);
break;
// interrupt
case VIS_INT:
// stop. reset channel table
ramp_data_counter = 0;
memset(spi_txbuf, 0, SPI_BUFFER_SIZE);
break;
}
case INS_TYPE_RIS:
default:
break;
}
}
static uint8_t *spi_transact_rec_instruction() {
if (IS_REC_MODE(INSTRUCTION.work_mode)) {
PIN_setOutputValue(pin_handle, IOID_13, 1); // DBS_P2S turn on
headstage_spi_transaction(SPI_BUFFER_SIZE, spi_txbuf, spi_rxbuf);
PIN_setOutputValue(pin_handle, IOID_13, 0); // DBS_P2S turn off
} else if (IS_ARM_MODE(INSTRUCTION.work_mode) && !adc_clock_signal) {
create_ramp(spi_rxbuf);
}
if (adc_clock_signal) {
return NULL;
} else {
return spi_rxbuf;
}
}
static uint8_t *spi_transact_sti_instruction() {
headstage_spi_transaction(16, spi_txbuf, NULL);
return NULL;
}
#endif
@@ -0,0 +1,272 @@
/*
* impedance_meter.h
*
* Created on: 2019/01/15
* Author: benny
*/
#ifndef HEADSTAGE_H
#error "headstage.h not include"
#endif
#ifdef HEADSTAGE_H_H
#error "headstage_*.h has be included"
#endif
#ifndef IMPEDANCE_METER_H_
#define HEADSTAGE_H_H
#define IMPEDANCE_METER_H_
// header
#include <ti/drivers/PIN.h>
#include "board.h"
#include "EliteWorkData.h"
static void SimpleBLEPeripheral_performPeriodicTask(WorkMode *WorkModeData);
static void SimpleBLEPeripheral_clockHandler(UArg arg) {
// Store the event.
// events |= SBP_PERIODIC_EVT;
// Wake up the application.
// Semaphore_post(semaphore); // send samaphore to jump out of infinite waiting(simple_peripheral.c line570)
}
static void elite_gptimer_callback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_IntMask interruptMask) {
events |= SBP_PERIODIC_EVT;
Semaphore_post(semaphore);
}
static void ZM_update_instruction_callback(uint8_t ins_type, uint8_t chip_ID, uint8_t *ins);
static void ZM_init() {
set_update_instruction_callback(ZM_update_instruction_callback);
// initialize
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(GAIN_AUTO);
elite_gptimer_open();
// 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) {}
static void DACCode2Real2Notify(uint16_t DACcode) {
int32_t RealV;
RealV = DAC_to_realV(DACcode);
NotifyVolt[0] = (uint8_t)((RealV & 0xFF000000) >> 24);
NotifyVolt[1] = (uint8_t)((RealV & 0x00FF0000) >> 16);
NotifyVolt[2] = (uint8_t)((RealV & 0x0000FF00) >> 8);
NotifyVolt[3] = (uint8_t)(RealV & 0x000000FF);
}
#define IsPeriodicMode() ( \
(INSTRUCTION.eliteFxn == IV_CURVE) || \
(INSTRUCTION.eliteFxn == CV_CURVE) || \
(INSTRUCTION.eliteFxn == IT_CURVE) || \
(INSTRUCTION.eliteFxn == VT_CURVE) || \
(INSTRUCTION.eliteFxn == ZT_CURVE) || \
(INSTRUCTION.eliteFxn == CONSTANT_CURRENT) \
)
/*********************************************************************
* @fn SimpleBLEPeripheral_performPeriodicTask
*
* @brief Control periodic event such as DAC out, ADC read, and send notify.
*
* @param None.
*
* @return None.
*/
static void SimpleBLEPeripheral_performPeriodicTask(WorkMode *WorkModeData) {
if ( IsPeriodicMode() ){
// DAC counter
if (CT.StepTimeCounter == INSTRUCTION.StepTime){
CT.StepTimeCounter = 1;
}
else{
CT.StepTimeCounter++;
}
// ADC counter
if (CT.SampleRate_counter == INSTRUCTION.SampleRate){
CT.SampleRate_counter = 1;
}
else{
CT.SampleRate_counter++;
}
// notify counter
if (CT.NotifyCounter == INSTRUCTION.NotifyRate){
CT.NotifyCounter = 1;
}
else{
CT.NotifyCounter ++;
}
/** Periodic Event **/
// 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 FxnNameDACReset
// In IV, CV, and func-gen mode, DAC will output voltage
// else DAC do nothing.
EliteDACControl(WorkModeData);
// Control ADC to sample rate
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(WorkMode *WorkModeData) {
if ((INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE)) {
// output a certain voltage and put it into NotifyVolt
DACCode2Real2Notify(VoltScan(WorkModeData));
}
else if (INSTRUCTION.eliteFxn == ZT_CURVE){
if(INSTRUCTION.ResisterMeter == RESISTER_METER_SMALL){
// output 1V
if (DACReset) {
INSTRUCTION.VoltConstant = 25000 + 5000;
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoltConstant));
DACReset = false;
}
}
else{
// output 1V
if (DACReset) {
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(25000));
DACReset = false;
}
CCModeVoltOut(WorkModeData->CC);
}
else{
// IT, VT need only ADC measure
return;
}
}
static void EliteADCControl(WorkMode *WorkModeData) {
if (CT.SampleRate_counter == INSTRUCTION.SampleRate - 1) {
switch (INSTRUCTION.eliteFxn) {
case IV_CURVE:{
IT_Plot(WorkModeData);
break;
}
case CV_CURVE:{
IT_Plot(WorkModeData);
break;
}
case IT_CURVE:{
IT_Plot(WorkModeData);
break;
}
case VT_CURVE:{
// read volt through ADC and put it into notify buffer
VT_Plot(WorkModeData->VT);
break;
}
case ZT_CURVE:{
ZT_Plot(WorkModeData->RT);
break;
}
case CONSTANT_CURRENT:{
CCModeReadCurrent(WorkModeData->CC);
CCModeReverseCurrent(WorkModeData->CC);
break;
}
default:{
IT_Plot(WorkModeData);
break;
}
}
}
}
static void EliteNotifyControl() {
if ((INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE)) {
// output the last notify, and reset Elite
if (!PeriodicEvent) {
SendNotify();
reset();
} else if (CT.StepTimeCounter == INSTRUCTION.StepTime - 1) {
SendNotify();
}
}
else if(INSTRUCTION.eliteFxn == CONSTANT_CURRENT){
if(CT.NotifyCounter == INSTRUCTION.NotifyRate){
SendNotify();
}
}
else if (CT.SampleRate_counter == INSTRUCTION.SampleRate) {
SendNotify();
}
}
static uint16_t StepCode2DACcode(uint16_t StepCode){
return (StepCode * 0x0005);
}
static uint16_t OldStep2NewStepTime(uint8_t StepTime) {
uint8_t StepTimeLevel = 0;
StepTimeLevel = StepTime / 0x12;
switch (StepTimeLevel) {
case 0: { //0.5 sec
LED_color(LIGHTLED, 0xFF, 0xFF, 0xFF);
return STEPTIME_HALF_SEC;
}
case 1: { //1 sec
return STEPTIME_ONE_SEC;
}
case 2: { //2 sec
return STEPTIME_TWO_SEC;
}
default: { //1 sec
return STEPTIME_ONE_SEC;
}
}
}
#endif /* IMPEDANCE_METER_H_ */
@@ -136,7 +136,7 @@ PIN_Handle radCtrlHandle;
extern void AssertHandler(uint8 assertCause, uint8 assertSubcause);
extern Display_Handle dispHandle;
//extern Display_Handle dispHandle;
/*******************************************************************************
* @fn Main
@@ -252,47 +252,47 @@ int main()
void AssertHandler(uint8 assertCause, uint8 assertSubcause)
{
// Open the display if the app has not already done so
if ( !dispHandle )
{
dispHandle = Display_open(Display_Type_LCD, NULL);
}
// if ( !dispHandle )
// {
// dispHandle = Display_open(Display_Type_LCD, NULL);
// }
Display_print0(dispHandle, 0, 0, ">>>STACK ASSERT");
// Display_print0(dispHandle, 0, 0, ">>>STACK ASSERT");
// check the assert cause
switch (assertCause)
{
case HAL_ASSERT_CAUSE_OUT_OF_MEMORY:
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> OUT OF MEMORY!");
break;
case HAL_ASSERT_CAUSE_INTERNAL_ERROR:
// check the subcause
if (assertSubcause == HAL_ASSERT_SUBCAUSE_FW_INERNAL_ERROR)
{
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> INTERNAL FW ERROR!");
}
else
{
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> INTERNAL ERROR!");
}
break;
case HAL_ASSERT_CAUSE_ICALL_ABORT:
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> ICALL ABORT!");
HAL_ASSERT_SPINLOCK;
break;
default:
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> DEFAULT SPINLOCK!");
HAL_ASSERT_SPINLOCK;
}
// switch (assertCause)
// {
// case HAL_ASSERT_CAUSE_OUT_OF_MEMORY:
// Display_print0(dispHandle, 0, 0, "***ERROR***");
// Display_print0(dispHandle, 2, 0, ">> OUT OF MEMORY!");
// break;
//
// case HAL_ASSERT_CAUSE_INTERNAL_ERROR:
// // check the subcause
// if (assertSubcause == HAL_ASSERT_SUBCAUSE_FW_INERNAL_ERROR)
// {
// Display_print0(dispHandle, 0, 0, "***ERROR***");
// Display_print0(dispHandle, 2, 0, ">> INTERNAL FW ERROR!");
// }
// else
// {
// Display_print0(dispHandle, 0, 0, "***ERROR***");
// Display_print0(dispHandle, 2, 0, ">> INTERNAL ERROR!");
// }
// break;
//
// case HAL_ASSERT_CAUSE_ICALL_ABORT:
// Display_print0(dispHandle, 0, 0, "***ERROR***");
// Display_print0(dispHandle, 2, 0, ">> ICALL ABORT!");
// HAL_ASSERT_SPINLOCK;
// break;
//
// default:
// Display_print0(dispHandle, 0, 0, "***ERROR***");
// Display_print0(dispHandle, 2, 0, ">> DEFAULT SPINLOCK!");
// HAL_ASSERT_SPINLOCK;
// }
return;
}
@@ -9,7 +9,7 @@
Target Device: CC2650, CC2640
******************************************************************************
Copyright (c) 2010-2018, Texas Instruments Incorporated
All rights reserved.
@@ -50,14 +50,14 @@
*/
#include <string.h>
#include "bcomdef.h"
#include "osal.h"
#include "linkdb.h"
#include "att.h"
#include "bcomdef.h"
#include "gapbondmgr.h"
#include "gatt.h"
#include "gatt_uuid.h"
#include "gattservapp.h"
#include "gapbondmgr.h"
#include "linkdb.h"
#include "osal.h"
#include "simple_gatt_profile.h"
@@ -69,7 +69,7 @@
* CONSTANTS
*/
#define SERVAPP_NUM_ATTR_SUPPORTED 17
#define SERVAPP_NUM_ATTR_SUPPORTED 17
/*********************************************************************
* TYPEDEFS
@@ -79,40 +79,22 @@
* GLOBAL VARIABLES
*/
// Simple GATT Profile Service UUID: 0xFFF0
CONST uint8 simpleProfileServUUID[ATT_BT_UUID_SIZE] =
{
LO_UINT16(SIMPLEPROFILE_SERV_UUID), HI_UINT16(SIMPLEPROFILE_SERV_UUID)
};
CONST uint8 simpleProfileServUUID[ATT_BT_UUID_SIZE] = {LO_UINT16(SIMPLEPROFILE_SERV_UUID), HI_UINT16(SIMPLEPROFILE_SERV_UUID)};
// Characteristic 1 UUID: 0xFFF1
CONST uint8 simpleProfilechar1UUID[ATT_BT_UUID_SIZE] =
{
LO_UINT16(SIMPLEPROFILE_CHAR1_UUID), HI_UINT16(SIMPLEPROFILE_CHAR1_UUID)
};
CONST uint8 simpleProfilechar1UUID[ATT_BT_UUID_SIZE] = {LO_UINT16(SIMPLEPROFILE_CHAR1_UUID), HI_UINT16(SIMPLEPROFILE_CHAR1_UUID)};
// Characteristic 2 UUID: 0xFFF2
CONST uint8 simpleProfilechar2UUID[ATT_BT_UUID_SIZE] =
{
LO_UINT16(SIMPLEPROFILE_CHAR2_UUID), HI_UINT16(SIMPLEPROFILE_CHAR2_UUID)
};
CONST uint8 simpleProfilechar2UUID[ATT_BT_UUID_SIZE] = {LO_UINT16(SIMPLEPROFILE_CHAR2_UUID), HI_UINT16(SIMPLEPROFILE_CHAR2_UUID)};
// Characteristic 3 UUID: 0xFFF3
CONST uint8 simpleProfilechar3UUID[ATT_BT_UUID_SIZE] =
{
LO_UINT16(SIMPLEPROFILE_CHAR3_UUID), HI_UINT16(SIMPLEPROFILE_CHAR3_UUID)
};
CONST uint8 simpleProfilechar3UUID[ATT_BT_UUID_SIZE] = {LO_UINT16(SIMPLEPROFILE_CHAR3_UUID), HI_UINT16(SIMPLEPROFILE_CHAR3_UUID)};
// Characteristic 4 UUID: 0xFFF4
CONST uint8 simpleProfilechar4UUID[ATT_BT_UUID_SIZE] =
{
LO_UINT16(SIMPLEPROFILE_CHAR4_UUID), HI_UINT16(SIMPLEPROFILE_CHAR4_UUID)
};
CONST uint8 simpleProfilechar4UUID[ATT_BT_UUID_SIZE] = {LO_UINT16(SIMPLEPROFILE_CHAR4_UUID), HI_UINT16(SIMPLEPROFILE_CHAR4_UUID)};
// Characteristic 5 UUID: 0xFFF5
CONST uint8 simpleProfilechar5UUID[ATT_BT_UUID_SIZE] =
{
LO_UINT16(SIMPLEPROFILE_CHAR5_UUID), HI_UINT16(SIMPLEPROFILE_CHAR5_UUID)
};
CONST uint8 simpleProfilechar5UUID[ATT_BT_UUID_SIZE] = {LO_UINT16(SIMPLEPROFILE_CHAR5_UUID), HI_UINT16(SIMPLEPROFILE_CHAR5_UUID)};
/*********************************************************************
* EXTERNAL VARIABLES
@@ -133,29 +115,27 @@ static simpleProfileCBs_t *simpleProfile_AppCBs = NULL;
*/
// Simple Profile Service attribute
static CONST gattAttrType_t simpleProfileService = { ATT_BT_UUID_SIZE, simpleProfileServUUID };
static CONST gattAttrType_t simpleProfileService = {ATT_BT_UUID_SIZE, simpleProfileServUUID};
// Simple Profile Characteristic 1 Properties
static uint8 simpleProfileChar1Props = GATT_PROP_READ | GATT_PROP_WRITE;
static uint8 simpleProfileChar1Props = GATT_PROP_READ;
// Characteristic 1 Value
static uint8 simpleProfileChar1 = 0;
#define SIMPLEPROFILE_CHAR1_LEN 20
static uint8 simpleProfileChar1[SIMPLEPROFILE_CHAR1_LEN] = {0};
// Simple Profile Characteristic 1 User Description
static uint8 simpleProfileChar1UserDesp[17] = "Characteristic 1";
// Simple Profile Characteristic 2 Properties
static uint8 simpleProfileChar2Props = GATT_PROP_READ;
// Characteristic 2 Value
static uint8 simpleProfileChar2 = 0;
static uint8 simpleProfileChar2[SIMPLEPROFILE_CHAR2_LEN] = {0};
// Simple Profile Characteristic 2 User Description
static uint8 simpleProfileChar2UserDesp[17] = "Characteristic 2";
// Simple Profile Characteristic 3 Properties
static uint8 simpleProfileChar3Props = GATT_PROP_WRITE;
@@ -165,7 +145,6 @@ static uint8 simpleProfileChar3[SIMPLEPROFILE_CHAR3_LEN] = {0};
// Simple Profile Characteristic 3 User Description
static uint8 simpleProfileChar3UserDesp[17] = "Characteristic 3";
// Simple Profile Characteristic 4 Properties
static uint8 simpleProfileChar4Props = GATT_PROP_NOTIFY;
@@ -181,12 +160,11 @@ static gattCharCfg_t *simpleProfileChar4Config;
// Simple Profile Characteristic 4 User Description
static uint8 simpleProfileChar4UserDesp[17] = "Characteristic 4";
// Simple Profile Characteristic 5 Properties
static uint8 simpleProfileChar5Props = GATT_PROP_READ;
// Characteristic 5 Value
static uint8 simpleProfileChar5[SIMPLEPROFILE_CHAR5_LEN] = { 0, 0, 0, 0, 0 };
static uint8 simpleProfileChar5[SIMPLEPROFILE_CHAR5_LEN] = {0, 0, 0, 0, 0};
// Simple Profile Characteristic 5 User Description
static uint8 simpleProfileChar5UserDesp[17] = "Characteristic 5";
@@ -195,157 +173,69 @@ static uint8 simpleProfileChar5UserDesp[17] = "Characteristic 5";
* Profile Attributes - Table
*/
static gattAttribute_t simpleProfileAttrTbl[SERVAPP_NUM_ATTR_SUPPORTED] =
{
// Simple Profile Service
{
{ ATT_BT_UUID_SIZE, primaryServiceUUID }, /* type */
GATT_PERMIT_READ, /* permissions */
0, /* handle */
(uint8 *)&simpleProfileService /* pValue */
},
static gattAttribute_t simpleProfileAttrTbl[SERVAPP_NUM_ATTR_SUPPORTED] = {
// Simple Profile Service
{
{ATT_BT_UUID_SIZE, primaryServiceUUID}, /* type */
GATT_PERMIT_READ, /* permissions */
0, /* handle */
(uint8 *)&simpleProfileService /* pValue */
},
// Characteristic 1 Declaration
{
{ ATT_BT_UUID_SIZE, characterUUID },
GATT_PERMIT_READ,
0,
&simpleProfileChar1Props
},
{{ATT_BT_UUID_SIZE, characterUUID}, GATT_PERMIT_READ, 0, &simpleProfileChar1Props},
// Characteristic Value 1
{
{ ATT_BT_UUID_SIZE, simpleProfilechar1UUID },
GATT_PERMIT_READ | GATT_PERMIT_WRITE,
0,
&simpleProfileChar1
},
// Characteristic Value 1
{{ATT_BT_UUID_SIZE, simpleProfilechar1UUID}, GATT_PERMIT_READ, 0, simpleProfileChar1},
// Characteristic 1 User Description
{
{ ATT_BT_UUID_SIZE, charUserDescUUID },
GATT_PERMIT_READ,
0,
simpleProfileChar1UserDesp
},
// Characteristic 1 User Description
{{ATT_BT_UUID_SIZE, charUserDescUUID}, GATT_PERMIT_READ, 0, simpleProfileChar1UserDesp},
// Characteristic 2 Declaration
{
{ ATT_BT_UUID_SIZE, characterUUID },
GATT_PERMIT_READ,
0,
&simpleProfileChar2Props
},
{{ATT_BT_UUID_SIZE, characterUUID}, GATT_PERMIT_READ, 0, &simpleProfileChar2Props},
// Characteristic Value 2
{
{ ATT_BT_UUID_SIZE, simpleProfilechar2UUID },
GATT_PERMIT_READ,
0,
&simpleProfileChar2
},
// Characteristic Value 2
{{ATT_BT_UUID_SIZE, simpleProfilechar2UUID}, GATT_PERMIT_READ, 0, simpleProfileChar2},
// Characteristic 2 User Description
{
{ ATT_BT_UUID_SIZE, charUserDescUUID },
GATT_PERMIT_READ,
0,
simpleProfileChar2UserDesp
},
// Characteristic 2 User Description
{{ATT_BT_UUID_SIZE, charUserDescUUID}, GATT_PERMIT_READ, 0, simpleProfileChar2UserDesp},
// Characteristic 3 Declaration
{
{ ATT_BT_UUID_SIZE, characterUUID },
GATT_PERMIT_READ,
0,
&simpleProfileChar3Props
},
{{ATT_BT_UUID_SIZE, characterUUID}, GATT_PERMIT_READ, 0, &simpleProfileChar3Props},
// Characteristic Value 3
{
{ ATT_BT_UUID_SIZE, simpleProfilechar3UUID },
GATT_PERMIT_WRITE,
0,
simpleProfileChar3
},
// Characteristic Value 3
{{ATT_BT_UUID_SIZE, simpleProfilechar3UUID}, GATT_PERMIT_WRITE, 0, simpleProfileChar3},
// Characteristic 3 User Description
{
{ ATT_BT_UUID_SIZE, charUserDescUUID },
GATT_PERMIT_READ,
0,
simpleProfileChar3UserDesp
},
// Characteristic 3 User Description
{{ATT_BT_UUID_SIZE, charUserDescUUID}, GATT_PERMIT_READ, 0, simpleProfileChar3UserDesp},
// Characteristic 4 Declaration
{
{ ATT_BT_UUID_SIZE, characterUUID },
GATT_PERMIT_READ,
0,
&simpleProfileChar4Props
},
{{ATT_BT_UUID_SIZE, characterUUID}, GATT_PERMIT_READ, 0, &simpleProfileChar4Props},
// Characteristic Value 4
{
{ ATT_BT_UUID_SIZE, simpleProfilechar4UUID },
0,
0,
simpleProfileChar4
},
// Characteristic Value 4
{{ATT_BT_UUID_SIZE, simpleProfilechar4UUID}, 0, 0, simpleProfileChar4},
// Characteristic 4 configuration
{
{ ATT_BT_UUID_SIZE, clientCharCfgUUID },
GATT_PERMIT_READ | GATT_PERMIT_WRITE,
0,
(uint8 *)&simpleProfileChar4Config
},
// Characteristic 4 configuration
{{ATT_BT_UUID_SIZE, clientCharCfgUUID}, GATT_PERMIT_READ | GATT_PERMIT_WRITE, 0, (uint8 *)&simpleProfileChar4Config},
// Characteristic 4 User Description
{
{ ATT_BT_UUID_SIZE, charUserDescUUID },
GATT_PERMIT_READ,
0,
simpleProfileChar4UserDesp
},
// Characteristic 4 User Description
{{ATT_BT_UUID_SIZE, charUserDescUUID}, GATT_PERMIT_READ, 0, simpleProfileChar4UserDesp},
// Characteristic 5 Declaration
{
{ ATT_BT_UUID_SIZE, characterUUID },
GATT_PERMIT_READ,
0,
&simpleProfileChar5Props
},
{{ATT_BT_UUID_SIZE, characterUUID}, GATT_PERMIT_READ, 0, &simpleProfileChar5Props},
// Characteristic Value 5
{
{ ATT_BT_UUID_SIZE, simpleProfilechar5UUID },
GATT_PERMIT_AUTHEN_READ,
0,
simpleProfileChar5
},
// Characteristic Value 5
{{ATT_BT_UUID_SIZE, simpleProfilechar5UUID}, GATT_PERMIT_AUTHEN_READ, 0, simpleProfileChar5},
// Characteristic 5 User Description
{
{ ATT_BT_UUID_SIZE, charUserDescUUID },
GATT_PERMIT_READ,
0,
simpleProfileChar5UserDesp
},
// Characteristic 5 User Description
{{ATT_BT_UUID_SIZE, charUserDescUUID}, GATT_PERMIT_READ, 0, simpleProfileChar5UserDesp},
};
/*********************************************************************
* LOCAL FUNCTIONS
*/
static bStatus_t simpleProfile_ReadAttrCB(uint16_t connHandle,
gattAttribute_t *pAttr,
uint8_t *pValue, uint16_t *pLen,
uint16_t offset, uint16_t maxLen,
uint8_t method);
static bStatus_t simpleProfile_WriteAttrCB(uint16_t connHandle,
gattAttribute_t *pAttr,
uint8_t *pValue, uint16_t len,
uint16_t offset, uint8_t method);
static bStatus_t simpleProfile_ReadAttrCB(uint16_t connHandle, gattAttribute_t *pAttr, uint8_t *pValue, uint16_t *pLen, uint16_t offset, uint16_t maxLen, uint8_t method);
static bStatus_t simpleProfile_WriteAttrCB(uint16_t connHandle, gattAttribute_t *pAttr, uint8_t *pValue, uint16_t len, uint16_t offset, uint8_t method);
/*********************************************************************
* PROFILE CALLBACKS
@@ -359,11 +249,10 @@ static bStatus_t simpleProfile_WriteAttrCB(uint16_t connHandle,
// pfnAuthorizeAttrCB to check a client's authorization prior to calling
// pfnReadAttrCB or pfnWriteAttrCB, so no checks for authorization need to be
// made within these functions.
CONST gattServiceCBs_t simpleProfileCBs =
{
simpleProfile_ReadAttrCB, // Read callback function pointer
simpleProfile_WriteAttrCB, // Write callback function pointer
NULL // Authorization callback function pointer
CONST gattServiceCBs_t simpleProfileCBs = {
simpleProfile_ReadAttrCB, // Read callback function pointer
simpleProfile_WriteAttrCB, // Write callback function pointer
NULL // Authorization callback function pointer
};
/*********************************************************************
@@ -381,35 +270,26 @@ CONST gattServiceCBs_t simpleProfileCBs =
*
* @return Success or Failure
*/
bStatus_t SimpleProfile_AddService( uint32 services )
{
uint8 status;
bStatus_t SimpleProfile_AddService(uint32 services) {
uint8 status;
// Allocate Client Characteristic Configuration table
simpleProfileChar4Config = (gattCharCfg_t *)ICall_malloc( sizeof(gattCharCfg_t) *
linkDBNumConns );
if ( simpleProfileChar4Config == NULL )
{
return ( bleMemAllocError );
}
// Allocate Client Characteristic Configuration table
simpleProfileChar4Config = (gattCharCfg_t *)ICall_malloc(sizeof(gattCharCfg_t) * linkDBNumConns);
if (simpleProfileChar4Config == NULL) {
return (bleMemAllocError);
}
// Initialize Client Characteristic Configuration attributes
GATTServApp_InitCharCfg( INVALID_CONNHANDLE, simpleProfileChar4Config );
// Initialize Client Characteristic Configuration attributes
GATTServApp_InitCharCfg(INVALID_CONNHANDLE, simpleProfileChar4Config);
if ( services & SIMPLEPROFILE_SERVICE )
{
// Register GATT attribute list and CBs with GATT Server App
status = GATTServApp_RegisterService( simpleProfileAttrTbl,
GATT_NUM_ATTRS( simpleProfileAttrTbl ),
GATT_MAX_ENCRYPT_KEY_SIZE,
&simpleProfileCBs );
}
else
{
status = SUCCESS;
}
if (services & SIMPLEPROFILE_SERVICE) {
// Register GATT attribute list and CBs with GATT Server App
status = GATTServApp_RegisterService(simpleProfileAttrTbl, GATT_NUM_ATTRS(simpleProfileAttrTbl), GATT_MAX_ENCRYPT_KEY_SIZE, &simpleProfileCBs);
} else {
status = SUCCESS;
}
return ( status );
return (status);
}
/*********************************************************************
@@ -422,18 +302,14 @@ bStatus_t SimpleProfile_AddService( uint32 services )
*
* @return SUCCESS or bleAlreadyInRequestedMode
*/
bStatus_t SimpleProfile_RegisterAppCBs( simpleProfileCBs_t *appCallbacks )
{
if ( appCallbacks )
{
simpleProfile_AppCBs = appCallbacks;
bStatus_t SimpleProfile_RegisterAppCBs(simpleProfileCBs_t *appCallbacks) {
if (appCallbacks) {
simpleProfile_AppCBs = appCallbacks;
return ( SUCCESS );
}
else
{
return ( bleAlreadyInRequestedMode );
}
return (SUCCESS);
} else {
return (bleAlreadyInRequestedMode);
}
}
/*********************************************************************
@@ -450,77 +326,61 @@ bStatus_t SimpleProfile_RegisterAppCBs( simpleProfileCBs_t *appCallbacks )
*
* @return bStatus_t
*/
bStatus_t SimpleProfile_SetParameter( uint8 param, uint8 len, void *value )
{
bStatus_t ret = SUCCESS;
switch ( param )
{
bStatus_t SimpleProfile_SetParameter(uint8 param, uint8 len, void *value) {
bStatus_t ret = SUCCESS;
switch (param) {
case SIMPLEPROFILE_CHAR1:
if ( len == sizeof ( uint8 ) )
{
simpleProfileChar1 = *((uint8*)value);
}
else
{
ret = bleInvalidRange;
}
break;
if (len <= SIMPLEPROFILE_CHAR1_LEN) {
memcpy(simpleProfileChar1, value, len);
// simpleProfileChar1 = *((uint8*)value);
} else {
ret = bleInvalidRange;
}
break;
case SIMPLEPROFILE_CHAR2:
if ( len == sizeof ( uint8 ) )
{
simpleProfileChar2 = *((uint8*)value);
}
else
{
ret = bleInvalidRange;
}
break;
if (len <= SIMPLEPROFILE_CHAR2_LEN) {
memcpy(simpleProfileChar2, value, len);
// simpleProfileChar2 = *((uint8*)value);
} else {
ret = bleInvalidRange;
}
break;
case SIMPLEPROFILE_CHAR3:
if ( len <= SIMPLEPROFILE_CHAR3_LEN )
{
memcpy(simpleProfileChar3,value,len);
}
else
{
ret = bleInvalidRange;
}
break;
if (len <= SIMPLEPROFILE_CHAR3_LEN) {
memcpy(simpleProfileChar3, value, len);
} else {
ret = bleInvalidRange;
}
break;
case SIMPLEPROFILE_CHAR4:
if ( len <= SIMPLEPROFILE_CHAR4_LEN )
{
memcpy( simpleProfileChar4, value, len);
if (len <= SIMPLEPROFILE_CHAR4_LEN) {
memcpy(simpleProfileChar4, value, len);
// See if Notification has been enabled
GATTServApp_ProcessCharCfg( simpleProfileChar4Config, simpleProfileChar4, FALSE,
simpleProfileAttrTbl, GATT_NUM_ATTRS( simpleProfileAttrTbl ),
INVALID_TASK_ID, simpleProfile_ReadAttrCB );
}
else
{
ret = bleInvalidRange;
}
break;
// See if Notification has been enabled
GATTServApp_ProcessCharCfg(simpleProfileChar4Config, simpleProfileChar4, FALSE, simpleProfileAttrTbl, GATT_NUM_ATTRS(simpleProfileAttrTbl), INVALID_TASK_ID, simpleProfile_ReadAttrCB);
} else {
ret = bleInvalidRange;
}
break;
case SIMPLEPROFILE_CHAR5:
if ( len == SIMPLEPROFILE_CHAR5_LEN )
{
VOID memcpy( simpleProfileChar5, value, SIMPLEPROFILE_CHAR5_LEN );
}
else
{
ret = bleInvalidRange;
}
break;
if (len == SIMPLEPROFILE_CHAR5_LEN) {
VOID memcpy(simpleProfileChar5, value, SIMPLEPROFILE_CHAR5_LEN);
} else {
ret = bleInvalidRange;
}
break;
default:
ret = INVALIDPARAMETER;
break;
}
ret = INVALIDPARAMETER;
break;
}
return ( ret );
return (ret);
}
/*********************************************************************
@@ -536,37 +396,37 @@ bStatus_t SimpleProfile_SetParameter( uint8 param, uint8 len, void *value )
*
* @return bStatus_t
*/
bStatus_t SimpleProfile_GetParameter( uint8 param, void *value )
{
bStatus_t ret = SUCCESS;
switch ( param )
{
bStatus_t SimpleProfile_GetParameter(uint8 param, void *value) {
bStatus_t ret = SUCCESS;
switch (param) {
case SIMPLEPROFILE_CHAR1:
*((uint8*)value) = simpleProfileChar1;
break;
memcpy(value, simpleProfileChar1, SIMPLEPROFILE_CHAR1_LEN);
// *((uint8*)value) = simpleProfileChar1;
break;
case SIMPLEPROFILE_CHAR2:
*((uint8*)value) = simpleProfileChar2;
break;
memcpy(value, simpleProfileChar2, SIMPLEPROFILE_CHAR2_LEN);
// *((uint8*)value) = simpleProfileChar2;
break;
case SIMPLEPROFILE_CHAR3:
memcpy( value, simpleProfileChar3, SIMPLEPROFILE_CHAR3_LEN );
break;
memcpy(value, simpleProfileChar3, SIMPLEPROFILE_CHAR3_LEN);
break;
case SIMPLEPROFILE_CHAR4:
memcpy( value, simpleProfileChar4, SIMPLEPROFILE_CHAR4_LEN );
break;
memcpy(value, simpleProfileChar4, SIMPLEPROFILE_CHAR4_LEN);
break;
case SIMPLEPROFILE_CHAR5:
VOID memcpy( value, simpleProfileChar5, SIMPLEPROFILE_CHAR5_LEN );
break;
VOID memcpy(value, simpleProfileChar5, SIMPLEPROFILE_CHAR5_LEN);
break;
default:
ret = INVALIDPARAMETER;
break;
}
ret = INVALIDPARAMETER;
break;
}
return ( ret );
return (ret);
}
/*********************************************************************
@@ -584,65 +444,62 @@ bStatus_t SimpleProfile_GetParameter( uint8 param, void *value )
*
* @return SUCCESS, blePending or Failure
*/
static bStatus_t simpleProfile_ReadAttrCB(uint16_t connHandle,
gattAttribute_t *pAttr,
uint8_t *pValue, uint16_t *pLen,
uint16_t offset, uint16_t maxLen,
uint8_t method)
{
bStatus_t status = SUCCESS;
static bStatus_t simpleProfile_ReadAttrCB(uint16_t connHandle, gattAttribute_t *pAttr, uint8_t *pValue, uint16_t *pLen, uint16_t offset, uint16_t maxLen, uint8_t method) {
bStatus_t status = SUCCESS;
// Make sure it's not a blob operation (no attributes in the profile are long)
if ( offset > 0 )
{
return ( ATT_ERR_ATTR_NOT_LONG );
}
if ( pAttr->type.len == ATT_BT_UUID_SIZE )
{
// 16-bit UUID
uint16 uuid = BUILD_UINT16( pAttr->type.uuid[0], pAttr->type.uuid[1]);
switch ( uuid )
{
// No need for "GATT_SERVICE_UUID" or "GATT_CLIENT_CHAR_CFG_UUID" cases;
// gattserverapp handles those reads
// characteristics 1 and 2 have read permissions
// characteritisc 3 does not have read permissions; therefore it is not
// included here
// characteristic 4 does not have read permissions, but because it
// can be sent as a notification, it is included here
case SIMPLEPROFILE_CHAR1_UUID:
case SIMPLEPROFILE_CHAR2_UUID:
*pLen = 1;
pValue[0] = *pAttr->pValue;
break;
case SIMPLEPROFILE_CHAR4_UUID:
*pLen = SIMPLEPROFILE_CHAR4_LEN;
VOID memcpy( pValue, pAttr->pValue, SIMPLEPROFILE_CHAR4_LEN );
break;
case SIMPLEPROFILE_CHAR5_UUID:
*pLen = SIMPLEPROFILE_CHAR5_LEN;
VOID memcpy( pValue, pAttr->pValue, SIMPLEPROFILE_CHAR5_LEN );
break;
default:
// Should never get here! (characteristics 3 and 4 do not have read permissions)
*pLen = 0;
status = ATT_ERR_ATTR_NOT_FOUND;
break;
// Make sure it's not a blob operation (no attributes in the profile are long)
if (offset > 0) {
return (ATT_ERR_ATTR_NOT_LONG);
}
}
else
{
// 128-bit UUID
*pLen = 0;
status = ATT_ERR_INVALID_HANDLE;
}
return ( status );
if (pAttr->type.len == ATT_BT_UUID_SIZE) {
// 16-bit UUID
uint16 uuid = BUILD_UINT16(pAttr->type.uuid[0], pAttr->type.uuid[1]);
switch (uuid) {
// No need for "GATT_SERVICE_UUID" or "GATT_CLIENT_CHAR_CFG_UUID" cases;
// gattserverapp handles those reads
// characteristics 1 and 2 have read permissions
// characteritisc 3 does not have read permissions; therefore it is not
// included here
// characteristic 4 does not have read permissions, but because it
// can be sent as a notification, it is included here
case SIMPLEPROFILE_CHAR1_UUID:
*pLen = SIMPLEPROFILE_CHAR1_LEN;
VOID memcpy(pValue, pAttr->pValue, SIMPLEPROFILE_CHAR1_LEN);
break;
case SIMPLEPROFILE_CHAR2_UUID:
// *pLen = 1;
// pValue[0] = *pAttr->pValue;
*pLen = SIMPLEPROFILE_CHAR2_LEN;
VOID memcpy(pValue, pAttr->pValue, SIMPLEPROFILE_CHAR2_LEN);
break;
case SIMPLEPROFILE_CHAR4_UUID:
*pLen = SIMPLEPROFILE_CHAR4_LEN;
VOID memcpy(pValue, pAttr->pValue, SIMPLEPROFILE_CHAR4_LEN);
break;
// case SIMPLEPROFILE_CHAR5_UUID:
// *pLen = SIMPLEPROFILE_CHAR5_LEN;
// VOID memcpy( pValue, pAttr->pValue, SIMPLEPROFILE_CHAR5_LEN );
// break;
default:
// Should never get here! (characteristics 3 and 4 do not have read permissions)
*pLen = 0;
status = ATT_ERR_ATTR_NOT_FOUND;
break;
}
} else {
// 128-bit UUID
*pLen = 0;
status = ATT_ERR_INVALID_HANDLE;
}
return (status);
}
/*********************************************************************
@@ -659,99 +516,83 @@ static bStatus_t simpleProfile_ReadAttrCB(uint16_t connHandle,
*
* @return SUCCESS, blePending or Failure
*/
static bStatus_t simpleProfile_WriteAttrCB(uint16_t connHandle,
gattAttribute_t *pAttr,
uint8_t *pValue, uint16_t len,
uint16_t offset, uint8_t method)
{
bStatus_t status = SUCCESS;
uint8 notifyApp = 0xFF;
static bStatus_t simpleProfile_WriteAttrCB(uint16_t connHandle, gattAttribute_t *pAttr, uint8_t *pValue, uint16_t len, uint16_t offset, uint8_t method) {
bStatus_t status = SUCCESS;
uint8 notifyApp = 0xFF;
if ( pAttr->type.len == ATT_BT_UUID_SIZE )
{
// 16-bit UUID
uint16 uuid = BUILD_UINT16( pAttr->type.uuid[0], pAttr->type.uuid[1]);
switch ( uuid )
{
case SIMPLEPROFILE_CHAR1_UUID:
//Validate the value
// Make sure it's not a blob oper
if ( offset == 0 )
{
if ( len != 1 )
{
status = ATT_ERR_INVALID_VALUE_SIZE;
}
}
else
{
status = ATT_ERR_ATTR_NOT_LONG;
}
//Write the value
if ( status == SUCCESS )
{
uint8 *pCurValue = (uint8 *)pAttr->pValue;
*pCurValue = pValue[0];
if( pAttr->pValue == &simpleProfileChar1 )
{
notifyApp = SIMPLEPROFILE_CHAR1;
}
}
break;
case SIMPLEPROFILE_CHAR3_UUID:
if ( offset == 0 )
{
if ( len > SIMPLEPROFILE_CHAR3_LEN )
if (pAttr->type.len == ATT_BT_UUID_SIZE) {
// 16-bit UUID
uint16 uuid = BUILD_UINT16(pAttr->type.uuid[0], pAttr->type.uuid[1]);
switch (uuid) {
// Validate the value
// Make sure it's not a blob oper
/*
if ( offset == 0 )
{
status = ATT_ERR_INVALID_VALUE_SIZE;
if ( len != 1 )
{
status = ATT_ERR_INVALID_VALUE_SIZE;
}
}
}
else
{
status = ATT_ERR_ATTR_NOT_LONG;
}
//Write the value
if ( status == SUCCESS )
{
// Copy pValue into the variable we point to from the attribute table.
memcpy(pAttr->pValue + offset, pValue, len);
if( pAttr->pValue == simpleProfileChar3 )
else
{
notifyApp = SIMPLEPROFILE_CHAR3;
status = ATT_ERR_ATTR_NOT_LONG;
}
}
break;
case GATT_CLIENT_CHAR_CFG_UUID:
status = GATTServApp_ProcessCCCWriteReq( connHandle, pAttr, pValue, len,
offset, GATT_CLIENT_CFG_NOTIFY );
break;
//Write the value
if ( status == SUCCESS )
{
uint8 *pCurValue = (uint8 *)pAttr->pValue;
*pCurValue = pValue[0];
default:
// Should never get here! (characteristics 2 and 4 do not have write permissions)
status = ATT_ERR_ATTR_NOT_FOUND;
break;
if( pAttr->pValue == &simpleProfileChar1 )
{
notifyApp = SIMPLEPROFILE_CHAR1;
}
}
break;
*/
case SIMPLEPROFILE_CHAR3_UUID:
if (offset == 0) {
if (len > SIMPLEPROFILE_CHAR3_LEN) {
status = ATT_ERR_INVALID_VALUE_SIZE;
}
} else {
status = ATT_ERR_ATTR_NOT_LONG;
}
// Write the value
if (status == SUCCESS) {
// Copy pValue into the variable we point to from the attribute table.
memcpy(pAttr->pValue + offset, pValue, len);
memset(pAttr->pValue + len, 0, SIMPLEPROFILE_CHAR3_LEN - len);
if (pAttr->pValue == simpleProfileChar3) {
notifyApp = SIMPLEPROFILE_CHAR3;
}
}
break;
case GATT_CLIENT_CHAR_CFG_UUID:
status = GATTServApp_ProcessCCCWriteReq(connHandle, pAttr, pValue, len, offset, GATT_CLIENT_CFG_NOTIFY);
break;
default:
// Should never get here! (characteristics 2 and 4 do not have write permissions)
status = ATT_ERR_ATTR_NOT_FOUND;
break;
}
} else {
// 128-bit UUID
status = ATT_ERR_INVALID_HANDLE;
}
}
else
{
// 128-bit UUID
status = ATT_ERR_INVALID_HANDLE;
}
// If a characteristic value changed then callback function to notify application of change
if ( (notifyApp != 0xFF ) && simpleProfile_AppCBs && simpleProfile_AppCBs->pfnSimpleProfileChange )
{
simpleProfile_AppCBs->pfnSimpleProfileChange( notifyApp );
}
// If a characteristic value changed then callback function to notify application of change
if ((notifyApp != 0xFF) && simpleProfile_AppCBs && simpleProfile_AppCBs->pfnSimpleProfileChange) {
simpleProfile_AppCBs->pfnSimpleProfileChange(notifyApp);
}
return ( status );
return (status);
}
/*********************************************************************
@@ -334,7 +334,7 @@ bStatus_t SimpleProfile_RegisterAppCB(simpleProfileWrite_t writeCB,
* @param value - pointer to data to write. This is dependent on
* the parameter ID and WILL be cast to the appropriate
* data type (example: data type of uint16 will be cast to
* uint16 pointer).
* uint16 pointer).1
*
* @return bStatus_t
*/
@@ -85,8 +85,9 @@ extern "C"
// Length of Characteristic 5 in bytes
#define SIMPLEPROFILE_CHAR5_LEN 5
#define SIMPLEPROFILE_CHAR4_LEN 8
#define SIMPLEPROFILE_CHAR3_LEN 8
#define SIMPLEPROFILE_CHAR4_LEN 20
#define SIMPLEPROFILE_CHAR3_LEN 20
#define SIMPLEPROFILE_CHAR2_LEN 20
/*********************************************************************
* TYPEDEFS
@@ -97,7 +98,7 @@ extern "C"
* MACROS
*/
/*********************************************************************
/*********************************************************************c
* Profile Callbacks
*/
View File

Some files were not shown because too many files have changed in this diff Show More