Compare commits

...

184 Commits

Author SHA1 Message Date
Roy c1f6b5be01 add BOARD_F098 & BOARD_F068 calibration data 2021-12-16 17:33:49 +08:00
Benny Liu 415a54a931 Update BOARD_F09F & F057 calibration data. 2021-12-16 17:33:45 +08:00
Benny Liu bbfa490dca Update BOARD_F057 calibration data. 2021-12-16 17:33:42 +08:00
Roy 9f031431f8 Update BOARD_F09F calibration data. 2021-12-16 17:33:39 +08:00
Benny Liu f482f6fa9e Update BOARD_F057 calibration data. 2021-12-16 17:33:37 +08:00
Roy 3729a4caac add BOARD_F09F calibration data 2021-12-16 17:33:34 +08:00
Roy c2c21d12bc add BOARD_EDA9 & BOARD_F0D6 calibration data 2021-12-16 17:33:28 +08:00
Roy 0d5608c8dd update BOARD_F0C0 calibration data 2021-12-16 17:33:22 +08:00
Roy 11e51b267e update BOARD_EF20 calibration data 2021-12-16 17:33:19 +08:00
Roy 34512001da update BOARD_F01C calibration data 2021-12-16 17:33:15 +08:00
Roy 31345f66d7 add BOARD_F0C0 calibration data 2021-12-16 17:33:11 +08:00
Roy 3316a24d41 add BOARD_F01C calibration data 2021-12-16 17:32:24 +08:00
Roy ea904f1be5 update dpv mode 2021-11-10 17:58:04 +08:00
Roy 93f1bc3cba fix CURVE_DPV_SMPRATE mode led 2021-11-01 17:20:14 +08:00
Roy ceec1dc934 add BOARD_F057 calibration data 2021-11-01 17:18:23 +08:00
Roy 3b11f4b166 new dpv mode v.1 2021-10-29 19:01:32 +08:00
Roy d2f4e80ac7 add BOARD_EF20 calibration data 2021-10-26 13:23:14 +08:00
Roy 6de9d27c10 new dpv mode 2021-10-26 13:19:09 +08:00
Roy 853f1a588e update FINISH_MODE_INS 2021-10-07 15:39:19 +08:00
Roy 9c7cd4deae update device name 2021-10-06 16:14:17 +08:00
Roy cb5fb2ace3 add BOARD_ECDB & BOARD_C81C calibration data 2021-09-29 12:49:25 +08:00
Roy 5dc38146b8 add BOARD_EFD8 calibration data 2021-09-22 18:32:43 +08:00
Benny Liu 785358ea83 Update F08F calibration value 2021-09-16 16:22:26 +08:00
Roy ecc6841a05 update BOARD_EF30 & EE3A & ED21 & EF50 calibration data 2021-09-14 23:08:31 +08:00
Roy 5b2889cbc7 don't update Iin channel when change gain 2021-09-09 18:01:12 +08:00
Roy f638c872ad add BOARD_EF30 & BOARD_EF50 calibration data 2021-09-03 15:19:31 +08:00
Roy a0ddb1f13b cal impedance use Vout_set for RT 2021-09-01 18:03:07 +08:00
Roy cfe3aacfc5 fix change Iin gain damping 2021-08-25 14:18:34 +08:00
Roy f38c99a226 VT mode use Iin_Vin_Plot and send Iin & Vin 2021-08-24 16:33:41 +08:00
Roy b958536d96 fix realtime instruction 2021-08-20 16:19:10 +08:00
Roy 489047b7f6 annotation 2021-08-20 11:19:38 +08:00
Roy 9138b93e80 update all mode data 2021-08-19 13:33:04 +08:00
Roy cdec2f5134 update CV & CA & LSV data 2021-08-17 13:57:42 +08:00
Benny Liu 9f5f87d3bd Update BOARD_C5AF & BOARD_F08F calibration data 2021-08-12 18:20:50 +08:00
Roy 39280c1bce CV.LSV.CA Vscan is Vset - Vin 2021-08-12 11:14:14 +08:00
Roy 565c415762 notify cycle in CV mode 2021-08-05 09:35:19 +08:00
Roy 97adad6ef1 take away read bettery in CURVE_UNI_PULSE mode 2021-08-02 12:53:30 +08:00
Roy 6cdbd35a8a update CURVE_UNI_PULSE mode 2021-07-23 19:13:15 +08:00
Roy 04d4af4cad change in sequence of IT_plot & VT_plot 2021-07-22 10:28:12 +08:00
Roy 7a0691a221 sort out code (correction.h) 2021-07-21 14:15:23 +08:00
Roy e420b535d7 update adc relation function 2021-07-20 18:53:03 +08:00
Roy 568489d39e update LED_DEV_TEST 2021-07-20 18:10:34 +08:00
Roy 95cf4a7f73 fix CIS return date (insert data length) 2021-07-20 17:29:22 +08:00
Roy 1d0ab06900 sort out code 2021-07-15 18:36:25 +08:00
Roy 52dd0e8585 sort out code 2021-07-15 16:02:11 +08:00
Roy 0749a7390d multi channel separate from Iin, and calculate average skip 10ms 2021-07-15 13:28:24 +08:00
Roy baa0894240 fix leadtime & vscantime 2021-07-12 23:22:08 +08:00
Roy e29e5f4127 update OCP highz instruction 2021-07-12 16:01:47 +08:00
Roy ca4a265b65 improve mode instruction, and change it & rt & vo volt anytime 2021-07-09 16:10:33 +08:00
Roy 0aea99cb2f chart ugly 2021-07-07 18:46:16 +08:00
Roy 33f2e77ed9 new uni_pulse mode 2021-07-07 15:41:03 +08:00
Benny Liu 34838a793f Combine battery voltage and CC2650 temperature measurement. 2021-07-06 14:57:25 +08:00
Benny Liu 9a87a5316f Add over temperature protection check. 2021-07-05 16:23:11 +08:00
Benny Liu a23235085d Add Temperature sensing function. (Not done yet) 2021-07-05 14:00:48 +08:00
Benny Liu 78cc816ba3 Run Iin_Vin_Vout_plot() at CURVE_IT. 2021-07-02 11:22:28 +08:00
Benny Liu 2ff582a0c5 Merge branch 'Elite1.5_Vout_in_RT_0628' into Elite1.5
# Conflicts:
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/Elite_mode_ADC_DAC.h
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage.h
2021-07-02 10:14:16 +08:00
Roy 23d16b37dc modulize ADC.h 2021-07-01 19:02:23 +08:00
Roy 5eb08c48e5 modulize ADC.h 2021-07-01 15:52:09 +08:00
Roy 8d9d9a4955 optimize auto gain changer 2021-07-01 15:50:33 +08:00
Benny Liu c5d487f7c7 Set Vout voltage and send notify at IT mode. 2021-06-30 13:56:39 +08:00
Roy cfa28f9d7d modify IV.CV notify 2021-06-28 18:18:24 +08:00
Benny Liu d44843d525 Add parameter from UI. 2021-06-28 17:10:18 +08:00
Benny Liu 43d2623eb2 RT mode output 0.1V 2021-06-28 16:39:44 +08:00
Roy be8a39694e take away Old boundary 2021-06-28 12:13:22 +08:00
Roy 6f6fd80488 take away Old boundary 2021-06-28 11:58:51 +08:00
Roy cfd06ea0ea modify SIMPLEPROFILE_CHAR4_LEN 60 to 20 2021-06-22 16:46:33 +08:00
Roy faff6a229a nothing 2021-06-18 16:38:45 +08:00
Benny Liu aa5d0be31e Add calibration coeff. and offset for Vout_volt 2021-06-18 13:28:57 +08:00
Benny Liu 376d1777ba Add calibration Vout plot and device correction parameter for Vout_in 2021-06-18 11:50:36 +08:00
Roy 12241635a3 [update] update CURVE_CALI_ADC 2021-06-17 12:18:24 +08:00
Roy 18eba87064 [update] update OCP mode & merge vscan_volt 2021-06-17 11:48:18 +08:00
Roy d313f48eaa [update] new OCP mode and centralized notify 2021-06-16 22:32:54 +08:00
Roy 117336020f [update] new Vout_Plot 2021-06-15 14:03:49 +08:00
Roy cf3172f99a [update] update Elite_mode_ADC_DAC file 2021-06-09 14:28:16 +08:00
Roy 8b32a6d2d1 [cali] add BOARD_F08F & E774 & ED21 & EE3A & F010 & EEEF calibration data. 2021-06-07 15:27:44 +08:00
Roy 3e7d3abed7 [update] change to ELITE_PIN_1_5_RE version 2021-05-25 10:12:33 +08:00
Roy 6ac29b48c2 [update] change to ELITE_PIN_1_5_RE 2021-05-25 09:56:56 +08:00
Roy d0d83e6ae6 [cali] add BOARD_C5AF & C6E7 & ED49 calibration data. 2021-05-25 09:36:48 +08:00
Roy 0e181aaa07 [cali] add BOARD_C68B & ED5A & C705 & C6EF calibration data. 2021-05-21 15:32:40 +08:00
Roy a7b0b3965c RT send resister in denomination of mOhm to controller 2021-04-19 10:18:13 +08:00
Roy dbbb44e0d2 new sps on IT.VT.RT.CC.VOUT mode 2021-04-14 09:28:08 +08:00
Roy 156927e8f9 new sps on IT.VT.RT.CC.VOUT mode 2021-04-13 11:31:27 +08:00
Roy daab3bed0b GPtimer CLOCK_FREQ 4800 -> 4769 2021-04-12 09:37:02 +08:00
Roy 7c6d7c68de CC MODE deltaV = 10mV 2021-04-09 16:23:10 +08:00
Roy eff1e4a43e new 1.5re pin (use define) 2021-04-09 10:48:25 +08:00
Roy 9678266e59 fix RT (no 10 ohm) 2021-04-08 14:10:31 +08:00
Roy 6f74dc2c05 datalength extension:60bytes 2021-04-08 11:07:44 +08:00
Roy 910576ac6d datalength extension 200 bytes 2021-03-31 10:19:35 +08:00
Roy 9377dc517f battery < 3V when running mode, don't close elite 2021-03-16 14:25:21 +08:00
Roy e44d3d8e60 adjusted cc value 2021-03-16 11:24:45 +08:00
Roy f5416d5e1f measure battery when run mode 2021-03-15 15:44:47 +08:00
Roy 0d60074697 send mode finish flag 2021-03-12 12:12:24 +08:00
Roy 3c74358634 update notify rate 2021-03-10 17:25:12 +08:00
Roy 398f9977b8 add debug battery func 2021-03-08 10:05:53 +08:00
Roy 89db7e4575 don't measure battery when run mode 2021-03-08 10:01:46 +08:00
Roy 2b99b96f0f don't measure battery when run mode 2021-03-05 12:15:47 +08:00
Roy 1b67c809a9 open highz when finish experiment 2021-03-05 11:55:07 +08:00
Roy 59aac611f6 open highz when finish experiment 2021-03-05 11:31:14 +08:00
Roy 6f5baf38ce open highz when finish experiment 2021-03-05 10:29:20 +08:00
Roy 05f8eb4c51 change vin level when open elite, battery value is right 2021-03-04 11:48:12 +08:00
Roy 9bd536bb68 [update] don't meas battery when no reriodicEvent 2021-01-28 11:06:08 +08:00
Roy 81d9aaab1f [update] organize code 2021-01-28 10:41:45 +08:00
Roy 341c5939ac [update] organize code 2021-01-27 17:45:43 +08:00
Roy c50c0b4dec [update] close highz & set DAC value in pre-treated (100ms) 2021-01-27 15:03:39 +08:00
Roy 1639eddc6d [update] free malloc when change mode 2021-01-26 18:08:27 +08:00
Roy cc50bbc0a4 [update] pulse module 2021-01-26 16:08:24 +08:00
Roy 913d269a32 [update] ca module 2021-01-26 15:44:26 +08:00
Roy 5938d6645f [update] lsv module 2021-01-26 15:33:02 +08:00
Roy 3fda9fff6c [update] cv module 2021-01-26 15:16:30 +08:00
Roy 6f6346ac45 Merge branch 'Elite1.5_dev_module_0125_4' into Elite1.5_dev_module_0125_5 2021-01-26 13:42:36 +08:00
Roy 4ca15b1ec9 [update] open highz when elite int() & reset() 2021-01-26 13:40:38 +08:00
Roy 4c0cdcbfe9 [update] cc module 2021-01-26 12:30:46 +08:00
Roy ccb6939b34 [update] iv_cy module 2021-01-26 11:59:48 +08:00
Roy 27baa87562 [update] iv module 2021-01-26 11:12:00 +08:00
Roy ea862012b8 Merge branch 'Elite1.5_dev_module_0125_3' into Elite1.5_dev_module_0125_4 2021-01-26 10:53:44 +08:00
Roy d8c0d5e420 [update] open highz when elite turn on 2021-01-26 10:45:41 +08:00
Roy 43c606577a [update] rt module 2021-01-26 10:40:05 +08:00
Roy 72a64479d4 [update] vo module 2021-01-25 18:29:35 +08:00
Roy c6b45ecca4 [update] it module 2021-01-25 17:56:09 +08:00
Roy 11d828bfc7 [update] vt module 2021-01-25 17:12:09 +08:00
Roy 79bca317c2 [update] vt module 2021-01-25 17:02:32 +08:00
Roy ea254423d6 [cali] add BOARD_C5CD calibration data. 2021-01-25 10:47:06 +08:00
Roy f151d5a74d [update] fix CC mode 2021-01-25 10:18:40 +08:00
Roy 5cc2d878be [update] fix Vout mode 2021-01-22 18:31:31 +08:00
Roy 18eeeec7cc [update] update cycle 8bit to 16bit 2021-01-22 18:20:08 +08:00
Roy 81d753b5f0 [update] fix RT mode 2021-01-17 17:40:30 +08:00
Roy 0841d08972 [update] fix Vout mode (ok) 2021-01-11 23:35:43 +08:00
Roy de5bb460fc [update] fix WM (not ok) 2021-01-11 00:47:35 +08:00
Roy eb45ca6d81 [update] test struct ok 2021-01-08 18:05:27 +08:00
Roy b0d2697c92 [update] test struct fail 2021-01-08 12:27:28 +08:00
Roy 0dc0b66234 [update] test struct fail 2021-01-08 10:39:49 +08:00
Roy 11da60ab8f test struct 2021-01-08 00:42:28 +08:00
Roy 41c7db8776 [update] test TT-CURVE 2021-01-07 18:22:26 +08:00
Roy 916a8f5dc7 [update] fix Cycle I-V cycle 2021-01-05 11:08:06 +08:00
Roy 25cc8b16fa [update] fix CV3 cycle 2021-01-05 10:31:08 +08:00
Roy 67bf8b67dd [cali] add BOARD_C797 & BOARD_C639 calibration data. 2020-12-31 09:40:38 +08:00
Roy 13dfdbd502 [update] fix problem for change level 2020-12-30 16:36:16 +08:00
Roy e0ae30d40d [update] add dark led fun() 2020-12-29 11:45:09 +08:00
Roy 2c3a0a7ee8 [cali] add BOARD_C615 & BOARD_C78B calibration data. 2020-12-29 10:43:51 +08:00
Benny Liu f1086df363 turn on 6994 shutdown 2020-12-17 12:40:07 +08:00
Roy 6345ee875a [cali] add BOARD_C60C calibration data. 2020-12-16 09:59:21 +08:00
Roy 69061f9afd [cali] add BOARD_C903 calibration data. 2020-12-15 10:00:58 +08:00
Roy 3aecb50b47 [cali] add BOARD_C69F calibration data. 2020-12-14 18:37:01 +08:00
Roy e030578fd8 [update] update headstage version on elite1.5 (0,2,1,6) 2020-12-10 17:16:37 +08:00
Roy c05fefe71c Merge branch 'Elite1.5_developement_testmode1210' into Elite1.5_developement 2020-12-10 17:04:31 +08:00
Roy 177b56e8f9 [update] update pulsemode on elite1.5 2020-12-10 17:03:08 +08:00
Benny Liu aeb7a8afaf cali_count_max = 5000 for smallest Vin and Iin gain 2020-12-10 15:53:35 +08:00
Roy 0edaa77857 [update] match 1.5 ui (cali code) 2020-12-04 11:28:33 +08:00
Roy c656eebcbc [update] align notify (match megafly ui) 2020-11-26 22:48:53 +08:00
Roy e17e78bc18 [update] add Vout boundary (usc) 2020-11-26 16:14:31 +08:00
Benny Liu c3235e985f Change 1.5 Iin measurement range. 2020-11-26 15:48:01 +08:00
Roy 656e0fb485 [cali] update BOARD_C7A1 calibration data. 2020-11-23 12:12:09 +08:00
Roy d3dd5270dd [update] tag controller version 2020-11-23 10:18:46 +08:00
Roy e588b30c8b [update] monitor bat 2020-11-20 14:45:21 +08:00
Roy d3f9aec31c add BOARD_C604 calibration data. 2020-11-20 11:50:17 +08:00
Roy ed617c88c9 [update] remove megafly pin 2020-11-20 11:14:01 +08:00
Roy 0b8f4c2414 Merge branch 'Elite1.5_developement_magafly_1119_1' into Elite1.5_developement 2020-11-20 11:08:51 +08:00
Roy b5449b7404 [update]update pulsefly INSTRUCTION.notifyRate 2020-11-20 11:06:12 +08:00
Roy a3c1241f38 Merge branch 'Elite1.5_calibration' into Elite1.5_developement 2020-11-20 11:01:45 +08:00
Roy bbf60ebfed test periodicEvent 2020-11-19 16:00:51 +08:00
Roy 0e9f40bdd5 Megafly trigger yes yes. 2020-11-19 15:47:07 +08:00
Roy e32897f6b5 [update] Megafly notify check. & Megafly trigger. 2020-11-19 15:40:12 +08:00
Roy 6ee4b47d90 [update]update pulsefly INSTRUCTION.notifyRate 2020-11-18 11:57:53 +08:00
YiChin dac19f62b2 test ok,but T2~T3=0 can't handle 2020-11-16 14:43:50 +08:00
YiChin 8e6d112729 test ok,but T2~T3=0 can't handle 2020-11-16 14:30:27 +08:00
YiChin 9e1dc1e3f4 test ok,but T1~T5=0 can't handle 2020-11-13 18:28:48 +08:00
YiChin 49fb3afc01 test ok,but T1~T5=0 can't handle 2020-11-13 13:30:47 +08:00
YiChin f3b402fce9 test ok 2020-11-12 18:01:32 +08:00
YiChin ef9a38d7fc test not ok(RT not ok) 2020-11-12 17:24:04 +08:00
YiChin 67275a7921 test not ok(RT not ok) 2020-11-12 16:17:15 +08:00
YiChin 0ddaa02414 test not ok 2020-11-12 15:39:44 +08:00
YiChin 96d5735164 test not ok 2020-11-12 14:55:28 +08:00
YiChin ac32fb9c73 test not ok 2020-11-12 12:23:14 +08:00
Benny Liu 9acc242ff6 Add Megafly pin. 2020-11-12 10:22:31 +08:00
YiChin d8a403c410 add BOARD_C771 calibration data. 2020-11-12 10:18:12 +08:00
YiChin f1d0acef23 update pulse mode 2020-11-12 10:16:40 +08:00
YiChin 9811572f47 add pulse mode 2020-11-11 16:44:49 +08:00
YiChin 8753e2ddc6 dont send battery information 2020-10-22 10:38:09 +08:00
YiChin f6167c25ca update SPI hold & take away AutoGainChangeVout() 2020-10-20 18:41:00 +08:00
YiChin cb3894712e take away AutoGainChangeVout() 2020-10-20 18:23:13 +08:00
YiChin 995a47e200 update SPI hold 2020-10-20 17:11:36 +08:00
YiChin cde9096018 update SPI hold 2020-10-20 12:18:29 +08:00
YiChin 6c1bd24b92 update SPI hold 2020-10-19 18:40:35 +08:00
YiChin 0c129bc99b take away bat() 2020-09-25 09:43:39 +08:00
47 changed files with 6498 additions and 3806 deletions
+2 -1
View File
@@ -5,4 +5,5 @@ xdctools_*/
ccsv8/
# CSS build files
FlashROM/
FlashROM/
/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_central/ccs/app/.xdchelp
@@ -0,0 +1,3 @@
eclipse.preferences.version=1
inEditor=false
onBuild=false
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker
@@ -0,0 +1,32 @@
eclipse.preferences.version=1
encoding//FlashROM/Application/subdir_rules.mk=UTF-8
encoding//FlashROM/Application/subdir_vars.mk=UTF-8
encoding//FlashROM/Drivers/Display/subdir_rules.mk=UTF-8
encoding//FlashROM/Drivers/Display/subdir_vars.mk=UTF-8
encoding//FlashROM/Drivers/ECC/subdir_rules.mk=UTF-8
encoding//FlashROM/Drivers/ECC/subdir_vars.mk=UTF-8
encoding//FlashROM/Drivers/PIN/subdir_rules.mk=UTF-8
encoding//FlashROM/Drivers/PIN/subdir_vars.mk=UTF-8
encoding//FlashROM/Drivers/RF/subdir_rules.mk=UTF-8
encoding//FlashROM/Drivers/RF/subdir_vars.mk=UTF-8
encoding//FlashROM/Drivers/SPI/subdir_rules.mk=UTF-8
encoding//FlashROM/Drivers/SPI/subdir_vars.mk=UTF-8
encoding//FlashROM/Drivers/TRNG/subdir_rules.mk=UTF-8
encoding//FlashROM/Drivers/TRNG/subdir_vars.mk=UTF-8
encoding//FlashROM/Drivers/UART/subdir_rules.mk=UTF-8
encoding//FlashROM/Drivers/UART/subdir_vars.mk=UTF-8
encoding//FlashROM/Drivers/UDMA/subdir_rules.mk=UTF-8
encoding//FlashROM/Drivers/UDMA/subdir_vars.mk=UTF-8
encoding//FlashROM/ICall/subdir_rules.mk=UTF-8
encoding//FlashROM/ICall/subdir_vars.mk=UTF-8
encoding//FlashROM/ICallBLE/subdir_rules.mk=UTF-8
encoding//FlashROM/ICallBLE/subdir_vars.mk=UTF-8
encoding//FlashROM/PROFILES/subdir_rules.mk=UTF-8
encoding//FlashROM/PROFILES/subdir_vars.mk=UTF-8
encoding//FlashROM/Startup/subdir_rules.mk=UTF-8
encoding//FlashROM/Startup/subdir_vars.mk=UTF-8
encoding//FlashROM/TOOLS/subdir_rules.mk=UTF-8
encoding//FlashROM/TOOLS/subdir_vars.mk=UTF-8
encoding//FlashROM/makefile=UTF-8
encoding//FlashROM/objects.mk=UTF-8
encoding//FlashROM/sources.mk=UTF-8
@@ -0,0 +1,3 @@
eclipse.preferences.version=1
inEditor=false
onBuild=false
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker
@@ -34,17 +34,17 @@
<listOptionValue builtIn="false" value="LINK_ORDER=TOOLS/ccs_linker_defines.cmd;TOOLS/cc26xx_app.cmd;"/>
<listOptionValue builtIn="false" value="RTSC_MBS_VERSION=2.2.0"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.277675815" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="18.1.4.LTS" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.277675815" 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.1593934674" name="Platform" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug"/>
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug.632414212" name="GNU Make.FlashROM" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug"/>
<builder buildPath="${BuildDirectory}" id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug.632414212" 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.154623462" name="ARM Compiler" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.974280107" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.7M3" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.1783826131" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.16" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.1536570599" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.eabi" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN.1895413316" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.322983319" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.4" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.1305400753" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.0" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH.1468985930" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.974280107" 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.1783826131" 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.1536570599" 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.1895413316" 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.322983319" 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.1305400753" 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.1468985930" name="Add dir to #include search path (--include_path, -I)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH" valueType="includePath">
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
<listOptionValue builtIn="false" value="C:\ti\simplelink\ble_sdk_2_02_02_25\src\examples\simple_peripheral\cc26xx\app\headstage"/>
<listOptionValue builtIn="false" value="${SRC_EX}/examples/simple_peripheral/cc26xx/app"/>
@@ -70,7 +70,7 @@
<listOptionValue builtIn="false" value="${SRC_BLE_CORE}/rom"/>
<listOptionValue builtIn="false" value="${CC26XXWARE}"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.1897088" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.1897088" name="Pre-define NAME (--define, -D)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE" valueType="definedSymbols">
<listOptionValue builtIn="false" value="BOARD_DISPLAY_EXCLUDE_UART"/>
<listOptionValue builtIn="false" value="POWER_SAVING"/>
<listOptionValue builtIn="false" value="BOOSTXL_CC2650MA"/>
@@ -86,19 +86,19 @@
<listOptionValue builtIn="false" value="xdc_runtime_Assert_DISABLE_ALL"/>
<listOptionValue builtIn="false" value="xdc_runtime_Log_DISABLE_ALL"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.871011287" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.SYMDEBUG__DWARF" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.863089168" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.C99" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GCC.1454248503" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GCC" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS.1965115059" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.871011287" 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.863089168" 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.1454248503" 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.1965115059" name="Suppress diagnostic &lt;id&gt; (--diag_suppress, -pds)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS" valueType="stringList">
<listOptionValue builtIn="false" value="48"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.1638011093" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.1638011093" name="Treat diagnostic &lt;id&gt; as warning (--diag_warning, -pdsw)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING" valueType="stringList">
<listOptionValue builtIn="false" value="225"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.1920170652" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.off" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER.2038786257" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS.811478344" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS.on" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE.1229809338" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.1920170652" 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.2038786257" 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.811478344" 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.1229809338" name="Read options from specified file (--cmd_file, -@)" 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"/>
@@ -109,48 +109,48 @@
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.463094612" name="Assembly Sources" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.1351821865" name="ARM Linker" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE.174129193" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE" value="256" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE.567300083" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE" value="0" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE.1800982811" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE" value="&quot;${ProjName}.map&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE.1091211742" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE" value="${ProjName}.out" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY.1479599481" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY" valueType="libs">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE.174129193" 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.567300083" 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.1800982811" 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.1091211742" 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.1479599481" name="Include library file or command file as input (--library, -l)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY" valueType="libs">
<listOptionValue builtIn="false" value="libc.a"/>
<listOptionValue builtIn="false" value="${CC26XXWARE}/driverlib/bin/ccs/driverlib.lib"/>
<listOptionValue builtIn="false" value="${ROM}/common_rom_releases/03282014/common_rom.symbols"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.672837228" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH" valueType="libPaths">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.672837228" 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">
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/lib"/>
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.544523272" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS" valueType="stringList">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.544523272" name="Suppress diagnostic &lt;id&gt; (--diag_suppress)" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS" valueType="stringList">
<listOptionValue builtIn="false" value="10247-D"/>
<listOptionValue builtIn="false" value="16002-D"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1281207998" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.off" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER.468817864" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER" value="true" valueType="boolean"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO.1679096029" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO" value="&quot;${ProjName}_linkInfo.xml&quot;" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.254835397" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.on" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.1848192295" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.on" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1281207998" 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.468817864" 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.1679096029" 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.254835397" 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.1848192295" 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.1999849945" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS.25027104" name="Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS"/>
<inputType id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS.888093741" name="Generated Linker Command Files" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS"/>
</tool>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.19288898" name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.11734737" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH" value="8" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH.466140455" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH" value="8" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.824070691" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT" value="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.INTEL" valueType="enumerated"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.11734737" 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.466140455" 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.824070691" 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>
<tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.1392704063" name="XDCtools" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.225737408" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.225737408" name="Package repositories (--xdcpath)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH" valueType="stringList">
<listOptionValue builtIn="false" value="${COM_TI_RTSC_TIRTOSCC13XX_CC26XX_REPOS}"/>
<listOptionValue builtIn="false" value="${TARGET_CONTENT_BASE}"/>
</option>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.571281110" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET" value="ti.targets.arm.elf.M3" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.205178830" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM" value="ti.platforms.simplelink:CC2640F128" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.1097777495" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW" value="ti.platforms.simplelink:CC2640F128" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.744121344" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE" value="release" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.165807018" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR" value="${CG_TOOL_ROOT}" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS.391961861" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS" value="&quot;${COMPILER_FLAGS}&quot;" valueType="string"/>
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.571281110" 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.205178830" 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.1097777495" 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.744121344" 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.165807018" 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.391961861" name="Additional compiler options (--compileOptions)" superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS" value="&quot;${COMPILER_FLAGS}&quot;" valueType="string"/>
</tool>
</toolChain>
</folderInfo>
@@ -3,16 +3,20 @@
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_DEBUGGER_PROPERTIES.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS100v3 USB Debug Probe_0/Cortex_M3_0" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot; ?&gt;&#10;&lt;PropertyValues&gt;&#10;&#10; &lt;property id=&quot;ConnectOnStartup&quot;&gt;&#10; &lt;curValue&gt;1&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10; &lt;property id=&quot;EnableInstalledBreakpoint&quot;&gt;&#10; &lt;curValue&gt;1&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10; &lt;property id=&quot;IgnoreSoftLaunchFailures&quot;&gt;&#10; &lt;curValue&gt;0&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10;&lt;/PropertyValues&gt;&#10;"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_DEBUGGER_PROPERTIES.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe/Cortex_M3_0" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot; ?&gt;&#10;&lt;PropertyValues&gt;&#10;&#10; &lt;property id=&quot;ConnectOnStartup&quot;&gt;&#10; &lt;curValue&gt;1&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10; &lt;property id=&quot;EnableInstalledBreakpoint&quot;&gt;&#10; &lt;curValue&gt;1&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10; &lt;property id=&quot;IgnoreSoftLaunchFailures&quot;&gt;&#10; &lt;curValue&gt;0&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10;&lt;/PropertyValues&gt;&#10;"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_DEBUGGER_PROPERTIES.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe_0/Cortex_M3_0" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot; ?&gt;&#10;&lt;PropertyValues&gt;&#10;&#10; &lt;property id=&quot;ConnectOnStartup&quot;&gt;&#10; &lt;curValue&gt;1&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10; &lt;property id=&quot;EnableInstalledBreakpoint&quot;&gt;&#10; &lt;curValue&gt;1&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10; &lt;property id=&quot;IgnoreSoftLaunchFailures&quot;&gt;&#10; &lt;curValue&gt;0&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10;&lt;/PropertyValues&gt;&#10;"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_DEBUGGER_PROPERTIES.CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe_0/Cortex_M3_0" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot; ?&gt;&#10;&lt;PropertyValues&gt;&#10;&#10; &lt;property id=&quot;ConnectOnStartup&quot;&gt;&#10; &lt;curValue&gt;1&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10; &lt;property id=&quot;EnableInstalledBreakpoint&quot;&gt;&#10; &lt;curValue&gt;1&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10; &lt;property id=&quot;IgnoreSoftLaunchFailures&quot;&gt;&#10; &lt;curValue&gt;0&lt;/curValue&gt;&#10; &lt;/property&gt;&#10;&#10;&lt;/PropertyValues&gt;&#10;"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS100v3 USB Debug Probe_0/Cortex_M3_0" value="${build_artifact:simple_peripheral_cc2650em_app}"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe/Cortex_M3_0" value="${build_artifact:simple_peripheral_cc2650em_app}"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe_0/Cortex_M3_0" value="${build_artifact:simple_peripheral_cc2650em_app}"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROGRAM.CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe_0/Cortex_M3_0" value="${build_artifact:simple_peripheral_cc2650em_app}"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS100v3 USB Debug Probe_0/Cortex_M3_0" value="simple_peripheral_cc2650em_app"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe/Cortex_M3_0" value="simple_peripheral_cc2650em_app"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe_0/Cortex_M3_0" value="simple_peripheral_cc2650em_app"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_PROJECT.CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe_0/Cortex_M3_0" value="simple_peripheral_cc2650em_app"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${target_config_active_default:simple_peripheral_cc2650em_app}"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS100v3 USB Debug Probe_0/Cortex_M3_0" value="C:/ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\FlashROM\simple_peripheral_cc2650em_app.out"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe/Cortex_M3_0" value="C:/ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\FlashROM\simple_peripheral_cc2650em_app.out"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe_0/Cortex_M3_0" value="C:/ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\FlashROM\simple_peripheral_cc2650em_app.out"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe_0/Cortex_M3_0" value="C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\FlashROM\simple_peripheral_cc2650em_app.out"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/simple_peripheral_cc2650em_app"/>
</listAttribute>
@@ -16,7 +16,7 @@
# sources were generated) is:
# C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\config\src
#
GEN_SRC_DIR ?= ../../../../../ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/config/src
GEN_SRC_DIR ?= ../../config/src
ifeq (,$(wildcard $(GEN_SRC_DIR)))
$(error "ERROR: GEN_SRC_DIR must be set to the directory containing the generated sources")
@@ -1,12 +1,12 @@
XOPTS = -I"C:/ti/xdctools_3_32_00_06_core/packages/" -Dxdc_target_types__=C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/std.h -Dxdc_target_name__=M3
XOPTS = -I"C:/ti/xdctools_3_32_02_25_core/packages/" -Dxdc_target_types__=C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/std.h -Dxdc_target_name__=M3
vpath % C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/sysbios/
vpath %.c C:/ti/xdctools_3_32_00_06_core/packages/
vpath %.c C:/ti/xdctools_3_32_02_25_core/packages/
CCOPTS = --endian=little -mv7M3 --abi=eabi -q -ms --opt_for_speed=0 --program_level_compile -o3 -g --optimize_with_debug -Dti_sysbios_knl_Task_minimizeLatency__D=FALSE -Dti_sysbios_family_arm_cc26xx_Boot_driverlibVersion=2 -Dti_sysbios_knl_Clock_stopCheckNext__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_enableException__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_disablePriority__D=32U -Dti_sysbios_family_arm_m3_Hwi_numSparseInterrupts__D=0U
XDC_ROOT = C:/ti/xdctools_3_32_00_06_core/packages/
XDC_ROOT = C:/ti/xdctools_3_32_02_25_core/packages/
BIOS_ROOT = C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/sysbios/
@@ -16,14 +16,14 @@ BIOS_INC = -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/pa
TARGET_INC = -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/"
INCS = $(BIOS_INC) $(TARGET_INC) --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/icall/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/dev_info" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/common/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/heapmgr" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/controller/cc26xx/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/target" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/sdata" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/saddr" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/icall/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/rom" --include_path="C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272" -IC:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/
INCS = $(BIOS_INC) $(TARGET_INC) --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/icall/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/dev_info" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/common/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/heapmgr" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/controller/cc26xx/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/target" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/sdata" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/saddr" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/icall/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/rom" --include_path="C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272" -IC:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/
CC = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include
ASM = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/include
AR = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.4.LTS/bin/armar rq
CC = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include
ASM = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/include
AR = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.3.LTS/bin/armar rq
DEL = C:/ti/xdctools_3_32_00_06_core/packages/../bin/rm -f
CP = C:/ti/xdctools_3_32_00_06_core/packages/../bin/cp -f
DEL = C:/ti/xdctools_3_32_02_25_core/packages/../bin/rm -f
CP = C:/ti/xdctools_3_32_02_25_core/packages/../bin/cp -f
define RM
$(if $(wildcard $1),$(DEL) $1,:)
@@ -133,13 +133,11 @@ static void update_latch_status (uint32_t latch_num, uint32_t elite_pin, bool hi
}
static void PIN15_setOutputValue (uint32_t latch_num, uint32_t pin_num, bool highlow) {
if(PeriodicEvent){
ELITE15_SPI_CLOSE();
}
ELITE15_SPI_CLOSE();
add_elite_pin();
update_latch_status (latch_num, pin_num, highlow);
PIN_setOutputValue(&ZM_rst, latch_num, 1); // Turn on latch
CPUdelay(10);
// PIN_setOutputValue(&ZM_rst, latch_num, 1); // Turn on latch
switch (latch_num) {
case LOAD0: {
// PIN_setOutputValue(&ZM_rst, D0, LH.LATCH0[0]);
@@ -178,23 +176,17 @@ static void PIN15_setOutputValue (uint32_t latch_num, uint32_t pin_num, bool hig
break;
}
}
CPUdelay(10);
PIN_setOutputValue(&ZM_rst, latch_num, 1); // Turn on latch
// CPUdelay(10);
PIN_setOutputValue(&ZM_rst, latch_num, 0); // Turn off latch
remove_elite_pin();
if(PeriodicEvent){
ELITE15_SPI_HOLD();
}
ELITE15_SPI_HOLD();
}
static void Init_Elite15_PIN () {
InitLH();
add_elite_pin();
PIN_setOutputValue(pin_handle, LOAD0, 1);
PIN_setOutputValue(pin_handle, LOAD1, 1);
PIN_setOutputValue(pin_handle, LOAD2, 1);
CPUdelay(10);
PIN_setOutputValue(pin_handle, D0, 0);
PIN_setOutputValue(pin_handle, D1, 0);
PIN_setOutputValue(pin_handle, D2, 0);
@@ -203,12 +195,49 @@ static void Init_Elite15_PIN () {
PIN_setOutputValue(pin_handle, D5, 0);
PIN_setOutputValue(pin_handle, D6, 0);
PIN_setOutputValue(pin_handle, D7, 0);
CPUdelay(10);
PIN_setOutputValue(pin_handle, LOAD0, 0);
PIN_setOutputValue(pin_handle, LOAD1, 1);
PIN_setOutputValue(pin_handle, LOAD2, 1);
CPUdelay(10);
PIN_setOutputValue(pin_handle, LOAD1, 0);
PIN_setOutputValue(pin_handle, LOAD2, 0);
PIN_setOutputValue(pin_handle, D0, 0);
PIN_setOutputValue(pin_handle, D1, 0);
PIN_setOutputValue(pin_handle, D2, 0);
PIN_setOutputValue(pin_handle, D3, 0);
PIN_setOutputValue(pin_handle, D4, 1);
PIN_setOutputValue(pin_handle, D5, 1);
PIN_setOutputValue(pin_handle, D6, 1);
PIN_setOutputValue(pin_handle, D7, 1);
CPUdelay(10);
PIN_setOutputValue(pin_handle, LOAD0, 1);
PIN_setOutputValue(pin_handle, LOAD0, 0);
remove_elite_pin();
// InitLH();
// add_elite_pin();
//
// PIN_setOutputValue(pin_handle, LOAD0, 1);
// PIN_setOutputValue(pin_handle, LOAD1, 1);
// PIN_setOutputValue(pin_handle, LOAD2, 1);
// CPUdelay(10);
// PIN_setOutputValue(pin_handle, D0, 0);
// PIN_setOutputValue(pin_handle, D1, 0);
// PIN_setOutputValue(pin_handle, D2, 0);
// PIN_setOutputValue(pin_handle, D3, 0);
// PIN_setOutputValue(pin_handle, D4, 0);
// PIN_setOutputValue(pin_handle, D5, 0);
// PIN_setOutputValue(pin_handle, D6, 0);
// PIN_setOutputValue(pin_handle, D7, 0);
// CPUdelay(10);
// PIN_setOutputValue(pin_handle, LOAD0, 0);
// PIN_setOutputValue(pin_handle, LOAD1, 0);
// PIN_setOutputValue(pin_handle, LOAD2, 0);
//
// remove_elite_pin();
}
@@ -1,32 +0,0 @@
#ifndef ELITECCC
#define ELITECCC
#include "EliteCCMode.h"
// XXX : should we reset DAC output after STOP?
static void CCModeReverseCurrent(CCCMode *CCC){
if(CCC->StandBy){
if(CT.StandByCounter == CCC->StandByTime){
CCC->StandBy = false;
CT.StandByCounter = 0;
}
else{
CT.StandByCounter ++;
}
}
else{
// reverse charge/discharge
if(CCC->BatteryV == CCC->VMax){
CCC->StandBy = true;
CCC->value = CCC->DischargeCurrent;
}
else if(CCC->BatteryV == CCC->VMin){
CCC->StandBy = true;
CCC->value = CCC->ChargeCurrent;
}
}
}
#endif
@@ -1,83 +0,0 @@
#ifndef ELITECCMODE
#define ELITECCMODE
#define Vset INSTRUCTION.Vset
#define DELTAVOLTMAX 100000
/* Transform setting CC into IUC
*
* User code in CC mode : 0 ~ 3000000
* Real current value : -15.00000 ~ 15.00000 mA
* => user code = 1500000 mapping to 0.00000 mA
*/
static void CC_Vscan(CCMode *CC){
static int32_t Iin = 0;
static int32_t deltaI = 0;
static int32_t deltaV = 0;
uint16_t divisionRate;
if(vscanReset){
Vset = 0;
if(CC->_charge == 0){
CC->_Iset *= -1;
}
Iin = CC->_measureCurrent * 20; //[50pA] nA => 50pA
deltaI = Iin - CC->_Iset;
if(deltaI > 20000000 || deltaI < -20000000){ //1mA
divisionRate = 1000;
}else{
divisionRate = 10;
}
deltaV = -1 * (deltaI / divisionRate); //-5 * deltaI / 5000 //pV=> 5nV
if(deltaV > DELTAVOLTMAX){ //100000 = 500uV
deltaV = DELTAVOLTMAX;
}else if(deltaV < (-DELTAVOLTMAX)){
deltaV = (-DELTAVOLTMAX);
}
Vset = Vset + deltaV; //[5nV]
if(Vset <= CC->_Vmin){
Vset = CC->_Vmin;
}else if(Vset >= CC->_Vmax){
Vset = CC->_Vmax;
}
}
if(!vscanReset){
Iin = CC->_measureCurrent * 20; //[50pA] nA => 50pA
deltaI = Iin - CC->_Iset;
if(deltaI > 20000000 || deltaI < -20000000){ //1mA
divisionRate = 1000;
}else{
divisionRate = 10;
}
deltaV = -1 * (deltaI / divisionRate); //-5 * deltaI / 5000 //pV=> 5nV
if(deltaV > DELTAVOLTMAX){ //100000 = 500uV
deltaV = DELTAVOLTMAX;
}else if(deltaV < (-DELTAVOLTMAX)){
deltaV = (-DELTAVOLTMAX);
}
Vset = Vset + deltaV; //[5nV]
if(Vset <= CC->_Vmin){
Vset = CC->_Vmin;
}else if(Vset >= CC->_Vmax){
Vset = CC->_Vmax;
}
}
// int32_t RealV;
// RealV = (int32_t)(deltaV);
// InputNotify(NOTIFY_IMPEDANCE, RealV);
}
#endif
@@ -1,156 +0,0 @@
#ifndef ELITECV3
#define ELITECV3
#define Vset INSTRUCTION.Vset
static uint16_t CV3Curve(CV3Mode *CV3){
static uint16_t DACOutCode;
static int32_t Vin;
static int32_t Vout;
static int32_t DeltaVout;
Vin = CV3->_measureVin * 200;//[5nV]
if(DACReset){
Vout = Vset + Vin;
DACReset = false;
}else{
DeltaVout = Vset - (Vout - Vin);
Vout = Vout + DeltaVout;
}
INSTRUCTION.VoltConstant = Vout / 40000 + 25000;//5nV=>usercode
DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant);
int32_t RealV2;
RealV2 = (int32_t)((Vout - Vin) / 200);//[1uV]
InputNotify(NOTIFY_VOLT, RealV2);
int32_t RealV;
RealV = (int32_t)(Vout / 200);//[1uV]
InputNotify(NOTIFY_IMPEDANCE, RealV);
DAC_outputV(DACOutCode);
return DACOutCode;
}
static void CV3_Vscan(CV3Mode *CV3){
static int16_t VminCounter;
static int16_t VmaxCounter;
static uint16_t CycleCounter;
NotifyCycleNumber = (INSTRUCTION.cycleNumber - CV3->_cycleNumber + 1);
if(vscanReset){
VmaxCounter = 0;
VminCounter = 0;
CycleCounter = 0;
if(INSTRUCTION.directionInit == 1){
CV3->_direction_up = true;
CV3->_current_direction_up = true;
}else{
CV3->_direction_up = false;
CV3->_current_direction_up = false;
}
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
if(INSTRUCTION.step <= 10){
CV3->_Vstep = INSTRUCTION.step * INSTRUCTION.VsetRate / 5;
}else{
CV3->_Vstep = INSTRUCTION.step / 5 * INSTRUCTION.VsetRate;
}
if(CV3->_Vmin == CV3->_Vinit){
VminCounter = -1;
}
if(CV3->_Vmax == CV3->_Vinit){
VmaxCounter = -1;
}
Vset = CV3->_Vinit;
}
if(!vscanReset){
if((INSTRUCTION.Vinit < INSTRUCTION.Ve1 && INSTRUCTION.Vinit < INSTRUCTION.Ve2) ||
(INSTRUCTION.Vinit > INSTRUCTION.Ve1 && INSTRUCTION.Vinit > INSTRUCTION.Ve2)
){
if (CV3->_current_direction_up){
Vset = Vset + CV3->_Vstep;
}else{
Vset = Vset - CV3->_Vstep;
}
if(INSTRUCTION.Vinit < INSTRUCTION.Ve1 && INSTRUCTION.Vinit < INSTRUCTION.Ve2){
if(Vset == CV3->_Vmin){
VminCounter = -1;
INSTRUCTION.Vinit = INSTRUCTION.Vmin;
CV3->_Vinit = CV3->_Vmin;
}
}else if(INSTRUCTION.Vinit > INSTRUCTION.Ve1 && INSTRUCTION.Vinit > INSTRUCTION.Ve2){
if(Vset == CV3->_Vmax){
VmaxCounter = -1;
INSTRUCTION.Vinit = INSTRUCTION.Vmax;
CV3->_Vinit = CV3->_Vmax;
}
}
}else{
if (Vset >= CV3->_Vmax){
VmaxCounter++;
}else if (Vset <= CV3->_Vmin){
VminCounter++;
}
if (CV3->_current_direction_up){
Vset = Vset + CV3->_Vstep * GPT.GptimerMultiple;
}else{
Vset = Vset - CV3->_Vstep * GPT.GptimerMultiple;
}
if(VmaxCounter != 0 && VminCounter != 0){
if(VmaxCounter == VminCounter && CV3->_direction_up && CV3->_current_direction_up){
if(CycleCounter != VmaxCounter){
if(Vset >= CV3->_Vinit){
CV3->_cycleNumber--;
CycleCounter = VmaxCounter; //VmaxCounter = VminCounter = CycleCounter
}
}
}
if(VmaxCounter == VminCounter && !CV3->_direction_up && !CV3->_current_direction_up){
if(CycleCounter != VmaxCounter){
if(Vset <= CV3->_Vinit){
CV3->_cycleNumber--;
CycleCounter = VmaxCounter; //VmaxCounter = VminCounter = CycleCounter
}
}
}
}
if (Vset >= CV3->_Vmax){
CV3->_current_direction_up = false;
}else if (Vset <= CV3->_Vmin){
CV3->_current_direction_up = true;
}
/*stop condition*/
if(CV3->_cycleNumber == 0){
// PeriodicEvent = false;
ModeLED(POST_WORK);
InitEliteFlag();
INSTRUCTION.eliteFxn = CONSTANT_CURRENT;
INSTRUCTION.sampleRate = 15;
INSTRUCTION.charge = 0x01;
INSTRUCTION.constantCurrent = 0x00;
INSTRUCTION.Vmax = 0xC350;
INSTRUCTION.Vmin = 0x0000;
INSTRUCTION.notifyRate = 500;
INSTRUCTION.VoViSwitch = 0x02;//read Vscan = Vout - Vin
}
}
}
// int32_t RealV;
// RealV = (int32_t)(Vset / 500);//[1uV]
// InputNotify(NOTIFY_VOLT, RealV);
}
#endif
@@ -1,218 +0,0 @@
#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.Ve1;
outputV = INSTRUCTION.Ve1;
if (INSTRUCTION.Ve1 < INSTRUCTION.Ve2)
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.Ve2 && direction_up) || (outputV <= INSTRUCTION.Ve2 && !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.Ve1 < INSTRUCTION.Ve2)
direction_up = true;
else
direction_up = false;
Volt1 = INSTRUCTION.Ve1;
if (direction_up)
Volt2 = INSTRUCTION.Ve1 + Amplitude;
else
Volt2 = INSTRUCTION.Ve1 - 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.Ve2) && direction_up) || ((outputV <= INSTRUCTION.Ve2) && !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 void CV_Vscan(CVMode *CV){
static int16_t VminCounter;
static int16_t VmaxCounter;
static uint16_t CycleCounter;
NotifyCycleNumber = (INSTRUCTION.cycleNumber - CV->_cycleNumber + 1);
if(vscanReset){
VmaxCounter = 0;
VminCounter = 0;
CycleCounter = 0;
if(INSTRUCTION.directionInit == 1){
CV->_direction_up = true;
CV->_current_direction_up = true;
}else if(INSTRUCTION.directionInit == 0){
CV->_direction_up = false;
CV->_current_direction_up = false;
}
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
if(INSTRUCTION.step <= 10){
CV->_Vstep = INSTRUCTION.step * INSTRUCTION.VsetRate / 5;
}else{
CV->_Vstep = INSTRUCTION.step / 5 * INSTRUCTION.VsetRate;
}
if(CV->_Vmin == CV->_Vinit){
VminCounter = -1;
}
if(CV->_Vmax == CV->_Vinit){
VmaxCounter = -1;
}
Vset = CV->_Vinit;
}
if(!vscanReset){
if (Vset >= CV->_Vmax){
VmaxCounter++;
}else if (Vset <= CV->_Vmin){
VminCounter++;
}
if (CV->_current_direction_up){
Vset = Vset + CV->_Vstep * GPT.GptimerMultiple;
}else{
Vset = Vset - CV->_Vstep * GPT.GptimerMultiple;
}
if(VmaxCounter != 0 && VminCounter != 0){
if(VmaxCounter == VminCounter && CV->_direction_up && CV->_current_direction_up){
if(CycleCounter != VmaxCounter){
if(Vset >= CV->_Vinit){
CV->_cycleNumber--;
CycleCounter = VmaxCounter; //VmaxCounter = VminCounter = CycleCounter
}
}
}
if(VmaxCounter == VminCounter && !CV->_direction_up && !CV->_current_direction_up){
if(CycleCounter != VmaxCounter){
if(Vset <= CV->_Vinit){
CV->_cycleNumber--;
CycleCounter = VmaxCounter; //VmaxCounter = VminCounter = CycleCounter
}
}
}
}
if (Vset >= CV->_Vmax){
CV->_current_direction_up = false;
}else if (Vset <= CV->_Vmin){
CV->_current_direction_up = true;
}
/*stop condition*/
if(CV->_cycleNumber == 0){
PeriodicEvent = false;
ELITE15_SPI_CLOSE();
ModeLED(NO_EVENT);
}
}
}
#endif
@@ -1,47 +0,0 @@
#ifndef ELITECVSCAN
#define ELITECVSCAN
#define Vset INSTRUCTION.Vset
static uint16_t CVSCANCurve(CVSCANMode *CVSCAN){
static uint16_t DACOutCode;
static int32_t Vin;
static int32_t Vout;
static int32_t DeltaVout;
Vin = CVSCAN->_measureVin * 200;//[5nV]
if(DACReset){
Vout = Vset + Vin;
DACReset = false;
}else{
DeltaVout = Vset - (Vout - Vin);
Vout = Vout + DeltaVout;
}
INSTRUCTION.VoltConstant = Vout / 40000 + 25000;//5nV=>usercode
DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant);
int32_t RealV2;
RealV2 = (int32_t)((Vout - Vin) / 200);//[1uV]
InputNotify(NOTIFY_VOLT, RealV2);
int32_t RealV;
RealV = (int32_t)(Vout / 200);//[1uV]
InputNotify(NOTIFY_IMPEDANCE, RealV);
DAC_outputV(DACOutCode);
return DACOutCode;
}
static void CVSCAN_Vscan(CVSCANMode *CVSCAN){
if(vscanReset){
Vset = CVSCAN->_Vinit;
}
if(!vscanReset){
Vset = CVSCAN->_Vinit;
}
}
#endif
@@ -4,31 +4,6 @@
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
@@ -51,11 +26,7 @@ static uint16_t DAC_outputV(uint16_t voltLV) {
spi_DACtxbuf[1] = v1;
spi_DACtxbuf[2] = v2;
if(PeriodicEvent){
DAC_SPI_TEST(SPI_DAC_SIZE, spi_DACtxbuf, spi_rxbuf);
}else{
DAC_SPI(SPI_DAC_SIZE, spi_DACtxbuf, spi_rxbuf);
}
DAC_SPI(SPI_DAC_SIZE, spi_DACtxbuf, spi_rxbuf);
return voltLV;
}
@@ -63,20 +34,21 @@ static uint16_t DAC_outputV(uint16_t voltLV) {
static void VoutGainControl(uint8_t VOUTLevel){
if(VOUTLevel == 0){
// VOUT gain level = 0, using 240K resister
PIN15_setOutputValue(Turon_VOUT_SMALL, 0);
PIN15_setOutputValue(Turnon_VOUT_SMALL, 0);
}
else if(VOUTLevel == 1){
// VOUT gain level = 1, using 15K resister
PIN15_setOutputValue(Turon_VOUT_SMALL, 1);
PIN15_setOutputValue(Turnon_VOUT_SMALL, 1);
}
else if(VOUTLevel == 2){
// VOUT gain level = 2, using 15K resister
PIN15_setOutputValue(Turon_VOUT_SMALL, 1);
PIN15_setOutputValue(Turnon_VOUT_SMALL, 1);
}
else{
// default using 15K resister
PIN15_setOutputValue(Turon_VOUT_SMALL, 1);
PIN15_setOutputValue(Turnon_VOUT_SMALL, 1);
}
volt_rec_en = false;
}
#endif
@@ -88,32 +60,33 @@ static int32_t User2Real(uint16_t UserCode){
// DAC Vout theoretical boundary <300, 100~ (mV)
#define DAC_VOUT_GAIN_SMALL_BOUNDARY 100000 // 100 mV = 25500(usercode)
#define DAC_VOUT_GAIN_LARGE_BOUNDARY 300000 // 300 mV = 26500(usercode)
#define DAC_VOUT_GAIN_SMALL_BOUNDARY 100000 // 25500(usercode) = 100 mV
#define DAC_VOUT_GAIN_LARGE_BOUNDARY 300000 // 26500(usercode) = 300 mV
#define DAC_VOUT_GAIN_LARGE_BOUNDARY_USERCODE 26500 // 26500(usercode) = 300 mV
#define DAC_VOUT_GAIN_LARGE_BOUNDARY1_USERCODE 23500 // 23500(usercode) = -300 mV
static void AutoGainChangeVout(int32_t RealVolt){
RealVolt = (RealVolt - 25000) * 200; // (RealVolt - 25000) / 5 * 1000
static void AutoGainChangeVout(int32_t userCode){
int32_t RealVolt = (userCode - 25000) * 200; // (userCode - 25000) / 5 * 1000 [1uV]
// switch to 1 level volt(small) 15K
// switch to 2 level volt(large) 240K
if(INSTRUCTION.VoutGainLevel == VOUT_GAIN_AUTO){
INSTRUCTION.VoutGainLevel = VOUT_GAIN_15K;
if(instru.VoutGainLv == VOUT_GAIN_AUTO){
instru.VoutGainLv = VOUT_GAIN_15K;
VoutGainControl(instru.VoutGainLv);
}
if(INSTRUCTION.VoutGainLevel == VOUT_GAIN_15K){
if(instru.VoutGainLv == VOUT_GAIN_15K){
if(RealVolt > DAC_VOUT_GAIN_LARGE_BOUNDARY || RealVolt < -1 * DAC_VOUT_GAIN_LARGE_BOUNDARY){
// switch to 2 level volt(large)
INSTRUCTION.VoutGainLevel = VOUT_GAIN_240K;
VoutGainControl(INSTRUCTION.VoutGainLevel);
record_flag = false;
instru.VoutGainLv = VOUT_GAIN_240K;
VoutGainControl(instru.VoutGainLv);
}
}
else if(INSTRUCTION.VoutGainLevel == VOUT_GAIN_240K){
else if(instru.VoutGainLv == VOUT_GAIN_240K){
if(RealVolt < DAC_VOUT_GAIN_SMALL_BOUNDARY && RealVolt > -1 * DAC_VOUT_GAIN_SMALL_BOUNDARY ){
// switch to 1 level volt(small)
INSTRUCTION.VoutGainLevel = VOUT_GAIN_15K;
VoutGainControl(INSTRUCTION.VoutGainLevel);
record_flag = false;
instru.VoutGainLv = VOUT_GAIN_15K;
VoutGainControl(instru.VoutGainLv);
}
}
}
@@ -2,14 +2,6 @@
#ifndef ELITE_FLAG_CT_INIT
#define ELITE_FLAG_CT_INIT
// CT counter
struct _CT{
uint32_t SampleRate_counter;
uint16_t StepTimeCounter;
uint16_t NotifyCounter;
uint32_t StandByCounter;
}CT = {0};
// GPT counter
struct _GPT{
uint32_t GptimerCounter;
@@ -22,15 +14,9 @@ struct _GPT{
uint32_t BatteryADCCounter;
uint32_t BatteryCheckCounter;
uint32_t GptimerMultiple;
uint32_t StiCounter;
}GPT = {0};
static void InitCT(){
CT.SampleRate_counter = 1;
CT.StepTimeCounter = 1;
CT.NotifyCounter = 1;
CT.StandByCounter = 0;
}
static void InitGPT(){
GPT.GptimerCounter = 0;
GPT.GptimerCounter0 = 0;
@@ -41,5 +27,6 @@ static void InitGPT(){
GPT.LeadTimeCounter = 0;
GPT.BatteryADCCounter = 0;
GPT.BatteryCheckCounter = 0;
GPT.StiCounter = 0;
}
#endif
@@ -17,7 +17,7 @@ static void elite_gptimer_callback(GPTimerCC26XX_Handle handle, GPTimerCC26XX_In
#define elite_gptimer_start() GPTimerCC26XX_start(gptimer_handle)
#define elite_gptimer_stop() GPTimerCC26XX_stop(gptimer_handle)
#define elite_gptimer_close() GPTimerCC26XX_close(gptimer_handle)
#define CLOCK_FREQ 4800 // clock freq = 0.1 ms
#define CLOCK_FREQ 4769 // clock freq = 0.1 ms(4800), Measured(4769)
#define elite_gptimer_open() \
do { \
@@ -1,50 +0,0 @@
#ifndef ELITEIV
#define ELITEIV
#define Vset INSTRUCTION.Vset
static void IV_Vscan(IVMode *IV){
if(vscanReset){
if(INSTRUCTION.directionInit == 1){
IV->_direction_up = true;
IV->_current_direction_up = true;
}else if(INSTRUCTION.directionInit == 0){
IV->_direction_up = false;
IV->_current_direction_up = false;
}
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
if(INSTRUCTION.step <= 10){
IV->_Vstep = INSTRUCTION.step * INSTRUCTION.VsetRate / 5;
}else{
IV->_Vstep = INSTRUCTION.step / 5 * INSTRUCTION.VsetRate;
}
Vset = IV->_Vinit;
}
if(!vscanReset){
if(IV->_current_direction_up){
if(Vset >= IV->_Vmax){
PeriodicEvent = false;
ELITE15_SPI_CLOSE();
ModeLED(NO_EVENT);
}
}else{
if(Vset <= IV->_Vmin){
PeriodicEvent = false;
ELITE15_SPI_CLOSE();
ModeLED(NO_EVENT);
}
}
if (IV->_current_direction_up){
Vset = Vset + IV->_Vstep * GPT.GptimerMultiple;
}else{
Vset = Vset - IV->_Vstep * GPT.GptimerMultiple;
}
}
}
#endif
@@ -1,50 +1,27 @@
/*=============================================================================
= instr.h =
=============================================================================*/
#ifndef ELITE_INSTR_H
#define ELITE_INSTR_H
#ifndef ELITEINSTRUCTION
#define ELITEINSTRUCTION
/** Iin, Vin, Vout **/
#define IIN_ADC 0x00
#define VIN_ADC 0x01
#define VOUT_DAC 0x02
#define HIGH_Z 0x03
/** ADC Iin gain level **/
#define I_GAIN_3M 0x00 // largest gain
#define I_GAIN_100K 0x01
#define I_GAIN_3K 0x02
#define I_GAIN_100R 0x03 // the least gain
#define I_GAIN_AUTO 0x04
/** ADC Vin gain level **/
#define VIN_GAIN_1M 0x00
#define VIN_GAIN_30K 0x01
#define VIN_GAIN_1K 0x02
#define VIN_GAIN_AUTO 0x03
/** Vout gain level **/
#define VOUT_GAIN_240K 0x00
#define VOUT_GAIN_15K 0x01
#define VOUT_GAIN_AUTO 0x02
/* DAC reset parameter */
#define DAC_ZERO 25000
// Step time macro
#define STEPTIME_HALF_SEC 5000
#define STEPTIME_ONE_SEC 10000
#define STEPTIME_TWO_SEC 20000
#ifdef __cpulsplus
extern "C" {
#endif
/*==============================
==== headstage instruction ====
=============================*/
struct HEADSTAGE_INSTRUCTION {
uint8_t chip_id;
uint8_t eliteFxn;
/** DAC parameter **/
// time relation
uint8_t VsetRateIndex;
uint32_t VsetRate;
uint32_t sampleRate;
uint32_t notifyRate;
uint32_t period;
int32_t Vset;
uint16_t VoltConstant;
uint8_t directionInit;
@@ -55,32 +32,102 @@ struct HEADSTAGE_INSTRUCTION {
int32_t Vmax;
int32_t Vmin;
/** ADC parameter **/
uint8_t sampleRateIndex;
uint32_t sampleRate;
uint8_t VoViSwitch;
uint8_t AutoGainEnable;
uint8_t VinAutoGainEnable;
uint8_t VoutAutoGainEnable;
uint8_t ADCGainLevel;
// voltage output gain
uint16_t VoutGainLevel;
uint8_t VinADCGainLevel;
uint32_t steptime;
/** Notify parameter **/
uint32_t notifyRate;
uint8_t IinADCAutoGainEn;
uint8_t VinADCAutoGainEn;
uint8_t VoutAutoGainEn;
uint8_t IinADCGainLv;
uint8_t VinADCGainLv;
uint16_t VoutGainLv;
uint8_t gain_switch_on;
uint8_t AdcChannel;
bool hign_z_en;
/** mode parameter **/
uint16_t cycleNumber;
uint8_t charge;
int32_t constantCurrent;
// uni pulse mode
int32_t v0;
uint32_t t_pulse[4];
int32_t v_initial[4];
int32_t v_slope[4];
int32_t v_step[4];
uint32_t t_pulse_min[4];
uint32_t t_pulse_max[4];
int32_t v_stop;
int32_t v_up;
int32_t v_low;
bool v_invert_option;
bool v_stop_direction;
int32_t v_1;
int32_t v_2;
// pulse mode
int32_t sti_v1;
int32_t sti_v2;
int32_t sti_v3;
int32_t sti_v4;
int32_t sti_v5;
int32_t sti_v6;
int32_t sti_v7;
int32_t sti_t1;
int32_t sti_t2;
int32_t sti_t3;
int32_t sti_t4;
int32_t sti_t5;
int32_t sti_t6;
int32_t sti_t7;
uint16_t sti_cy;
uint16_t sti_loop;
int32_t Vout;
// not use
int32_t Currentmax;
uint8_t VoViSwitch;
uint16_t StepTime;
uint8_t AdcChannel;
} INSTRUCTION = {0};
} instru = {0};
/** Iin, Vin, Vout **/
#define RIS_ADC_IIN 0x00
#define RIS_ADC_VIN 0x01
#define RIS_DAC_VOUT 0x02
#define RIS_HIGH_Z 0x03
#define RIS_ADC_VOUT 0x04
#define RIS_ADC_BAT 0x05
// ADC Iin gain level !!! move to ADC.h in future
#define I_GAIN_3M 0x00 // lv0,largest gain
#define I_GAIN_100K 0x01 // lv1
#define I_GAIN_3K 0x02 // lv2
#define I_GAIN_100R 0x03 // lv3,the least gain
#define I_GAIN_AUTO 0x04
// ADC Vin gain level !!! move to ADC.h in future
#define VIN_GAIN_1M 0x00
#define VIN_GAIN_30K 0x01
#define VIN_GAIN_1K 0x02
#define VIN_GAIN_AUTO 0x03
// DAC Vout gain level !!! move to DAC.h in future
#define VOUT_GAIN_240K 0x00
#define VOUT_GAIN_15K 0x01
#define VOUT_GAIN_AUTO 0x02
/* DAC reset parameter */
#define DAC_ZERO 25000 // DAC_ZERO is about 0V
// Step time macro
#define STEPTIME_HALF_SEC 5000
#define STEPTIME_ONE_SEC 10000
#define STEPTIME_TWO_SEC 20000
/*********************************************************************
* @fn InitEliteInstruction
@@ -91,35 +138,103 @@ struct HEADSTAGE_INSTRUCTION {
*
* @return None.
*/
static void InitEliteInstruction(){
INSTRUCTION.chip_id = 0;
INSTRUCTION.eliteFxn = 0; //default is a null event
INSTRUCTION.VsetRateIndex = 0;
INSTRUCTION.VsetRate = 2;
INSTRUCTION.Vset = 0;
INSTRUCTION.VoltConstant = DAC_ZERO; //DAC_ZERO is about 0V
INSTRUCTION.directionInit = 1; //0:reverse 1:forward
INSTRUCTION.step = 0;
INSTRUCTION.Ve1 = DAC_ZERO;
INSTRUCTION.Ve2 = DAC_ZERO;
INSTRUCTION.Vinit = 0;
INSTRUCTION.Vmax = 0;
INSTRUCTION.Vmin = 0;
INSTRUCTION.sampleRateIndex = 1;
INSTRUCTION.sampleRate = 100;
INSTRUCTION.VoViSwitch = 0x01; //0:user see Vo 1: user see Vi
INSTRUCTION.AutoGainEnable = 1;
INSTRUCTION.VinAutoGainEnable = 1;
INSTRUCTION.VoutAutoGainEnable = 1;
INSTRUCTION.ADCGainLevel = I_GAIN_AUTO;
INSTRUCTION.VoutGainLevel = VOUT_GAIN_AUTO;
INSTRUCTION.VinADCGainLevel = VIN_GAIN_AUTO;
INSTRUCTION.notifyRate = STEPTIME_ONE_SEC;
INSTRUCTION.cycleNumber = 1;
INSTRUCTION.charge = 1; //0:discharge 1:charge
INSTRUCTION.constantCurrent = 0;
INSTRUCTION.Currentmax = 0;
INSTRUCTION.StepTime = STEPTIME_ONE_SEC;
INSTRUCTION.AdcChannel = 0;
static void InitEliteInstruction(void)
{
instru.chip_id = 0;
instru.eliteFxn = 0; //default is a null event
instru.VsetRateIndex = 0; // vscan rate
instru.VsetRate = 2;
instru.sampleRate = 15; // ADC's sample rate
instru.notifyRate = CLOCK_ONE_SECOND; // send data's rate
instru.period = CLOCK_ONE_SECOND;
instru.Vset = 0; // vscan's volt[5nv]
instru.VoltConstant = DAC_ZERO; // DAC's volt[UC]
instru.directionInit = 1; // 0:reverse, 1:forward
instru.step = 0;
instru.Ve1 = DAC_ZERO; // user set volt[UC]
instru.Ve2 = DAC_ZERO; // user set volt[UC]
instru.Vinit = 0; // user set init volt[5nv]
instru.Vmax = 0; // user set max volt[5nv]
instru.Vmin = 0; // user set min voit[5nv]
instru.IinADCAutoGainEn = 1;
instru.VinADCAutoGainEn = 1;
instru.VoutAutoGainEn = 1;
instru.IinADCGainLv = I_GAIN_AUTO;
instru.VinADCGainLv = VIN_GAIN_AUTO;
instru.VoutGainLv = VOUT_GAIN_AUTO;
instru.gain_switch_on = 0b11110000; // cur auto gain switch, |lv0|lv1|lv2|lv3|none|none|none|none|
instru.AdcChannel = 0; // RIS_ADC_IIN: 0x00, RIS_ADC_VIN: 0x01, RIS_DAC_VOUT: 0x02, RIS_HIGH_Z: 0x03
instru.hign_z_en = 1;
instru.cycleNumber = 1;
instru.charge = 1; // 0:discharge, 1:charge
instru.constantCurrent = 0;
// uni pulse mode
instru.v0 = DAC_ZERO; // t < 0, volt is 0v
instru.v_stop = 0;
instru.t_pulse[0] = 0;
instru.t_pulse[1] = 0;
instru.t_pulse[2] = 0;
instru.t_pulse[3] = 0;
instru.v_initial[0] = 0;
instru.v_initial[1] = 0;
instru.v_initial[2] = 0;
instru.v_initial[3] = 0;
instru.v_slope[0] = 0;
instru.v_slope[1] = 0;
instru.v_slope[2] = 0;
instru.v_slope[3] = 0;
instru.v_step[0] = 0;
instru.v_step[1] = 0;
instru.v_step[2] = 0;
instru.v_step[3] = 0;
instru.t_pulse_min[0] = 0;
instru.t_pulse_min[1] = 0;
instru.t_pulse_min[2] = 0;
instru.t_pulse_min[3] = 0;
instru.t_pulse_max[0] = 0;
instru.t_pulse_max[1] = 0;
instru.t_pulse_max[2] = 0;
instru.t_pulse_max[3] = 0;
instru.v_invert_option = false;
instru.v_stop_direction = true;
instru.v_1 = 0;
instru.v_2 = 0;
//pulse mode
instru.sti_t1 = 0;
instru.sti_t2 = 0;
instru.sti_t3 = 0;
instru.sti_t4 = 0;
instru.sti_t5 = 0;
instru.sti_t6 = 0;
instru.sti_t7 = 0;
instru.sti_v1 = DAC_ZERO;
instru.sti_v2 = DAC_ZERO;
instru.sti_v3 = DAC_ZERO;
instru.sti_v4 = DAC_ZERO;
instru.sti_v5 = DAC_ZERO;
instru.sti_v6 = DAC_ZERO;
instru.sti_v7 = DAC_ZERO;
instru.sti_loop = 1;
instru.sti_cy = 0;
instru.Vout = 0;
// not use
instru.Currentmax = 0;
instru.VoViSwitch = 0x01;
return;
}
#ifdef __cpulsplus
}
#endif
#endif
@@ -50,14 +50,14 @@ static void EliteKeyPress(uint8_t key) {
}
ShutDownCounter ++;
} else {
if (OriginEliteFxn == INSTRUCTION.eliteFxn) { // old function == currunt instruction
if (OriginEliteFxn == instru.eliteFxn) { // old function == currunt instruction
if (ShutDownCounter != 0) {
// dark LED
checkFlafLED();
ShutDownCounter = 0;
}
} else { // old function != currunt instruction
OriginEliteFxn = INSTRUCTION.eliteFxn;
OriginEliteFxn = instru.eliteFxn;
if (ShutDownCounter != 0) {
ShutDownCounter = 0;
}
@@ -5,6 +5,12 @@
#define DARKLED 0xE1
#define LIGHTLED 0xE8
static bool btWaitLedFlag = 0;
static bool noEventLedFlag = 0;
static bool preWorkLedFlag = 0;
static bool workingLedFlag = 0;
static bool postWorkLedFlag = 0;
static void WorkModeLED();
static void LED_color(uint8_t bright, uint8_t red, uint8_t green, uint8_t blue) {
@@ -18,26 +24,21 @@ static void LED_color(uint8_t bright, uint8_t red, uint8_t green, uint8_t blue)
spi_LEDtxbuf[SPI_LED_SIZE - 2] = 0xffff;
spi_LEDtxbuf[SPI_LED_SIZE - 1] = 0xffff;
if(PeriodicEvent){
LED_SPI_TEST(SPI_LED_SIZE, spi_LEDtxbuf, spi_LEDrxbuf);
}else{
LED_SPI(SPI_LED_SIZE, spi_LEDtxbuf, spi_LEDrxbuf);
}
LED_SPI(SPI_LED_SIZE, spi_LEDtxbuf, spi_LEDrxbuf);
}
static void Elite_led_color(uint16_t color){
switch (color) {
case COLOR_RED: {
LED_color(DARKLED, 0x50, 0x00, 0x00);
LED_color(DARKLED, 0xFF, 0x00, 0x00);
break;
}
case COLOR_ORANGE: {
LED_color(DARKLED, 0x50, 0x58, 0x09);
LED_color(DARKLED, 0xFF, 0x58, 0x09);
break;
}
case COLOR_YELLOW: {
LED_color(LIGHTLED, 0x50, 0x80, 0x00);
LED_color(LIGHTLED, 0xFF, 0x80, 0x00);
break;
}
case COLOR_GREEN: {
@@ -57,21 +58,42 @@ static void Elite_led_color(uint16_t color){
break;
}
case COLOR_MAGENTA: {
LED_color(DARKLED, 0x50, 0x00, 0x80);
LED_color(DARKLED, 0xFF, 0x00, 0x80);
break;
}
case COLOR_PURPLE: {
LED_color(DARKLED, 0x50, 0x00, 0xFF);
LED_color(DARKLED, 0xFF, 0x00, 0xFF);
break;
}
case COLOR_WHITE: {
LED_color(DARKLED, 0x50, 0xFF, 0xFF);
LED_color(DARKLED, 0xCA, 0xFF, 0xFF);
break;
}
case COLOR_BLACK: {
LED_color(0x00, 0x00, 0x00, 0x00);
break;
}
//dark LED
case COLOR_YELLOW_DARK: {
LED_color(DARKLED, 0xFF, 0x80, 0x00);
break;
}
case COLOR_GREEN_DARK: {
LED_color(DARKLED, 0x00, 0x33, 0x00);
break;
}
case COLOR_BLUE_DARK: {
LED_color(DARKLED, 0x00, 0x00, 0x33);
break;
}
case COLOR_CYAN_DARK: {
LED_color(DARKLED, 0x00, 0x10, 0x10);
break;
}
case COLOR_PURPLE_DARK: {
LED_color(DARKLED, 0x55, 0x00, 0x55);
break;
}
default: {
break;
}
@@ -118,7 +140,8 @@ static void ModeLED(uint16_t modeStatus) {
}
}
static void checkFlafLED() {
static void checkFlafLED()
{
if(btWaitLedFlag == 1){
ModeLED(BT_WAIT);
}
@@ -136,44 +159,42 @@ static void checkFlafLED() {
}
}
static void WorkModeLED() {
switch (INSTRUCTION.eliteFxn) {
case IV_CURVE:
case CV_CURVE:
case DIFFERENTIAL_PULSE_VOLTAMMETRY:
case SQUARE_WAVE_VOLTAMMETRY:
case VOLT_OUTPUT:
case ZT_CURVE:
case VT_CURVE:
case IT_CURVE:
case ADC_TEST:
case CYCLIC_VOLTAMMETRY:
case LINEAR_SWEEP_VOLTAMMETRY:
case CONSTANT_VSCAN:{
WORKLED();
break;
}
case CONSTANT_CURRENT:{
WORKLED();
break;
}
case CALI_ADC_MODE:{
if(INSTRUCTION.AdcChannel == IIN_ADC){
Elite_led_color(COLOR_RED);
}else if(INSTRUCTION.AdcChannel == VIN_ADC){
Elite_led_color(COLOR_ORANGE);
}
static void WorkModeLED()
{
switch (instru.eliteFxn) {
case CURVE_IV:
case CURVE_VO:
case CURVE_RT:
case CURVE_VT:
case CURVE_IT:
case CURVE_CV:
case CURVE_CA:
case CURVE_CC:
case CURVE_OCP:
case CURVE_LSV:
case CURVE_IV_CY:
case CURVE_PULSE:
case CURVE_UNI_PULSE:
case CURVE_DPV:
case CURVE_DPV_SMPRATE:
case CURVE_DPV_ADVANCE:
case CURVE_DPV_ADVANCE_SMPRATE:
WORKLED();
break;
case CURVE_CALI_ADC:
if (instru.AdcChannel == RIS_ADC_IIN) {
Elite_led_color(COLOR_RED);
} else if (instru.AdcChannel == RIS_ADC_VIN) {
Elite_led_color(COLOR_ORANGE);
} else if (instru.AdcChannel == RIS_DAC_VOUT) {
Elite_led_color(COLOR_BLUE);
}
break;
default:
break;
break;
}
// case VIS_RST: {
// LEDPowerON();
// break;
// }
default: {
WORKLED();
break;
}
}
}
@@ -1,98 +0,0 @@
#ifndef ELITELSV
#define ELITELSV
#define Vset INSTRUCTION.Vset
static uint16_t LSVCurve(LSVMode *LSV){
static uint16_t DACOutCode;
static int32_t Vin;
static int32_t Vout;
static int32_t DeltaVout;
Vin = LSV->_measureVin * 200;//[5nV]
if(DACReset){
Vout = Vset + Vin;
DACReset = false;
}else{
DeltaVout = Vset - (Vout - Vin);
Vout = Vout + DeltaVout;
}
INSTRUCTION.VoltConstant = Vout / 40000 + 25000;//5nV=>usercode
DACOutCode = Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant);
int32_t RealV2;
RealV2 = (int32_t)((Vout - Vin) / 200);//[1uV]
InputNotify(NOTIFY_VOLT, RealV2);
int32_t RealV;
RealV = (int32_t)(Vout / 200);//[1uV]
InputNotify(NOTIFY_IMPEDANCE, RealV);
DAC_outputV(DACOutCode);
//
return DACOutCode;
}
static void LSV_Vscan(LSVMode *LSV){
NotifyCycleNumber = (INSTRUCTION.cycleNumber - LSV->_cycleNumber + 1);
if(vscanReset){
if(INSTRUCTION.directionInit == 1){
LSV->_direction_up = true;
LSV->_current_direction_up = true;
}else{
LSV->_direction_up = false;
LSV->_current_direction_up = false;
}
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
if(INSTRUCTION.step <= 10){
LSV->_Vstep = INSTRUCTION.step * INSTRUCTION.VsetRate / 5;
}else{
LSV->_Vstep = INSTRUCTION.step / 5 * INSTRUCTION.VsetRate;
}
Vset = LSV->_Vinit;
}
if(!vscanReset){
if (LSV->_current_direction_up){
Vset = Vset + LSV->_Vstep * GPT.GptimerMultiple;
}else{
Vset = Vset - LSV->_Vstep * GPT.GptimerMultiple;
}
/*stop condition*/
if (Vset >= LSV->_Vmax){
ModeLED(POST_WORK);
// PeriodicEvent = false;
Vset = LSV->_Vmin;
InitEliteFlag();
INSTRUCTION.eliteFxn = CONSTANT_CURRENT;
INSTRUCTION.sampleRate = 15;
INSTRUCTION.charge = 0x01;
INSTRUCTION.constantCurrent = 0x00;
INSTRUCTION.Vmax = 0xC350;
INSTRUCTION.Vmin = 0x0000;
INSTRUCTION.notifyRate = 500;
INSTRUCTION.VoViSwitch = 0x02;//read Vscan = Vout - Vin
}else if (Vset <= LSV->_Vmin){
ModeLED(POST_WORK);
// PeriodicEvent = false;
Vset = LSV->_Vmax;
InitEliteFlag();
INSTRUCTION.eliteFxn = CONSTANT_CURRENT;
INSTRUCTION.sampleRate = 15;
INSTRUCTION.charge = 0x01;
INSTRUCTION.constantCurrent = 0x00;
INSTRUCTION.Vmax = 0xC350;
INSTRUCTION.Vmin = 0x0000;
INSTRUCTION.notifyRate = 500;
INSTRUCTION.VoViSwitch = 0x02;//read Vscan = Vout - Vin
}
}
}
#endif
@@ -10,57 +10,22 @@
#include "headstage.h"
/*notify's input type*/
#define NOTIFY_CURRENT 0
#define NOTIFY_VOLT 1
#define NOTIFY_IMPEDANCE 2
#define NOTIFY_VOLT_BAT 3
#define NOTIFY_CURRENT 0
#define NOTIFY_VOLT 1
#define NOTIFY_IMPEDANCE 2
#define NOTIFY_VOLT_BAT 3
#define NOTIFY_TEMPERATURE 4
#define NOT_BUF_OFFSET_INIT 8
#define FINISH_MODE_INS 0b10100000
/**
* 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};
static uint8_t NotifyVoltBat[4] = {0};
static uint8_t NotifyTemperature[4] = {0};
static uint16_t NotifyCycleNumber = 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 ***************************************** //
static bool finishMode = false;
/*
* Notify format
@@ -89,7 +54,7 @@ static uint16_t NotifyCycleNumber = 0;
static void SendNotify() {
initDATBuf();
not_buf[0] = INSTRUCTION.chip_id;
not_buf[0] = instru.chip_id;
for (int i = 0; i < 4; i++) {
not_buf[i + 1] = NotifyCurrent[i];
@@ -108,10 +73,17 @@ static void SendNotify() {
not_buf[17] = (NotifyCycleNumber >> 8) & 0xff;
not_buf[18] = NotifyCycleNumber & 0xff;
for (int i = 19; i < BLE_DAT_BUFF_SIZE; i++){
not_buf[i] = 0;
if (finishMode) {
not_buf[19] = (FINISH_MODE_INS) & 0b11110000;
} else {
not_buf[19] = 0 & 0b11110000;
}
// for (int i = 20; i < BLE_DAT_BUFF_SIZE; i++){
// not_buf[i] = 0;
// }
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
}
@@ -136,6 +108,7 @@ static void initCISBuf(){
static void initRawDataBuf(){
not_time_stamp = 0;
NotifyCycleNumber = 0;
finishMode = false;
for (int i = 0; i < 4; i++){
NotifyCurrent[i] = 0;
@@ -148,7 +121,7 @@ static void FlushNotify(){
initRawDataBuf();
initDATBuf();
not_buf[0] = INSTRUCTION.chip_id;
not_buf[0] = instru.chip_id;
SimpleProfile_SetParameter(BLE_DAT_BUFF_CHAR, BLE_DAT_BUFF_SIZE, not_buf);
}
@@ -183,6 +156,12 @@ static void InputNotify(int NotifyType, int32_t Data){
NotifyVoltBat[2] = (uint8_t)((Data & 0x0000FF00) >> 8);
NotifyVoltBat[3] = (uint8_t)(Data & 0x000000FF);
break;
case NOTIFY_TEMPERATURE :
NotifyTemperature[0] = (uint8_t)((Data & 0xFF000000) >> 24);
NotifyTemperature[1] = (uint8_t)((Data & 0x00FF0000) >> 16);
NotifyTemperature[2] = (uint8_t)((Data & 0x0000FF00) >> 8);
NotifyTemperature[3] = (uint8_t)(Data & 0x000000FF);
break;
}
}
#endif
@@ -3,21 +3,22 @@
#define ELITERESET
static void reset() {
ModeLED(NO_EVENT);
InitEliteFlag();
InitFlag();
InitCT();
InitGPT();
InitLH();
megaStiEnable = false;
PeriodicEvent = false; // is there an PeriodicEvent?
Free_Work_Mode = true; // Free(WorkModeData)
VinADCGainControl(VIN_GAIN_AUTO);
IinADCGainControl(I_GAIN_AUTO);
VoutGainControl(VOUT_GAIN_AUTO);
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
PIN15_setOutputValue(HIGH_Z_MODE, 0); // 0 => open high_z mode
initINSBuf();
initDATBuf();
PIN15_setOutputValue(HIGH_Z_MODE, 0); // HIGH Z MODE // 1: close; 0: open;
VinADCGainCtrl(VIN_GAIN_AUTO);
IinADCGainCtrl(I_GAIN_AUTO);
instru.VoutGainLv = VOUT_GAIN_15K;
VoutGainControl(instru.VoutGainLv);
DAC_outputV(Usercode_Correction_to_DAC(instru.VoutGainLv, 25000));
for (int i = 0; i < SPI_LED_SIZE; i++) {
spi_LEDtxbuf[i] = 0;
spi_LEDrxbuf[i] = 0;
@@ -33,28 +34,24 @@ static void reset() {
spi_ADC_rxbuf[i] = 0;
}
PIN15_setOutputValue(ADC_CS, 1); // ADC_CS HIGH
PIN15_setOutputValue(DAC_CS, 1); // DAC_CS HIGH
ModeLED(NO_EVENT);
CPUdelay(1600);
}
static void Eliteinterrupt() {
InitFlag();
ModeLED(NO_EVENT);
megaStiEnable = false;
PeriodicEvent = false; // is there an PeriodicEvent?
Free_Work_Mode = true; // Free(WorkModeData)
InitEliteFlag();
InitCT();
InitGPT();
InitLH();
VinADCGainControl(VIN_GAIN_AUTO);
IinADCGainControl(I_GAIN_AUTO);
VoutGainControl(VOUT_GAIN_AUTO);
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
PIN15_setOutputValue(HIGH_Z_MODE, 0); // 0 => open high_z mode
initINSBuf();
initDATBuf();
PIN15_setOutputValue(HIGH_Z_MODE, 0); // HIGH Z MODE // 1: close; 0: open;
instru.VoutGainLv = VOUT_GAIN_15K;
VoutGainControl(instru.VoutGainLv);
DAC_outputV(Usercode_Correction_to_DAC(instru.VoutGainLv, 25000));
for (int i = 0; i < SPI_LED_SIZE; i++) {
spi_LEDtxbuf[i] = 0;
spi_LEDrxbuf[i] = 0;
@@ -70,8 +67,7 @@ static void Eliteinterrupt() {
spi_ADC_rxbuf[i] = 0;
}
PIN15_setOutputValue(ADC_CS, 1); // ADC_CS HIGH
PIN15_setOutputValue(DAC_CS, 1); // DAC_CS HIGH
ModeLED(NO_EVENT);
CPUdelay(8000);
}
#endif
@@ -57,20 +57,17 @@ static void Elite_SPI_init(){
}
static void LED_SPI(uint8_t length, uint16_t *spi_txbuf, uint16_t *spi_rxbuf) {
ELITE15_SPI_HOLD();
LED_transaction.count = length;
LED_transaction.txBuf = spi_txbuf;
LED_transaction.rxBuf = spi_rxbuf;
SPI_transfer(spiHandle0, &LED_transaction);
ELITE15_SPI_CLOSE();
}
static void ADC_SPI(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
ELITE15_SPI_HOLD();
PIN_setOutputValue(pin_handle, D6, 0); // CS_ADC
// PIN15_setOutputValue(ADC_CS, 0); // ADC_CS LOW
PIN_setOutputValue(pin_handle, LOAD0, 1);
PIN_setOutputValue(pin_handle, D6, 0); // ADC_CS LOW
ADC_DAC_transaction.count = length;
ADC_DAC_transaction.txBuf = spi_txbuf;
@@ -78,13 +75,15 @@ static void ADC_SPI(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
SPI_transfer(spiHandle1, &ADC_DAC_transaction);
PIN_setOutputValue(pin_handle, D6, 1); // CS_ADC
ELITE15_SPI_CLOSE();
PIN_setOutputValue(pin_handle, D6, 1); // ADC_CS HIGH
update_latch_status (ADC_CS, 1);
// PIN15_setOutputValue(ADC_CS, 1); // ADC_CS HIGH
}
static void DAC_SPI(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
ELITE15_SPI_HOLD();
PIN_setOutputValue(pin_handle, D7, 0); // CD_DAC
// PIN15_setOutputValue(DAC_CS, 0); // DAC_CS LOW
PIN_setOutputValue(pin_handle, LOAD0, 1);
PIN_setOutputValue(pin_handle, D7, 0); // DAC_CS LOW
ADC_DAC_transaction.count = length;
ADC_DAC_transaction.txBuf = spi_txbuf;
@@ -92,68 +91,37 @@ static void DAC_SPI(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
SPI_transfer(spiHandle1, &ADC_DAC_transaction);
PIN_setOutputValue(pin_handle, D7, 1); // CD_DAC
ELITE15_SPI_CLOSE();
}
static void LED_SPI_TEST(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_TEST(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
PIN_setOutputValue(pin_handle, D6, 0); // CS_ADC
ADC_DAC_transaction.count = length;
ADC_DAC_transaction.txBuf = spi_txbuf;
ADC_DAC_transaction.rxBuf = spi_rxbuf;
SPI_transfer(spiHandle1, &ADC_DAC_transaction);
PIN_setOutputValue(pin_handle, D6, 1); // CS_ADC
}
static void DAC_SPI_TEST(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
PIN_setOutputValue(pin_handle, D7, 0); // CD_DAC
ADC_DAC_transaction.count = length;
ADC_DAC_transaction.txBuf = spi_txbuf;
ADC_DAC_transaction.rxBuf = spi_rxbuf;
SPI_transfer(spiHandle1, &ADC_DAC_transaction);
PIN_setOutputValue(pin_handle, D7, 1); // CD_DAC
PIN_setOutputValue(pin_handle, D7, 1); // DAC_CS HIGH
update_latch_status (DAC_CS, 1);
// PIN15_setOutputValue(DAC_CS, 1); // DAC_CS HIGH
}
static void ELITE15_SPI_HOLD() {
Elite_SPI_init();
#ifdef ELITE_PIN_1_5_RE
PIN_setOutputValue(pin_handle, D6, LH.LATCH0[6]); // ADC_CS
PIN_setOutputValue(pin_handle, D7, LH.LATCH0[7]); // DAC_CS
PIN_setOutputValue(pin_handle, D4, LH.LATCH0[4]); // update HIGH_Z_MODE
#endif
PIN_setOutputValue(pin_handle, LOAD0, 1);
PIN_setOutputValue(pin_handle, LOAD1, 0);
PIN_setOutputValue(pin_handle, LOAD2, 0);
PIN_setOutputValue(pin_handle, D4, 1); // HOLD_MEM
PIN_setOutputValue(pin_handle, D5, 1); // CS_MEM
PIN_setOutputValue(pin_handle, D6, 1); // CS_ADC
PIN_setOutputValue(pin_handle, D7, 1); // CD_DAC
Elite_SPI_init();
}
static void ELITE15_SPI_CLOSE() {
PIN_setOutputValue(pin_handle, D4, 1); // HOLD_MEM
PIN_setOutputValue(pin_handle, D5, 1); // CS_MEM
PIN_setOutputValue(pin_handle, D6, 1); // CS_ADC
PIN_setOutputValue(pin_handle, D7, 1); // CD_DAC
PIN_setOutputValue(pin_handle, LOAD0, 0);
PIN_setOutputValue(pin_handle, LOAD1, 0);
PIN_setOutputValue(pin_handle, LOAD2, 0);
SPI_close(spiHandle0);
SPI_close(spiHandle1);
}
/* Elite1.5 Calibration SPI */
static void CAL_ADC_SPI(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf) {
// ELITE15_SPI_HOLD();
PIN_setOutputValue(pin_handle, D6, 0); // CS_ADC
// PIN15_setOutputValue(ADC_CS, 0); // ADC_CS LOW
PIN_setOutputValue(pin_handle, LOAD0, 1);
PIN_setOutputValue(pin_handle, D6, 0); // ADC_CS LOW
ADC_DAC_transaction.count = length;
ADC_DAC_transaction.txBuf = spi_txbuf;
@@ -161,21 +129,9 @@ static void CAL_ADC_SPI(uint8_t length, uint8_t *spi_txbuf, uint8_t *spi_rxbuf)
SPI_transfer(spiHandle1, &ADC_DAC_transaction);
PIN_setOutputValue(pin_handle, D6, 1); // CS_ADC
// ELITE15_SPI_CLOSE();
PIN_setOutputValue(pin_handle, D6, 1); // ADC_CS HOGH
update_latch_status (ADC_CS, 1);
// PIN15_setOutputValue(ADC_CS, 1); // ADC_CS HIGH
}
static void CAL_LED_SPI(uint8_t length, uint16_t *spi_txbuf, uint16_t *spi_rxbuf) {
// ELITE15_SPI_HOLD();
LED_transaction.count = length;
LED_transaction.txBuf = spi_txbuf;
LED_transaction.rxBuf = spi_rxbuf;
SPI_transfer(spiHandle0, &LED_transaction);
// ELITE15_SPI_CLOSE();
}
#endif // ELITE_SPI
@@ -1,21 +0,0 @@
#ifndef ELITEZT
#define ELITEZT
// 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_Vscan(RTMode *RT){
if(vscanReset){
Vset = ((int32_t)(INSTRUCTION.VoltConstant) - 25000) * 4 * 10000; //[5nV]
OneWayVoltScan();
}
if(!vscanReset){
}
}
#endif
@@ -6,6 +6,9 @@
#include <Board.h>
#include <ti/drivers/PIN.h>
//#define ELITE_PIN_1_5
#define ELITE_PIN_1_5_RE
/* SPI Board */
#define Board_SPI0_MISO PIN_UNASSIGNED
#define Board_SPI0_MOSI D1
@@ -36,15 +39,24 @@
#define ADC_DAC_SPI_CLK LOAD0, D2
#define LED_MOSI LOAD0, D1
#define LED_CLK LOAD0, D0
#define MEM_HOLD LOAD0, D4
#define MEM_CS LOAD0, D5
#ifdef ELITE_PIN_1_5
#define MEM_HOLD LOAD0, D4
#define HIGH_Z_MODE LOAD2, D5
#endif
#ifdef ELITE_PIN_1_5_RE
#define MEM_HOLD LOAD1, D0
#define HIGH_Z_MODE LOAD0, D4
#endif
#define Turnon_I_MID LOAD2, D0
#define Turnon_I_SMALL LOAD2, D4
#define Turnon_I_LARGE LOAD2, D1
#define Turnon_V_SMALL LOAD2, D2
#define Turnon_V_MID LOAD2, D3
#define Turon_VOUT_SMALL LOAD2, D7
#define Turnon_VOUT_SMALL LOAD2, D7
#define shutdown_6994 LOAD2, D6
//#define Turnon10K Turnon_I_MID
//#define Turnon200R Turnon_I_LARGE
@@ -55,9 +67,7 @@
#define Board_I2C0_SDA0 PIN_UNASSIGNED
#endif
#define shutdown_6994 LOAD2, D6
#define switch_on IOID_14
#define HIGH_Z_MODE LOAD2, D5
#define enable_10v LOAD1, D5
#define enable_5v LOAD1, D6
@@ -2,7 +2,7 @@
***********************************************************
Read battery's method
***********************************************************
1.ReadADCBat(spi_ADC_rxbuf)
1.read_adc_raw_data(RIS_ADC_BAT, spi_ADC_rxbuf, spi_ADC_txbuf);
let "spi_ADC_rxbuf" be 8000
8000 * 187.5uV * 2 = 3000000uV = 3V ;
2.AONBatMonBatteryVoltageGet()
@@ -34,40 +34,41 @@ static uint8_t headstage_battery_percent() {
static void headstage_battery_volt(){
uint32_t bat_volt = 0;
ReadADCBat(spi_ADC_rxbuf);
read_adc_raw_data(RIS_ADC_BAT, spi_ADC_rxbuf, spi_ADC_txbuf);
bat_volt = (uint32_t) (spi_ADC_rxbuf[0] << 8) | (uint32_t) (spi_ADC_rxbuf[1]);
bat_volt = bat_volt * 12 / 125; //x * 187.5 * 1e-6 * 2 / 125 * 320 * 100 ;
// bat_volt = (bat_volt - 1) * 187.5 * 2;
InputNotify(NOTIFY_VOLT_BAT, bat_volt);
}
static void headstage_temperature(void) {
int32_t curTemp = 0;
curTemp = AONBatMonTemperatureGetDegC();
InputNotify(NOTIFY_TEMPERATURE,curTemp);
}
static void EliteADCBattery(){
static uint8_t ADCSwitch = 0;
if(INSTRUCTION.eliteFxn == ADC_TEST){
if(ADCSwitch == 0){ /**read V**/
read_adc_raw_data(RIS_ADC_BAT, spi_ADC_rxbuf, spi_ADC_txbuf);
ADCSwitch++;
}
else if(ADCSwitch == 1){ /**read V**/
read_adc_raw_data(RIS_ADC_BAT, spi_ADC_rxbuf, spi_ADC_txbuf);
ADCSwitch++;
}
else if(ADCSwitch == 2){ /**read V(buffer)**/
headstage_battery_volt();
batteryCheck_flag = false;
headstage_temperature();
tempCheck_flag = false;
ADCSwitch = 0;
}else{
if(ADCSwitch == 0){ /**read V**/
ReadADCBat(spi_ADC_rxbuf);
ADCSwitch++;
}
else if(ADCSwitch == 1){ /**read V**/
ReadADCBat(spi_ADC_rxbuf);
ADCSwitch++;
}
else if(ADCSwitch == 2){ /**read V(buffer)**/
headstage_battery_volt();
batteryCheck_flag = false;
ADCSwitch = 0;
}
}
}
static void measureBat(){
GPT.DeltaGptimerCounter = GPT.GptimerCounter - GPT.GptimerCounter0;
GPT.GptimerCounter0 = GPT.GptimerCounter;
GPT.BatteryADCCounter = GPT.BatteryADCCounter + GPT.DeltaGptimerCounter;
GPT.BatteryCheckCounter = GPT.BatteryCheckCounter + GPT.DeltaGptimerCounter;
if(GPT.BatteryCheckCounter >= 50000){//5min=3000000, 5s=50000
GPT.BatteryCheckCounter = 0;
batteryCheck_flag = true;
@@ -20,30 +20,49 @@
#define VIS_CC_ZERO 0x40
// RIS (real instruction)
#define IV_CURVE 0x10
#define CV_CURVE 0x20
#define VOLT_OUTPUT 0x30
#define ZT_CURVE 0x40
#define VT_CURVE 0x50
#define IT_CURVE 0x60
#define SET_SAMPLE_RATE 0x70
#define SET_ADC_DAC_GAIN 0x80
#define DIFFERENTIAL_PULSE_VOLTAMMETRY 0xA0
#define SQUARE_WAVE_VOLTAMMETRY 0xB0
#define CYCLIC_VOLTAMMETRY 0xC0
#define CONSTANT_CURRENT 0xD0
#define CYCLE_CONSTANT_CURRENT 0xF0
#define HIGH_CYCLE_CYCLIC_VOLTAMMETRY 0x01
#define LINEAR_SWEEP_VOLTAMMETRY 0x02
#define CONSTANT_VSCAN 0x03
#define ADC_TEST 0x91
#define CALI_DAC_MODE 0x93
#define CALI_ADC_MODE 0x92
enum all_mode_e {
CURVE_IV = 0x01, // I-V Curve //0x10,
CURVE_IV_CY = 0x02, // Cycle I-V //0x20,
CURVE_VO = 0x03, // Function Generator //0x30,
CURVE_RT = 0x04, // R-T Graph //0x40,
CURVE_VT = 0x05, // V-T Graph //0x50,
CURVE_IT = 0x06, // I-T Graph //0x60,
CURVE_CC = 0x07, // Constant Current (CC) //0xD0,
CURVE_OCP = 0x08, // Open Circuit Potential (OCP)
CURVE_CV = 0x09, // Cyclic Voltammetry (CV) //0xC0,
CURVE_LSV = 0x0A, // Linear Sweep Voltammetry (LSV) //0x02,
CURVE_CA = 0x0B, // Chronoamperometric Graph (CA) //0x03,
CURVE_PULSE = 0x0C, //0x94,
CURVE_UNI_PULSE = 0x0D, // universal pulse
CURVE_DPV = 0x0E,
CURVE_DPV_SMPRATE = 0x0F,
CURVE_DPV_ADVANCE = 0x10,
CURVE_DPV_ADVANCE_SMPRATE = 0x11,
CURVE_CALI_ADC = 0xF1, // Cali ADC - test //0x92,
SET_SAMPLE_RATE = 0xE0, //0x70,
SET_ADC_DAC_GAIN = 0xE1, //0x80,
SET_PARA = 0xE2
};
enum set_para_e {
DAC_VOLT = 0x01,
};
enum dev_para_e {
VERSION_DEV_TEST = 0x01,
BAT_DEV_TEST = 0x02,
TEMP_DEV_TEST = 0x03,
LED_DEV_TEST = 0x04,
};
// CIS (control instruction)
#define CIS_VERSION 0x40
#define CIS_VOLT 0x10
#define CIS_LED_TEST 0x70
#define CIS_TEMPERATURE 0x80
// mode parameter
#define STEP_TO_VSETRATE(step) step2VsetRate(step)
@@ -52,9 +71,6 @@
#define VDIRECTION(v1,v2) ((v1 > v2) ? 0 : 1)
#define AFTER_READ_I 0
#define AFTER_READ_V 1
#define ReadADCVolt(x) ((x==0)? ReadADCVout(spi_ADC_rxbuf) : ReadADCVin(spi_ADC_rxbuf))
#define PARA_1 0x01
#define PARA_2 0x02
//Elite LED
#define COLOR_BLACK 0x00
@@ -68,6 +84,12 @@
#define COLOR_PURPLE 0x08
#define COLOR_WHITE 0x09
#define COLOR_YELLOWGREEN 0x0A
#define COLOR_YELLOW_DARK 0xF3
#define COLOR_GREEN_DARK 0xF4
#define COLOR_BLUE_DARK 0xF5
#define COLOR_CYAN_DARK 0xF6
#define COLOR_PURPLE_DARK 0xF8
#define LEDPowerON() Elite_led_color(COLOR_GREEN)
#define WORKLED() Elite_led_color(COLOR_CYAN)
#define KEYLED() Elite_led_color(COLOR_YELLOW)
@@ -80,5 +102,15 @@
#define WORKING 0x04
#define POST_WORK 0x05
#define VALUE_ZERO_TO_ONE(_v) (_v == 0) ? 1 : _v
//plot_type
#define IT_PLOT 1
#define VT_PLOT 2
#define VOUT_PLOT 3
#define IIN_VIN_PLOT 4
#define IIN_VIN_VOUT_PLOT 5
#define CLOCK_ONE_SECOND 10000
#endif
@@ -2,9 +2,9 @@
#ifndef VERSION_DATE
#define VERSION_DATE
#define VERSION_DATE_YEAR 20
#define VERSION_DATE_MONTH 9
#define VERSION_DATE_DAY 7
#define VERSION_DATE_YEAR 21
#define VERSION_DATE_MONTH 11
#define VERSION_DATE_DAY 10
#define VERSION_DATE_HOUR 17
#define VERSION_DATE_MINUTE 58
@@ -30,6 +30,12 @@
#define SPI_BUFFER_SIZE 16
/**
* the pointer to point which channel is used currently.
* -1 for not beginning.
*/
static int8 channel_pointer = -1;
static uint8_t spi_txbuf[SPI_BUFFER_SIZE] = {0};
static uint8_t spi_rxbuf[SPI_BUFFER_SIZE] = {0};
@@ -129,16 +135,16 @@ static void update_ins_sti_channel(uint8_t *buf, uint8 sti_chp, uint8 sti_chn) {
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 amp_gain = (instru.amp_gain & 0b11) << 3;
uint8 amp_lbf = instru.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 chopper = (instru.chopper) ? 0b00001000 : 0;
uint8 fast_settle = (instru.fast_settle) ? 0b00000100 : 0;
uint8 sti_enable = (instru.work_mode != STI_MODE_DISABLE) ? 0b00000010 : 0;
uint8 sti_volt_l = (instru.sti_volt & 0b11111) >> 4;
uint8 sti_volt_h = (instru.sti_volt & 0b01111) << 4;
uint8 sti_chp = instru.sti_channel_pmos & 0b1111;
uint8 sti_chn = (instru.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;
@@ -193,7 +199,7 @@ static bool update_ins_rec_buffer() {
* @param: buf: pointer of the SPI buffer.
*/
static void update_ins_sti_buffer() {
switch (INSTRUCTION.work_mode) {
switch (instru.work_mode) {
case STI_MODE_POS:
case STI_MODE_NEG:
// copy [4:7]
@@ -215,7 +221,7 @@ static void update_ins_sti_buffer() {
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);
update_ins_sti_channel(spi_txbuf + 4, 0xF, instru.sti_channel_pmos);
// ins buf [8:B]
update_ins_sti_enable(spi_txbuf + 8, FALSE);
break;
@@ -238,13 +244,13 @@ static void update_ins_sti_buffer() {
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);
update_ins_sti_channel(spi_txbuf + 0, instru.sti_channel_pmos, instru.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);
update_ins_sti_channel(spi_txbuf + 4, instru.sti_channel_nmos, instru.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);
update_ins_sti_channel(spi_txbuf + 8, 0xF, instru.sti_channel_nmos);
// ins buf [C:F]
update_ins_sti_enable(spi_txbuf + 12, FALSE);
break;
@@ -281,12 +287,12 @@ static void headstage_tni_update_instruction_callback(uint8_t ins_type, uint8_t
}
static uint8_t *spi_transact_rec_instruction() {
if (IS_REC_MODE(INSTRUCTION.work_mode)) {
if (IS_REC_MODE(instru.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) {
} else if (IS_ARM_MODE(instru.work_mode) && !adc_clock_signal) {
create_ramp(spi_rxbuf);
}
@@ -22,7 +22,7 @@
#include "EliteWorkData.h"
#include <driverlib/aon_batmon.h>
static void SimpleBLEPeripheral_performPeriodicTask(WorkMode *WorkModeData);
static void SimpleBLEPeripheral_performPeriodicTask(void);
static void SimpleBLEPeripheral_clockHandler(UArg arg) {
// Store the event.
@@ -47,20 +47,25 @@ static void ZM_init() {
// initialize
pin_handle = PIN_open(&ZM_rst, BLE_IO);
Init_Elite15_PIN();
ELITE15_SPI_HOLD();
PIN15_setOutputValue(shutdown_6994, 1); // OFF = 1 => turn off 6994
PIN15_setOutputValue(enable_10v, 0); // enable 10V
PIN15_setOutputValue(ADC_CS, 1); // ADC_CS HIGH
PIN15_setOutputValue(DAC_CS, 1); // DAC_CS HIGH
PIN15_setOutputValue(MEM_CS, 1); // MEM_CS HIGH
PIN15_setOutputValue(HIGH_Z_MODE, 0); // HIGH Z MODE
PIN15_setOutputValue(HIGH_Z_MODE, 0); // HIGH Z MODE // 1: close; 0: open;
InitEliteInstruction();
IinADCGainControl(INSTRUCTION.ADCGainLevel);
VinADCGainControl(INSTRUCTION.VinADCGainLevel);
VoutGainControl(INSTRUCTION.VoutGainLevel);
// init DAC, set output ~= 0 V
instru.VoutGainLv = VOUT_GAIN_15K;
VoutGainControl(instru.VoutGainLv);
DAC_outputV(Usercode_Correction_to_DAC(instru.VoutGainLv, 25000));
/* when elite open, must change vin level,
measure battery value will be right */
VinADCGainCtrl(VIN_GAIN_AUTO);
elite_gptimer_open();
elite_gptimer_start();
// PIN_registerIntCb(pin_handle, switch_on_callback);
// PIN_setInterrupt(pin_handle, switch_on | PIN_IRQ_POSEDGE);
@@ -68,36 +73,355 @@ static void ZM_init() {
static void ZM_update_instruction_callback(uint8_t ins_type, uint8_t chip_ID, uint8_t *ins) {}
#define IsPeriodicMode() ( \
(instru.eliteFxn == CURVE_IV) || \
(instru.eliteFxn == CURVE_IV_CY) || \
(instru.eliteFxn == CURVE_IT) || \
(instru.eliteFxn == CURVE_VT) || \
(instru.eliteFxn == CURVE_RT) || \
(instru.eliteFxn == CURVE_CC) || \
(instru.eliteFxn == CURVE_CV) || \
(instru.eliteFxn == CURVE_LSV) || \
(instru.eliteFxn == CURVE_CA) || \
(instru.eliteFxn == CURVE_VO) || \
(instru.eliteFxn == CURVE_OCP) || \
(instru.eliteFxn == CURVE_CALI_ADC) \
)
static void DACCode2Real2Notify(uint16_t DACcode) {
int32_t RealV;
RealV = DAC_to_realV(INSTRUCTION.VoutGainLevel, DACcode);
#define Ve1MatchVe2Mode() ( \
(instru.eliteFxn == CURVE_IV) || \
(instru.eliteFxn == CURVE_IV_CY) || \
(instru.eliteFxn == CURVE_CV) || \
(instru.eliteFxn == CURVE_LSV) \
)
static void pulse_mode(void)
{
// Default working flow is vscan -> ADC read -> send notify
// We will need a flag to control vscan, ADC and notify
if(mode_init){
GPT.SampleRateCounter = instru.sampleRate - 10;
GPT.VscanRateCounter = instru.VsetRate - 1;
mode_init = false;
batteryADC_flag = false;
volt_rec_en = true;
curr_rec_en = true;
firstTimeReset = true;
notifyFirst_flag = true;
//pulsemode variable
stiFirstTime = true;
VinADCGainCtrl(instru.VinADCGainLv);
IinADCGainCtrl(instru.IinADCGainLv);
VoutGainControl(instru.VoutGainLv);
if (Ve1MatchVe2Mode()) {
if (instru.Ve1 == instru.Ve2) {
DAC_outputV(Usercode_Correction_to_DAC(instru.VoutGainLv, instru.Ve1));
PeriodicEvent = false;
PIN15_setOutputValue(HIGH_Z_MODE, 0); // 0: open highz;
ModeLED(NO_EVENT);
}
} else if (instru.eliteFxn == CURVE_PULSE) {
if(!megaStiEnable){
PeriodicEvent = false;
PIN15_setOutputValue(HIGH_Z_MODE, 0); // 0: open highz;
ModeLED(NO_EVENT);
}
}
}
GPT.LeadTimeCounter = GPT.LeadTimeCounter + GPT.DeltaGptimerCounter;
if(leadTimeReset && GPT.LeadTimeCounter <= 2000){
vscanReset = true;
}else{
if(notifyFirst_flag){
GPT.NotifyCounter = instru.notifyRate - 20;
notifyFirst_flag = false;
}
vscanReset = false;
leadTimeReset = false;
}
//vscan counter
GPT.VscanRateCounter = GPT.VscanRateCounter + GPT.DeltaGptimerCounter;
//pulse mode counter
GPT.StiCounter = GPT.StiCounter + GPT.DeltaGptimerCounter;
if (vscanReset) {
DAC_outputV(Usercode_Correction_to_DAC(instru.VoutGainLv, 25000));
DAC_outputV(Usercode_Correction_to_DAC(instru.VoutGainLv, 25000));
//vscanReset = false;
}else{
if (megaStiEnable) {
pulse_vscan();
}
}
//battery counter
GPT.BatteryADCCounter = GPT.BatteryADCCounter + GPT.DeltaGptimerCounter;
GPT.BatteryCheckCounter = GPT.BatteryCheckCounter + GPT.DeltaGptimerCounter;
if(GPT.BatteryCheckCounter >= 50000){
GPT.BatteryCheckCounter -= 50000; //To get right time
batteryCheck_flag = true;
tempCheck_flag = true;
}
uint16_t bat = ((uint16_t)(NotifyVoltBat[2]) << 8 & 0xFF00 ) | ((uint16_t)(NotifyVoltBat[3]) & 0x00FF);
if( bat < 768 && bat > 20){
PIN15_setOutputValue(enable_5v, 0);
}
//ADC counter
GPT.SampleRateCounter = GPT.SampleRateCounter + GPT.DeltaGptimerCounter;
if(GPT.SampleRateCounter >= instru.sampleRate){
GPT.SampleRateCounter = 0; //To get right data, ADC must be delay 1.5ms
EliteADCControl(0);
}
//Notify counter(Notify control, check if we need to send notify)
//please don't put Notify counter before ADC counter, maybe get wrong data
GPT.NotifyCounter = GPT.NotifyCounter + GPT.DeltaGptimerCounter;
if(GPT.NotifyCounter >= instru.notifyRate){
GPT.NotifyCounter -= instru.notifyRate; //To get right time
notify_flag = true;
if(vscanReset){
notify_flag = false;
}
if(notify_flag){
SendNotify();
notify_flag = false;
}
}
mode_done();
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) || \
(INSTRUCTION.eliteFxn == CYCLIC_VOLTAMMETRY) || \
(INSTRUCTION.eliteFxn == LINEAR_SWEEP_VOLTAMMETRY) || \
(INSTRUCTION.eliteFxn == CONSTANT_VSCAN) || \
(INSTRUCTION.eliteFxn == CALI_ADC_MODE) \
)
static void peri_mode(void)
{
#define Ve1MatchVe2Mode() ( \
(INSTRUCTION.eliteFxn == IV_CURVE) || \
(INSTRUCTION.eliteFxn == CV_CURVE) || \
(INSTRUCTION.eliteFxn == CYCLIC_VOLTAMMETRY) || \
(INSTRUCTION.eliteFxn == LINEAR_SWEEP_VOLTAMMETRY) \
)
GPT.LeadTimeCounter = GPT.LeadTimeCounter + GPT.DeltaGptimerCounter;
if (leadTimeReset && GPT.LeadTimeCounter <= 2000) {
vscanReset = true;
if (first_highz_flag && GPT.LeadTimeCounter >= 1000) {
if (instru.eliteFxn == CURVE_OCP) {
PIN15_setOutputValue(HIGH_Z_MODE, 0);
} else {
PIN15_setOutputValue(HIGH_Z_MODE, 1); // HIGH Z MODE // 1: close; 0: open;
}
first_highz_flag = false;
}
} else {
if (notifyFirst_flag) {
GPT.NotifyCounter = instru.notifyRate - 20;
notifyFirst_flag = false;
}
vscanReset = false;
leadTimeReset = false;
}
//vscan counter
GPT.VscanRateCounter = GPT.VscanRateCounter + GPT.DeltaGptimerCounter;
if (GPT.VscanRateCounter >= instru.VsetRate) {
if (GPT.VscanRateCounter >= instru.VsetRate * 2) {
GPT.GptimerMultiple = GPT.VscanRateCounter / instru.VsetRate;
} else {
GPT.GptimerMultiple = 1;
}
GPT.VscanRateCounter -= instru.VsetRate * GPT.GptimerMultiple; //To get right time
vscan_ctrl(0);
}
//battery counter
GPT.BatteryADCCounter = GPT.BatteryADCCounter + GPT.DeltaGptimerCounter;
GPT.BatteryCheckCounter = GPT.BatteryCheckCounter + GPT.DeltaGptimerCounter;
if(GPT.BatteryCheckCounter >= 50000){
GPT.BatteryCheckCounter -= 50000; //To get right time
batteryCheck_flag = true;
tempCheck_flag = true;
}
uint16_t bat = ((uint16_t)(NotifyVoltBat[2]) << 8 & 0xFF00 ) | ((uint16_t)(NotifyVoltBat[3]) & 0x00FF);
if( bat < 768 && bat > 20){
// PIN15_setOutputValue(enable_5v, 0);
}
//ADC counter
GPT.SampleRateCounter = GPT.SampleRateCounter + GPT.DeltaGptimerCounter;
if(GPT.SampleRateCounter >= instru.sampleRate){
GPT.SampleRateCounter = 0; //To get right data, ADC must be delay 1.5ms
EliteADCControl(0);
}
// Over temperature protection
uint16_t CC2650temp = ((uint16_t)(NotifyTemperature[2]) << 8 & 0xFF00 ) | ((uint16_t)(NotifyTemperature[3]) & 0x00FF);
if(CC2650temp > 40) {
PIN15_setOutputValue(enable_5v, 0);
}
//Notify counter(Notify control, check if we need to send notify)
//please don't put Notify counter before ADC counter, maybe get wrong data
GPT.NotifyCounter = GPT.NotifyCounter + GPT.DeltaGptimerCounter;
if(GPT.NotifyCounter >= instru.notifyRate){
GPT.NotifyCounter -= instru.notifyRate; //To get right time
notify_flag = true;
if(vscanReset){
notify_flag = false;
}
if (!volt_rec_en || !curr_rec_en) {
notify_flag = false;
}
if(notify_flag){
SendNotify();
notify_flag = false;
}
}
mode_done();
}
static void uni_pulse_mode(void)
{
// Default working flow is vscan -> ADC read -> send notify
// We will need a flag to control vscan, ADC and notify
GPT.LeadTimeCounter = GPT.LeadTimeCounter + GPT.DeltaGptimerCounter;
if (leadTimeReset && GPT.LeadTimeCounter <= 2000) {
vscanReset = true;
GPT.VscanRateCounter = 0xFFFFFFFF;
dpv_step_cnt = 0;
if (first_highz_flag && GPT.LeadTimeCounter >= 1000) {
PIN15_setOutputValue(HIGH_Z_MODE, instru.hign_z_en); // HIGH Z MODE // 1: close; 0: open;
first_highz_flag = false;
}
} else {
if (notifyFirst_flag) {
GPT.NotifyCounter = instru.notifyRate - 20;
notifyFirst_flag = false;
}
if (vscanReset) {
GPT.VscanRateCounter = 0xFFFFFFFF;
dpv_step_cnt = 0;
}
vscanReset = false;
leadTimeReset = false;
}
//vscan counter
GPT.VscanRateCounter = GPT.VscanRateCounter + GPT.DeltaGptimerCounter;
if (GPT.VscanRateCounter >= instru.period) {
GPT.VscanRateCounter -= instru.period; //To get right time
dpv_step_cnt +=1;
}
vscan_ctrl(GPT.VscanRateCounter);
//battery counter
GPT.BatteryADCCounter = GPT.BatteryADCCounter + GPT.DeltaGptimerCounter;
GPT.BatteryCheckCounter = GPT.BatteryCheckCounter + GPT.DeltaGptimerCounter;
if(GPT.BatteryCheckCounter >= 50000){
GPT.BatteryCheckCounter -= 50000; //To get right time
batteryCheck_flag = true;
tempCheck_flag = true;
}
//ADC counter
GPT.SampleRateCounter = GPT.SampleRateCounter + GPT.DeltaGptimerCounter;
if(GPT.SampleRateCounter >= instru.sampleRate){
GPT.SampleRateCounter = 0; //To get right data, ADC must be delay 1.5ms
EliteADCControl(GPT.VscanRateCounter);
}
uint16_t bat = ((uint16_t)(NotifyVoltBat[2]) << 8 & 0xFF00 ) | ((uint16_t)(NotifyVoltBat[3]) & 0x00FF);
if( bat < 768 && bat > 20){
// PIN15_setOutputValue(enable_5v, 0);
}
// Over temperature protection
uint16_t CC2650temp = ((uint16_t)(NotifyTemperature[2]) << 8 & 0xFF00 ) | ((uint16_t)(NotifyTemperature[3]) & 0x00FF);
if(CC2650temp > 40) {
PIN15_setOutputValue(enable_5v, 0);
}
//Notify counter(Notify control, check if we need to send notify)
//please don't put Notify counter before ADC counter, maybe get wrong data
GPT.NotifyCounter = GPT.NotifyCounter + GPT.DeltaGptimerCounter;
if(GPT.NotifyCounter >= instru.notifyRate){
GPT.NotifyCounter -= instru.notifyRate; //To get right time
notify_flag = true;
if (instru.eliteFxn == CURVE_UNI_PULSE || instru.eliteFxn == CURVE_DPV || instru.eliteFxn == CURVE_DPV_ADVANCE) {
notify_flag = false;
}
if(vscanReset){
notify_flag = false;
}
if (!volt_rec_en || !curr_rec_en) {
notify_flag = false;
}
if(notify_flag){
SendNotify();
notify_flag = false;
}
}
mode_done();
}
static void mode_init_set(void)
{
batteryADC_flag = false;
volt_rec_en = true;
curr_rec_en = true;
firstTimeReset = true;
notifyFirst_flag = true;
first_highz_flag = true;
DACReset = true;
vscanReset = true;
leadTimeReset = true;
if (instru.notifyRate > 1000) {
// slow notify rate, < 10sps, auto gain changer only use ADC gain level = 1.2.3.4
// gain_switch_on: [1:4]: none
// [5]: ADC gain level = 4, if value = 1, gain 4 switch on
// [6]: ADC gain level = 3, if value = 1, gain 3 switch on
// [7]: ADC gain level = 2, if value = 1, gain 2 switch on
// [8]: ADC gain level = 1, if value = 1, gain 1 switch on
instru.gain_switch_on = 0b11110000;
} else {
// fast notify rate, >= 10sps, auto gain changer only use ADC gain level = 1.2.3
instru.gain_switch_on = 0b01110000;
}
if (instru.IinADCGainLv == I_GAIN_AUTO) {
instru.IinADCGainLv = I_GAIN_100R;
}
if (instru.VinADCAutoGainEn == VIN_GAIN_AUTO) {
instru.VinADCGainLv = VIN_GAIN_1K;
}
VinADCGainCtrl(instru.VinADCGainLv);
IinADCGainCtrl(instru.IinADCGainLv);
VoutGainControl(instru.VoutGainLv);
if (Ve1MatchVe2Mode()) {
if (instru.Ve1 == instru.Ve2) {
DAC_outputV(Usercode_Correction_to_DAC(instru.VoutGainLv, instru.Ve1));
PeriodicEvent = false;
PIN15_setOutputValue(HIGH_Z_MODE, 0); // 0: open highz;
ModeLED(NO_EVENT);
}
}
return;
}
/*********************************************************************
* @fn SimpleBLEPeripheral_performPeriodicTask
@@ -108,211 +432,317 @@ static void DACCode2Real2Notify(uint16_t DACcode) {
*
* @return None.
*/
static void SimpleBLEPeripheral_performPeriodicTask(WorkMode *WorkModeData) {
if ( IsPeriodicMode() ){
/** Periodic Event **/
// Default working flow is vscan -> ADC read -> send notify
// We will need a flag to control vscan, ADC and notify
static void SimpleBLEPeripheral_performPeriodicTask(void)
{
GPT.DeltaGptimerCounter = GPT.GptimerCounter - GPT.GptimerCounter0;
GPT.GptimerCounter0 = GPT.GptimerCounter;
GPT.DeltaGptimerCounter = GPT.GptimerCounter - GPT.GptimerCounter0;
GPT.GptimerCounter0 = GPT.GptimerCounter;
if(EliteWorkReset){
InitEliteGPtimer();
EliteWorkReset = false;
batteryADC_flag = false;
record_flag = true;
VinADCGainControl(INSTRUCTION.VinADCGainLevel);
IinADCGainControl(INSTRUCTION.ADCGainLevel);
VoutGainControl(INSTRUCTION.VoutGainLevel);
if( Ve1MatchVe2Mode() ){
if (INSTRUCTION.Ve1 == INSTRUCTION.Ve2) {
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.Ve1));
PeriodicEvent = false;
ELITE15_SPI_CLOSE();
ModeLED(NO_EVENT);
}
}
if (IsPeriodicMode()) {
if (mode_init) {
GPT.SampleRateCounter = instru.sampleRate - 10;
GPT.VscanRateCounter = instru.VsetRate - 1;
mode_init = false;
mode_init_set();
}
peri_mode();
GPT.LeadTimeCounter = GPT.LeadTimeCounter + GPT.DeltaGptimerCounter;
if(leadTimeReset && GPT.LeadTimeCounter <= 2000){
vscanReset = true;
}else{
if(notifyFirst_flag){
GPT.NotifyCounter = INSTRUCTION.notifyRate - 20;
notifyFirst_flag = false;
}
vscanReset = false;
leadTimeReset = false;
}
//vscan counter
GPT.VscanRateCounter = GPT.VscanRateCounter + GPT.DeltaGptimerCounter;
if(GPT.VscanRateCounter >= INSTRUCTION.VsetRate){
if(GPT.VscanRateCounter >= INSTRUCTION.VsetRate * 2){
GPT.GptimerMultiple = GPT.VscanRateCounter / INSTRUCTION.VsetRate;
}else{
GPT.GptimerMultiple = 1;
}
GPT.VscanRateCounter -= INSTRUCTION.VsetRate * GPT.GptimerMultiple; //To get right time
vscan_flag = true;
if(vscan_flag){
EliteVscanControl(WorkModeData);
vscan_flag = false;
}
}
//battery counter
GPT.BatteryADCCounter = GPT.BatteryADCCounter + GPT.DeltaGptimerCounter;
GPT.BatteryCheckCounter = GPT.BatteryCheckCounter + GPT.DeltaGptimerCounter;
if(GPT.BatteryCheckCounter >= 50000){
GPT.BatteryCheckCounter -= 50000; //To get right time
batteryCheck_flag = true;
}
uint16_t bat = ((uint16_t)(NotifyVoltBat[2]) << 8 & 0xFF00 ) | ((uint16_t)(NotifyVoltBat[3]) & 0x00FF);
if( bat < 768 && bat > 20){
PIN15_setOutputValue(enable_5v, 0);
}
//ADC counter
GPT.SampleRateCounter = GPT.SampleRateCounter + GPT.DeltaGptimerCounter;
if(GPT.SampleRateCounter >= INSTRUCTION.sampleRate){
GPT.SampleRateCounter = 0; //To get right data, ADC must be delay 1.5ms
ADC_flag = true;
if(ADC_flag){
EliteADCControl(WorkModeData);
ADC_flag = false;
}
}
//Notify counter(Notify control, check if we need to send notify)
//please don't put Notify counter before ADC counter, maybe get wrong data
GPT.NotifyCounter = GPT.NotifyCounter + GPT.DeltaGptimerCounter;
if(GPT.NotifyCounter >= INSTRUCTION.notifyRate){
GPT.NotifyCounter -= INSTRUCTION.notifyRate; //To get right time
notify_flag = true;
if(vscanReset){
notify_flag = false;
}
if(notify_flag){
SendNotify();
notify_flag = false;
}
}
// EliteDone();
}else if(INSTRUCTION.eliteFxn == VOLT_OUTPUT){
WorkModeData->VO->_Vset = INSTRUCTION.VoltConstant;
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, WorkModeData->VO->_Vset)); //UserCode -> DAC code -> DAC out
FreeWorkMode(WorkModeData);
PeriodicEvent = false;
ELITE15_SPI_CLOSE();
}else if(INSTRUCTION.eliteFxn == CALI_DAC_MODE){
DAC_outputV(INSTRUCTION.VoltConstant); //UserCode -> DAC code -> DAC out
FreeWorkMode(WorkModeData);
PeriodicEvent = false;
ELITE15_SPI_CLOSE();
return;
}
else{
InitFlag();
if (instru.eliteFxn == CURVE_UNI_PULSE) {
if (mode_init) {
mode_init = false;
mode_init_set();
calc_avg_en = false;
}
uni_pulse_mode();
return;
}
if (instru.eliteFxn == CURVE_DPV || instru.eliteFxn == CURVE_DPV_ADVANCE) {
if (mode_init) {
mode_init = false;
mode_init_set();
calc_avg_en = false;
}
uni_pulse_mode();
return;
}
if (instru.eliteFxn == CURVE_DPV_SMPRATE || instru.eliteFxn == CURVE_DPV_ADVANCE_SMPRATE) {
if (mode_init) {
mode_init = false;
mode_init_set();
}
uni_pulse_mode();
return;
}
return;
}
/*
* EliteADCControl(): use ADC plot, and send what data to controller
* +-----------------+-----------+-----------+-----------+
* | MODE | ch1 | ch2 | ch3 |
* +-----------------+-----------+-----------+-----------+
* | CURVE_IV | Iin | Vout | Vin |
* | CURVE_IV_CY | Iin | Vout | Vin |
* | CURVE_VO | Iin | Vout | Vin |
* | CURVE_RT | Iin | Vout | R |
* | CURVE_VT | Iin | Vin | |
* | CURVE_IT | Iin | Vin | Vout |
* | CURVE_CC | Iin | Vin | Vout |
* | CURVE_CV | Iin | Vout-Vin | Vout |
* | CURVE_LSV | Iin | Vout-Vin | Vout |
* | CURVE_CA | Iin | Vout-Vin | Vout |
* | CURVE_OCP | Iin | Vmon-Vin | Vin |
* | CURVE_UNI_PULSE | pul1_Iin | pul2_Iin | |
* +-----------------+-----------+-----------+-----------+
*/
static void EliteADCControl(uint32_t time)
{
void *wm = wm_get();
uint32_t t = time;
switch (instru.eliteFxn) {
case CURVE_IV:
case CURVE_IV_CY:
Iin_Vin_Vout_Plot(t);
if (curr_rec_en) {
InputNotify(NOTIFY_CURRENT, MEAS_CURR(wm));
}
if (volt_rec_en) {
InputNotify(NOTIFY_VOLT, instru.Vout/200);
InputNotify(NOTIFY_IMPEDANCE, MEAS_VIN(wm));
}
break;
case CURVE_RT:
Iin_Vin_Vout_Plot(t);
if (curr_rec_en) {
InputNotify(NOTIFY_CURRENT, MEAS_CURR(wm));
}
if (volt_rec_en) {
InputNotify(NOTIFY_VOLT, instru.Vout/200);
}
break;
case CURVE_CC:
Iin_Vin_Vout_Plot(t);
if (curr_rec_en) {
InputNotify(NOTIFY_CURRENT, MEAS_CURR(wm));
}
if (volt_rec_en) {
InputNotify(NOTIFY_VOLT, MEAS_VIN(wm));
InputNotify(NOTIFY_IMPEDANCE, instru.Vout/200);
}
break;
case CURVE_CV:
case CURVE_CA:
case CURVE_LSV:
Iin_Vin_Vout_Plot(t);
if (curr_rec_en) {
InputNotify(NOTIFY_CURRENT, MEAS_CURR(wm));
}
if (volt_rec_en) {
InputNotify(NOTIFY_VOLT, instru.Vout/200 - MEAS_VIN(wm));
InputNotify(NOTIFY_IMPEDANCE, instru.Vout/200);
}
break;
case CURVE_PULSE:
Iin_Vin_Vout_Plot(t);
if (curr_rec_en) {
InputNotify(NOTIFY_CURRENT, MEAS_CURR(wm));
}
if (volt_rec_en) {
InputNotify(NOTIFY_VOLT, MEAS_VIN(wm));
InputNotify(NOTIFY_IMPEDANCE, MEAS_VOUT(wm));
}
break;
case CURVE_IT:
Iin_Vin_Vout_Plot(t);
if (curr_rec_en) {
InputNotify(NOTIFY_CURRENT, MEAS_CURR(wm));
}
if(volt_rec_en) {
InputNotify(NOTIFY_VOLT, MEAS_VIN(wm));
InputNotify(NOTIFY_IMPEDANCE, instru.Vout/200);
}
break;
case CURVE_VT:
Iin_Vin_Plot();
if (curr_rec_en) {
InputNotify(NOTIFY_CURRENT, MEAS_CURR(wm));
}
if (volt_rec_en) {
InputNotify(NOTIFY_VOLT, MEAS_VIN(wm));
}
break;
case CURVE_VO:
Iin_Vin_Vout_Plot(t);
if (curr_rec_en) {
InputNotify(NOTIFY_CURRENT, MEAS_CURR(wm));
}
if (volt_rec_en) {
InputNotify(NOTIFY_VOLT, instru.Vout/200);
InputNotify(NOTIFY_IMPEDANCE, MEAS_VIN(wm));
}
break;
case CURVE_OCP:
Iin_Vin_Vout_Plot(t);
if (curr_rec_en) {
InputNotify(NOTIFY_CURRENT, MEAS_CURR(wm));
}
if (volt_rec_en) {
InputNotify(NOTIFY_VOLT, MEAS_VOUT(wm) - MEAS_VIN(wm));
InputNotify(NOTIFY_IMPEDANCE, MEAS_VIN(wm));
}
break;
case CURVE_CALI_ADC:
if (instru.AdcChannel == RIS_ADC_IIN) {
cali_IT_plot();
} else if (instru.AdcChannel == RIS_ADC_VIN) {
cali_VT_plot();
} else if (instru.AdcChannel == RIS_DAC_VOUT) {
cali_Vout_plot();
}
break;
case CURVE_UNI_PULSE:
IT_Plot(t);
break;
case CURVE_DPV:
Iin_Vin_Vout_Plot(t);
break;
case CURVE_DPV_SMPRATE:
Iin_Vin_Vout_Plot(t);
if (curr_rec_en) {
InputNotify(NOTIFY_CURRENT, MEAS_CURR(wm));
}
if (volt_rec_en) {
InputNotify(NOTIFY_VOLT, instru.Vout/200 - MEAS_VIN(wm));
InputNotify(NOTIFY_IMPEDANCE, instru.Vout/200);
}
break;
case CURVE_DPV_ADVANCE:
Iin_Vin_Vout_Plot(t);
break;
case CURVE_DPV_ADVANCE_SMPRATE:
Iin_Vin_Vout_Plot(t);
if (curr_rec_en) {
InputNotify(NOTIFY_CURRENT, MEAS_CURR(wm));
}
if (volt_rec_en) {
InputNotify(NOTIFY_VOLT, instru.Vout/200 - MEAS_VIN(wm));
InputNotify(NOTIFY_IMPEDANCE, instru.Vout/200);
}
break;
default:
break;
}
}
static void EliteADCControl(WorkMode *WorkModeData) {
switch (INSTRUCTION.eliteFxn) {
case IV_CURVE:{
CC_Plot(WorkModeData);
break;
}
case CV_CURVE:{
CC_Plot(WorkModeData);
break;
}
case IT_CURVE:{
IT_Plot(WorkModeData);
break;
}
case VT_CURVE:{
VT_Plot(WorkModeData);
break;
}
case ZT_CURVE:{
CC_Plot(WorkModeData);
break;
}
case CONSTANT_CURRENT:{
CC_Plot(WorkModeData);
break;
}
case CYCLIC_VOLTAMMETRY:{
CC_Plot(WorkModeData);
break;
}
case LINEAR_SWEEP_VOLTAMMETRY:{
CC_Plot(WorkModeData);
break;
}
case CONSTANT_VSCAN:{
CC_Plot(WorkModeData);
break;
}
case CALI_ADC_MODE:{
if(INSTRUCTION.AdcChannel == IIN_ADC){
cali_IT_plot(WorkModeData);
}else if(INSTRUCTION.AdcChannel == VIN_ADC){
cali_VT_plot(WorkModeData);
}
break;
}
default:{
break;
}
}
}
static void EliteDone() {
if ((INSTRUCTION.eliteFxn == IV_CURVE) || (INSTRUCTION.eliteFxn == CV_CURVE) || (INSTRUCTION.eliteFxn == CYCLIC_VOLTAMMETRY)) {
static void mode_done(void)
{
if ((instru.eliteFxn == CURVE_IV) ||
(instru.eliteFxn == CURVE_CV) ||
(instru.eliteFxn == CURVE_LSV) ||
(instru.eliteFxn == CURVE_IV_CY) ||
(instru.eliteFxn == CURVE_DPV) ||
(instru.eliteFxn == CURVE_DPV_SMPRATE) ||
(instru.eliteFxn == CURVE_DPV_ADVANCE) ||
(instru.eliteFxn == CURVE_DPV_ADVANCE_SMPRATE)) {
if (!PeriodicEvent) {
finishMode = true;
SendNotify();
Eliteinterrupt();
}
}
}
static void EliteVscanControl(WorkMode *WorkModeData) {
switch (INSTRUCTION.eliteFxn) {
case IV_CURVE:{
IV_Vscan(WorkModeData->IV);
static void vscan_ctrl(uint32_t time)
{
uint32_t t = time;
switch (instru.eliteFxn) {
case CURVE_IV:
iv_vscan();
break;
}
case CV_CURVE:{
CV_Vscan(WorkModeData->CV);
case CURVE_IV_CY:
iv_cy_vscan();
break;
}
case ZT_CURVE:{
ZT_Vscan(WorkModeData->RT);
case CURVE_VO:
vo_vscan();
break;
}
case CYCLIC_VOLTAMMETRY:{
CV3_Vscan(WorkModeData->CV3);
case CURVE_RT:
rt_vscan();
break;
}
case CONSTANT_CURRENT:{
CC_Vscan(WorkModeData->CC);
case CURVE_IT:
it_vscan();
break;
}
case LINEAR_SWEEP_VOLTAMMETRY:{
LSV_Vscan(WorkModeData->LSV);
case CURVE_CV:
cv_vscan();
break;
}
case CONSTANT_VSCAN:{
CVSCAN_Vscan(WorkModeData->CVSCAN);
case CURVE_LSV:
lsv_vscan();
break;
}
case CURVE_CA:
ca_vscan();
break;
case CURVE_UNI_PULSE:
uni_pulse_vscan(t);
break;
case CURVE_DPV:
case CURVE_DPV_SMPRATE:
dpv_vscan(t);
break;
case CURVE_DPV_ADVANCE:
case CURVE_DPV_ADVANCE_SMPRATE:
dpv_advance_vscan(t);
break;
default:{
break;
}
@@ -347,38 +777,16 @@ static void step2VsetRate(uint32_t step){
0.01mv, index = 4, n = 10000 */
if(step >= 10000){
INSTRUCTION.VsetRateIndex = 0;
instru.VsetRateIndex = 0;
}else if (step >= 1000){
INSTRUCTION.VsetRateIndex = 1;
instru.VsetRateIndex = 1;
}else if (step >= 100){
INSTRUCTION.VsetRateIndex = 2;
instru.VsetRateIndex = 2;
}else if (step >= 10){
INSTRUCTION.VsetRateIndex = 3;
instru.VsetRateIndex = 3;
}else if (step >= 1){
INSTRUCTION.VsetRateIndex = 4;
instru.VsetRateIndex = 4;
}
}
static void InitFlag(){
PeriodicEvent = false; // is there an PeriodicEvent?
Free_Work_Mode = true; // Free(WorkModeData)
}
static void InitEliteGPtimer() {
GPT.SampleRateCounter = INSTRUCTION.sampleRate - 10;
GPT.VscanRateCounter = INSTRUCTION.VsetRate - 1;
notifyFirst_flag = true;
}
static void InitEliteFlag() {
InitPeriodicEvent = true; // need to create a WorkModeData?
DACReset = true;
vscanReset = true;
EliteWorkReset = true;
leadTimeReset = true;
I_GAIN_100R_counter = 0;
I_GAIN_3K_counter = 0;
I_GAIN_100K_counter = 0;
I_GAIN_3M_counter = 0;
}
#endif /* IMPEDANCE_METER_H_ */
@@ -0,0 +1,879 @@
#ifndef SCAN_VOLT_H
#define SCAN_VOLT_H
#ifdef __cplusplus
extern "C" {
#endif
#define Vset instru.Vset
static void iv_vscan(void)
{
struct wm_iv_ctx_t *iv = (struct wm_iv_ctx_t *)wm_get();
if (vscanReset) {
if (instru.directionInit == 1) {
iv->_direction_up = true;
iv->_current_direction_up = true;
} else if (instru.directionInit == 0) {
iv->_direction_up = false;
iv->_current_direction_up = false;
}
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
if (instru.step <= 10) {
iv->_Vstep = instru.step * instru.VsetRate / 5;
} else {
iv->_Vstep = instru.step / 5 * instru.VsetRate;
}
Vset = iv->_Vinit;
}
if (!vscanReset) {
if (iv->_current_direction_up) {
if (Vset >= iv->_Vmax) {
PeriodicEvent = false;
}
} else {
if (Vset <= iv->_Vmin) {
PeriodicEvent = false;
}
}
if (iv->_current_direction_up) {
Vset = Vset + iv->_Vstep * GPT.GptimerMultiple;
} else {
Vset = Vset - iv->_Vstep * GPT.GptimerMultiple;
}
}
return;
}
static void iv_cy_vscan(void)
{
struct wm_iv_cy_ctx_t *iv_cy = (struct wm_iv_cy_ctx_t *)wm_get();
static bool VminCounter;
static bool VmaxCounter;
NotifyCycleNumber = (instru.cycleNumber - iv_cy->_cycleNumber + 1);
if(vscanReset){
VmaxCounter = false;
VminCounter = false;
if(instru.directionInit == 1){
iv_cy->_direction_up = true;
iv_cy->_current_direction_up = true;
}else if(instru.directionInit == 0){
iv_cy->_direction_up = false;
iv_cy->_current_direction_up = false;
}
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
if(instru.step <= 10){
iv_cy->_Vstep = instru.step * instru.VsetRate / 5;
}else{
iv_cy->_Vstep = instru.step / 5 * instru.VsetRate;
}
if(iv_cy->_Vmin == iv_cy->_Vinit){
VminCounter = true;
}
if(iv_cy->_Vmax == iv_cy->_Vinit){
VmaxCounter = true;
}
Vset = iv_cy->_Vinit;
}
if(!vscanReset){
if (Vset >= iv_cy->_Vmax){
VmaxCounter = true;
}else if (Vset <= iv_cy->_Vmin){
VminCounter = true;
}
if (iv_cy->_current_direction_up){
Vset = Vset + iv_cy->_Vstep * GPT.GptimerMultiple;
}else{
Vset = Vset - iv_cy->_Vstep * GPT.GptimerMultiple;
}
if(VmaxCounter && VminCounter){
if(iv_cy->_direction_up && iv_cy->_current_direction_up){
if(Vset >= iv_cy->_Vinit){
iv_cy->_cycleNumber--;
VminCounter = false;
VmaxCounter = false;
}
}
if(!iv_cy->_direction_up && !iv_cy->_current_direction_up){
if(Vset <= iv_cy->_Vinit){
iv_cy->_cycleNumber--;
VminCounter = false;
VmaxCounter = false;
}
}
}
if (Vset >= iv_cy->_Vmax){
iv_cy->_current_direction_up = false;
}else if (Vset <= iv_cy->_Vmin){
iv_cy->_current_direction_up = true;
}
/*stop condition*/
if(iv_cy->_cycleNumber == 0){
PeriodicEvent = false;
}
}
return;
}
static void it_vscan(void)
{
struct wm_it_ctx_t *it = (struct wm_it_ctx_t *)wm_get();
if (vscanReset) {
Vset = it->_Vinit;
}
if(!vscanReset) {
Vset = it->_Vinit;
}
return;
}
static void rt_vscan(void)
{
struct wm_rt_ctx_t *rt = (struct wm_rt_ctx_t *)wm_get();
if (vscanReset) {
Vset = rt->_Vinit;
}
if(!vscanReset) {
Vset = rt->_Vinit;
}
return;
}
static void vo_vscan(void)
{
struct wm_vo_ctx_t *vo = (struct wm_vo_ctx_t *)wm_get();
if (vscanReset) {
Vset = vo->_Vinit;
}
if(!vscanReset) {
Vset = vo->_Vinit;
}
return;
}
#define DELTAVOLTMAX 2000000 //2000000 = 10mV
static void cc_vscan(void)
{
/* 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
*/
struct wm_cc_ctx_t *cc = (struct wm_cc_ctx_t *)wm_get();
struct wm_meas_t *m = &cc->measure;
uint16_t divisionRate;
int32_t deltaI;
int32_t deltaV;
int32_t Iin;
int32_t Vin;
if (vscanReset) {
Vset = 0;
if (cc->_charge == 0) {
cc->_Iset = instru.constantCurrent * 200 * (-1);
//[50pA] //controller UI 15000uA => Elite 1500000 => 1500000 * 10 * 1000 / 50 [50pA];
}
Iin = m->_measureCurrent * 20; //[50pA] nA => 50pA
Vin = m->_measureVin * 200; //[5nV]
Vset = Vin + cc->_Iset / 20 ; //[5nV]
if (Vset >= 1100000000) { // 5.5V
Vset = 1100000000;
} else if (Vset <= -1000000000) { //-5V
Vset = -1000000000;
}
}
if (!vscanReset) {
Iin = m->_measureCurrent * 20; //[50pA] nA => 50pA
deltaI = Iin - cc->_Iset;
if (deltaI > 2000000 || deltaI < -2000000) { //100uA
divisionRate = 1;
} else {
divisionRate = 20;
}
deltaV = -1 * (deltaI / divisionRate); //-5 * deltaI / 5000 //pV=> 5nV
if (deltaV > DELTAVOLTMAX) { //2000000 = 10mV
deltaV = DELTAVOLTMAX;
} else if (deltaV < (-DELTAVOLTMAX)) {
deltaV = (-DELTAVOLTMAX);
}
Vset = Vset + deltaV; //[5nV]
if (Vset >= 1100000000) { // 5.5V
Vset = 1100000000;
} else if (Vset <= -1000000000) { //-5V
Vset = -1000000000;
}
if (Vset <= cc->_Vmin) {
Vset = cc->_Vmin;
} else if (Vset >= cc->_Vmax) {
Vset = cc->_Vmax;
}
}
return;
}
static void cv_vscan(void)
{
struct wm_cv_ctx_t *cv = (struct wm_cv_ctx_t *)wm_get();
static bool VminCounter;
static bool VmaxCounter;
NotifyCycleNumber = (instru.cycleNumber - cv->_cycleNumber + 1);
if (vscanReset) {
VmaxCounter = false;
VminCounter = false;
if (instru.directionInit == 1) {
cv->_direction_up = true;
cv->_current_direction_up = true;
} else {
cv->_direction_up = false;
cv->_current_direction_up = false;
}
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
if (instru.step <= 10) {
cv->_Vstep = instru.step * instru.VsetRate / 5;
} else {
cv->_Vstep = instru.step / 5 * instru.VsetRate;
}
if (cv->_Vmin == cv->_Vinit) {
VminCounter = true;
}
if (cv->_Vmax == cv->_Vinit) {
VmaxCounter = true;
}
Vset = cv->_Vinit;
}
if (!vscanReset) {
if ((instru.Vinit < instru.Ve1 && instru.Vinit < instru.Ve2) ||
(instru.Vinit > instru.Ve1 && instru.Vinit > instru.Ve2)
) {
if (cv->_current_direction_up) {
Vset = Vset + cv->_Vstep * GPT.GptimerMultiple;
} else {
Vset = Vset - cv->_Vstep * GPT.GptimerMultiple;
}
if (instru.Vinit < instru.Ve1 && instru.Vinit < instru.Ve2) {
if (Vset == cv->_Vmin) {
VminCounter = true;
instru.Vinit = instru.Vmin;
cv->_Vinit = cv->_Vmin;
}
} else if (instru.Vinit > instru.Ve1 && instru.Vinit > instru.Ve2) {
if (Vset == cv->_Vmax) {
VmaxCounter = true;
instru.Vinit = instru.Vmax;
cv->_Vinit = cv->_Vmax;
}
}
} else {
if (Vset >= cv->_Vmax) {
VmaxCounter = true;
} else if (Vset <= cv->_Vmin) {
VminCounter = true;
}
if (cv->_current_direction_up) {
Vset = Vset + cv->_Vstep * GPT.GptimerMultiple;
} else {
Vset = Vset - cv->_Vstep * GPT.GptimerMultiple;
}
if (VmaxCounter && VminCounter) {
if (cv->_direction_up && cv->_current_direction_up) {
if (Vset >= cv->_Vinit) {
cv->_cycleNumber--;
VminCounter = false;
VmaxCounter = false;
}
}
if (!cv->_direction_up && !cv->_current_direction_up) {
if (Vset <= cv->_Vinit) {
cv->_cycleNumber--;
VminCounter = false;
VmaxCounter = false;
}
}
}
if (Vset >= cv->_Vmax) {
cv->_current_direction_up = false;
} else if (Vset <= cv->_Vmin) {
cv->_current_direction_up = true;
}
/*stop condition*/
if (cv->_cycleNumber == 0) {
PeriodicEvent = false;
}
}
}
return;
}
static void lsv_vscan(void)
{
struct wm_lsv_ctx_t *lsv = (struct wm_lsv_ctx_t *)wm_get();
NotifyCycleNumber = (instru.cycleNumber - lsv->_cycleNumber + 1);
if (vscanReset) {
if (instru.directionInit == 1) {
lsv->_direction_up = true;
lsv->_current_direction_up = true;
} else {
lsv->_direction_up = false;
lsv->_current_direction_up = false;
}
//Vsetp = x * 20 * N, x=xmV ; N=VscanRate
if (instru.step <= 10) {
lsv->_Vstep = instru.step * instru.VsetRate / 5;
} else {
lsv->_Vstep = instru.step / 5 * instru.VsetRate;
}
Vset = lsv->_Vinit;
}
if (!vscanReset) {
if (lsv->_current_direction_up) {
Vset = Vset + lsv->_Vstep * GPT.GptimerMultiple;
} else {
Vset = Vset - lsv->_Vstep * GPT.GptimerMultiple;
}
/*stop condition*/
if (Vset >= lsv->_Vmax) {
PeriodicEvent = false;
} else if (Vset <= lsv->_Vmin) {
PeriodicEvent = false;
}
}
return;
}
static void ca_vscan(void)
{
struct wm_ca_ctx_t *ca = (struct wm_ca_ctx_t *)wm_get();
if(vscanReset){
Vset = ca->_Vinit;
}
if(!vscanReset){
Vset = ca->_Vinit;
}
return;
}
static void uni_pulse_vscan(uint32_t time)
{
uint32_t t = time;
struct wm_uni_pulse_ctx_t *p = (struct wm_uni_pulse_ctx_t *)wm_get();
uint32_t m;
uint32_t t_min;
uint32_t t_max;
if(vscanReset){
Vset = p->_v0;
return;
}
if(!vscanReset){
if (t == 0) {
m = 0;
} else {
m = t % p->_t_period;
}
if (m < p->_t_pa[0]) {
p->_Vset = p->_v_initial[0] + p->_v_slope[0] * t + p->_v_step[0] * (int32_t)(t / p->_t_period);
Vset = p->_Vset;
t_min = p->_t_pulse_min[0];
t_max = p->_t_pulse_max[0];
if (m > t_min && m < t_max) {
calc_avg_en = true;
} else {
calc_avg_en = false;
}
return;
}
if (m < p->_t_pa[1]) {
p->_Vset = p->_v_initial[1] + p->_v_slope[1] * t + p->_v_step[1] * (int32_t)(t / p->_t_period);
Vset = p->_Vset;
t_min = p->_t_pa[0] + p->_t_pulse_min[1];
t_max = p->_t_pa[0] + p->_t_pulse_max[1];
if (m > t_min && m < t_max) {
calc_avg_en = true;
} else {
calc_avg_en = false;
}
return;
}
if (m < p->_t_pa[2]) {
p->_Vset = p->_v_initial[2] + p->_v_slope[2] * t + p->_v_step[2] * (int32_t)(t / p->_t_period);
Vset = p->_Vset;
t_min = p->_t_pa[1] + p->_t_pulse_min[2];
t_max = p->_t_pa[1] + p->_t_pulse_max[2];
if (m > t_min && m < t_max) {
calc_avg_en = true;
} else {
calc_avg_en = false;
}
return;
}
if (m < p->_t_pa[3]) {
p->_Vset = p->_v_initial[3] + p->_v_slope[3] * t + p->_v_step[3] * (int32_t)(t / p->_t_period);
Vset = p->_Vset;
t_min = p->_t_pa[2] + p->_t_pulse_min[3];
t_max = p->_t_pa[2] + p->_t_pulse_max[3];
if (m > t_min && m < t_max) {
calc_avg_en = true;
} else {
calc_avg_en = false;
}
return;
}
return;
}
return;
}
static void dpv_vscan(uint32_t time)
{
uint32_t t = time;
struct wm_dpv_ctx_t *p = (struct wm_dpv_ctx_t *)wm_get();
uint32_t m;
uint32_t t_min;
uint32_t t_max;
if(vscanReset){
Vset = p->_v0;
return;
}
if(!vscanReset){
if (t == 0) {
m = 0;
} else {
m = t % p->_t_period;
}
if (m < p->_t_pa[0]) {
p->_Vset = p->_v_initial[0] + p->_v_slope[0] * t / 1000 + p->_v_step[0] * (int32_t)dpv_step_cnt; // _v_slope/100 = slope
Vset = p->_Vset;
t_min = p->_t_pulse_min[0];
t_max = p->_t_pulse_max[0];
if (m > t_min && m < t_max) {
calc_avg_en = true;
} else {
calc_avg_en = false;
}
if ((p->_v_curr_direc && Vset >= p->_v_stop) ||
(!p->_v_curr_direc && Vset <= p->_v_stop)) {
PeriodicEvent = false;
}
return;
}
if (m < p->_t_pa[1]) {
p->_Vset = p->_v_initial[1] + p->_v_slope[1] * t / 1000 + p->_v_step[1] * (int32_t)dpv_step_cnt;
Vset = p->_Vset;
t_min = p->_t_pa[0] + p->_t_pulse_min[1];
t_max = p->_t_pa[0] + p->_t_pulse_max[1];
if (m > t_min && m < t_max) {
calc_avg_en = true;
} else {
calc_avg_en = false;
}
return;
}
return;
}
return;
}
static void dpv_advance_vscan(uint32_t time)
{
uint32_t t = time;
struct wm_dpv_advance_ctx_t *p = (struct wm_dpv_advance_ctx_t *)wm_get();
uint32_t m;
uint32_t t_min;
uint32_t t_max;
static bool VminCounter;
static bool VmaxCounter;
if(vscanReset){
if (p->_v_direc_init) {
if (p->_v0 <= p->_v_up && p->_v0 <= p->_v_low && p->_v_2 > p->_v_1) {
VminCounter = true;
}
} else {
if (p->_v0 >= p->_v_up && p->_v0 >= p->_v_low && p->_v_1 > p->_v_2) {
VmaxCounter = true;
}
}
p->_Vset = p->_v0;
Vset = p->_Vset;
return;
}
if(!vscanReset){
if (t == 0) {
m = 0;
} else {
m = t % p->_t_period;
}
if (m < p->_t_pa[0]) {
t_min = p->_t_pulse_min[0];
t_max = p->_t_pulse_max[0];
if (m > t_min && m < t_max) {
calc_avg_en = true;
} else {
calc_avg_en = false;
}
p->_Vset = p->_v_initial[0] + p->_v_slope[0] * t / 1000 + p->_v_step[0] * (int32_t)dpv_step_cnt; // _v_slope/100 = slope
Vset = p->_Vset;
if (VminCounter == true && VmaxCounter == true) {
p->_cycleNumber--;
VminCounter = false;
VmaxCounter = false;
}
if (p->_cycleNumber <= 0) {
if (p->_v_stop_direction == true && p->_Vset >= p->_v_stop - p->_v_amp + p->_v_step[0]) {
PeriodicEvent = false;
} else if (p->_v_stop_direction == false && p->_Vset <= p->_v_stop - p->_v_amp + p->_v_step[0]) {
PeriodicEvent = false;
}
}
if (p->_v_curr_direc && p->_Vset >= p->_v_up - p->_v_amp + p->_v_step[0]) {
if (p->_v_invert_option) {
p->_v_amp = p->_v_amp * (-1);
}
p->_v_initial[0] = p->_Vset;
p->_v_initial[1] = p->_v_initial[0] + p->_v_amp;
dpv_step_cnt = 0;
p->_v_step[0] = (-1) * p->_v_step[0];
p->_v_step[1] = (-1) * p->_v_step[1];
p->_v_curr_direc = false;
VmaxCounter = true;
p->_Vset = p->_v_initial[0] + p->_v_slope[0] * t / 1000 * (int32_t)dpv_step_cnt; // _v_slope/100 = slope
Vset = p->_Vset;
} else if (!p->_v_curr_direc && p->_Vset <= p->_v_low - p->_v_amp + p->_v_step[0]) {
if (p->_v_invert_option) {
p->_v_amp = p->_v_amp * (-1);
}
p->_v_initial[0] = p->_Vset;
p->_v_initial[1] = p->_v_initial[0] + p->_v_amp;
dpv_step_cnt = 0;
p->_v_step[0] = (-1) * p->_v_step[0];
p->_v_step[1] = (-1) * p->_v_step[1];
p->_v_curr_direc = true;
VminCounter = true;
p->_Vset = p->_v_initial[0] + p->_v_slope[0] * t / 1000 * (int32_t)dpv_step_cnt; // _v_slope/100 = slope
Vset = p->_Vset;
}
return;
}
if (m < p->_t_pa[1]) {
p->_Vset = p->_v_initial[1] + p->_v_slope[1] * t / 1000 + p->_v_step[1] * (int32_t)dpv_step_cnt;
Vset = p->_Vset;
t_min = p->_t_pa[0] + p->_t_pulse_min[1];
t_max = p->_t_pa[0] + p->_t_pulse_max[1];
if (m > t_min && m < t_max) {
calc_avg_en = true;
} else {
calc_avg_en = false;
}
return;
}
return;
}
return;
}
static void pulse_vscan(void)
{
struct wm_pulse_ctx_t *pulse = (struct wm_pulse_ctx_t *)wm_get();
static uint16_t lastVolt;
if (stiFirstTime) {
stiFirstTime = false;
lastVolt = 25000;
pulse->_sti_t_flag = 1;
pulse->_sti_v = pulse->_sti_v1;
pulse->_sti_t = pulse->_sti_t1;
if (pulse->_sti_t == 1) {
pulse->_sti_v = lastVolt;
}
} else if(!stiFirstTime) {
if (GPT.StiCounter >= pulse->_sti_t) {
GPT.StiCounter -= pulse->_sti_t; //to get right time
if (pulse->_sti_lp > 0) {
if (pulse->_sti_cy > 0) {
if (pulse->_sti_t_flag == 1) {
pulse->_sti_t_flag = 2;
pulse->_sti_v = pulse->_sti_v2;
pulse->_sti_t = pulse->_sti_t2;
if (pulse->_sti_t == 1) {
pulse->_sti_v = lastVolt;
}
} else if (pulse->_sti_t_flag == 2) {
pulse->_sti_t_flag = 3;
pulse->_sti_v = pulse->_sti_v3;
pulse->_sti_t = pulse->_sti_t3;
if (pulse->_sti_t == 1) {
pulse->_sti_v = lastVolt;
}
} else if (pulse->_sti_t_flag == 3) {
pulse->_sti_cy -- ;
if (pulse->_sti_cy == 0) {
pulse->_sti_t_flag = 4;
pulse->_sti_v = pulse->_sti_v4;
pulse->_sti_t = pulse->_sti_t4;
if (pulse->_sti_t == 1) {
pulse->_sti_v = lastVolt;
}
} else {
pulse->_sti_t_flag = 2;
pulse->_sti_v = pulse->_sti_v2;
pulse->_sti_t = pulse->_sti_t2;
if (pulse->_sti_t == 1) {
pulse->_sti_v = lastVolt;
}
}
}
} else if (pulse->_sti_cy <= 0){
if (pulse->_sti_t_flag == 4) {
pulse->_sti_lp -- ;
if (pulse->_sti_lp > 0) {
pulse->_sti_cy = instru.sti_cy;
pulse->_sti_t_flag = 2;
pulse->_sti_v = pulse->_sti_v2;
pulse->_sti_t = pulse->_sti_t2;
if (pulse->_sti_t == 1) {
pulse->_sti_v = lastVolt;
}
} else {
pulse->_sti_t_flag = 5;
pulse->_sti_v = pulse->_sti_v5;
pulse->_sti_t = pulse->_sti_t5;
if (pulse->_sti_t == 1) {
pulse->_sti_v = lastVolt;
}
}
}
}
} else if (pulse->_sti_lp <= 0) {
if (pulse->_sti_t_flag == 5) {
pulse->_sti_t_flag = 6;
pulse->_sti_v = pulse->_sti_v6;
pulse->_sti_t = pulse->_sti_t6;
if (pulse->_sti_t == 1) {
pulse->_sti_v = lastVolt;
}
} else if (pulse->_sti_t_flag == 6) {
pulse->_sti_t_flag = 7;
pulse->_sti_v = pulse->_sti_v7;
pulse->_sti_t = pulse->_sti_t7;
if (pulse->_sti_t == 1) {
pulse->_sti_v = lastVolt;
}
} else if (pulse->_sti_t_flag == 7) {
pulse->_sti_v = 25000;
PeriodicEvent = false;
PIN15_setOutputValue(HIGH_Z_MODE, 0); // 0: open highz;
ModeLED(NO_EVENT);
}
}
}
}
if (lastVolt != pulse->_sti_v) {
lastVolt = pulse->_sti_v;
//if (pulse->_sti_v == 25000) {
// PIN15_setOutputValue(HIGH_Z_MODE, 0); // 1 => close high_z mode
//} else {
// PIN15_setOutputValue(HIGH_Z_MODE, 1); // 1 => close high_z mode
//}
DAC_outputV(Usercode_Correction_to_DAC(VOUT_GAIN_240K, pulse->_sti_v));
DAC_outputV(Usercode_Correction_to_DAC(VOUT_GAIN_240K, pulse->_sti_v));
}
return;
}
static void chg_vo_para(uint16_t parameter, int32_t value)
{
uint16_t pa = parameter;
int32_t val = value;
struct wm_vo_ctx_t *vo = (struct wm_vo_ctx_t *)wm_get();
if (pa == DAC_VOLT) {
vo->_Vinit = val;
}
return;
}
static void chg_it_para(uint16_t parameter, int32_t value)
{
uint16_t pa = parameter;
int32_t val = value;
struct wm_it_ctx_t *it = (struct wm_it_ctx_t *)wm_get();
if (pa == DAC_VOLT) {
it->_Vinit = val;
}
return;
}
static void chg_rt_para(uint16_t parameter, int32_t value)
{
uint16_t pa = parameter;
int32_t val = value;
struct wm_rt_ctx_t *rt = (struct wm_rt_ctx_t *)wm_get();
if (pa == DAC_VOLT) {
rt->_Vinit = val;
}
return;
}
static void set_para(uint8_t eliteFxn, uint16_t parameter, int32_t value)
{
uint8_t mode = eliteFxn;
uint16_t pa = parameter;
int32_t val = value;
if (mode == CURVE_VO) {
chg_vo_para(pa, val);
return;
}
if (mode == CURVE_IT) {
chg_it_para(pa, val);
return;
}
if (mode == CURVE_RT) {
chg_rt_para(pa, val);
return;
}
return;
}
#endif
@@ -543,25 +543,18 @@ static void SimpleBLEPeripheral_init(void) {
// static void detectKey_clockHandler(UArg arg);
static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
uint8_t key= 0;
bool EliteOn = 0;
uint16_t counter6994 = 0;
batteryADC_flag = false;
// Initialize application
SimpleBLEPeripheral_init();
ZM_init();
// Elite_SPI_init();
WorkMode *WorkModeData = CreateWorkMode();
uint8_t key = 0;
uint16_t counter6994 = 0;
bool EliteOn = 0;
// init DAC, set output ~= 0 V
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, 25000));
elite_gptimer_start();
// Application main loops
GPT.GptimerCounter0 = GPT.GptimerCounter;
batteryADC_flag = false;
headstage_battery_volt();
headstage_init_device_info();
@@ -612,27 +605,34 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
}
}
}
if(events & SBP_PERIODIC_EVT){
events &= ~SBP_PERIODIC_EVT;
if (!PeriodicEvent) { // if there is no periodic event
key = PIN_getInputValue(switch_on);
if (EliteOn) {
if (counter6994 < CLOCK_ONE_SECOND/2) { // counter6994 enable a IC after 35 counts
if (counter6994 < CLOCK_ONE_SECOND*5) { // counter6994 enable a IC after 35 counts
counter6994++;
} else if (counter6994 == CLOCK_ONE_SECOND/2) {
PIN15_setOutputValue(shutdown_6994, 1); // OFF = 1 => turn off 6994
} else if (counter6994 == CLOCK_ONE_SECOND*5) {
PIN15_setOutputValue(shutdown_6994, 0); // OFF = 1 => turn off 6994
counter6994++;
} else if (counter6994 > CLOCK_ONE_SECOND*5) {
counter6994 = 0;
}
EliteKeyPress(key);
GPT.DeltaGptimerCounter = GPT.GptimerCounter - GPT.GptimerCounter0;
GPT.GptimerCounter0 = GPT.GptimerCounter;
GPT.BatteryADCCounter = GPT.BatteryADCCounter + GPT.DeltaGptimerCounter;
GPT.BatteryCheckCounter = GPT.BatteryCheckCounter + GPT.DeltaGptimerCounter;
if(key != 0){ //detect Elite battery power when no periodic event
measureBat();
}
if(Free_Work_Mode){
FreeWorkMode(WorkModeData);
wm_deinit();
InitEliteInstruction();
IinADCGainControl(INSTRUCTION.ADCGainLevel);
DAC_outputV(Usercode_Correction_to_DAC(INSTRUCTION.VoutGainLevel, INSTRUCTION.VoltConstant));
Free_Work_Mode = false;
}
} else {
@@ -641,12 +641,12 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
}
else { // if there is periodic event
if(InitPeriodicEvent){
InitWorkMode(WorkModeData);
wm_init();
InitPeriodicEvent = false;
}
// Perform periodic application task
SimpleBLEPeripheral_performPeriodicTask(WorkModeData);
SimpleBLEPeripheral_performPeriodicTask();
key = PIN_getInputValue(switch_on);
EliteKeyPress(key); // onPress=> key = 0; 1.lighten LED 2.long press shut down 2650
}
@@ -925,16 +925,16 @@ static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState)
numActive = linkDB_NumActive();
// uint16_t cxnHandle;
//
// // requestedPDUSize = LL payload = L2CAP_header + ATT header + BLE_NOT_BUFF_SIZE = 7 + BLE_NOT_BUFF_SIZE //roy
// uint16_t requestedPDUSize = 251; //251 roy
// uint16_t requestTxTime = 2120; // (LL payload + 14) * 8 //2120 roy
// GAPRole_GetParameter(GAPROLE_CONNHANDLE, &cxnHandle);
//
// if (SUCCESS == HCI_LE_SetDataLenCmd(cxnHandle, requestedPDUSize, requestTxTime)) {
//// LED_color(DARKLED, 0xFF, 0x00, 0xFF);
// }
uint16_t cxnHandle;
// requestedPDUSize = LL payload = L2CAP_header + ATT header + BLE_NOT_BUFF_SIZE = 7 + BLE_NOT_BUFF_SIZE //roy
uint16_t requestedPDUSize = 251; //251 roy
uint16_t requestTxTime = 2120; // (LL payload + 14) * 8 //2120 roy
GAPRole_GetParameter(GAPROLE_CONNHANDLE, &cxnHandle);
if (SUCCESS == HCI_LE_SetDataLenCmd(cxnHandle, requestedPDUSize, requestTxTime)) {
// LED_color(DARKLED, 0xFF, 0x00, 0xFF);
}
// Use numActive to determine the connection handle of the last
// connection
@@ -975,6 +975,7 @@ static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState)
case GAPROLE_WAITING_AFTER_TIMEOUT:
SimpleBLEPeripheral_freeAttRsp(bleNotConnected);
ModeLED(BT_WAIT);
#ifdef PLUS_BROADCASTER
// Reset flag for next connection.