Compare commits

..

95 Commits

Author SHA1 Message Date
weiting2 f4d18daf67 send calibration coeff to controller from CIS 2020-01-08 14:00:47 +08:00
weiting2 ee9ba737b2 send calibration coeff to controller 2020-01-08 10:38:02 +08:00
weiting2 3acb175b76 send calibration coeff to controller 2020-01-07 17:07:40 +08:00
weiting2 b05b5e5a4f check LSK speed 2020-01-06 17:54:53 +08:00
weiting2 f39c2e2e03 new way to detect LSK 2020-01-06 16:38:22 +08:00
weiting2 d60ae2a72e new way to detect LSK 2020-01-06 16:01:45 +08:00
weiting2 17ae7862fc new way to detect LSK 2020-01-06 15:54:58 +08:00
weiting2 e9f568f301 new way to detect LSK 2020-01-06 15:35:06 +08:00
weiting2 f9947d2335 new way to detect LSK 2020-01-06 14:15:21 +08:00
yichin beaa81af70 error fix 2020-01-06 13:55:28 +08:00
yichin f918df6520 error fix 2020-01-06 13:54:35 +08:00
yichin 42782dbcdd error fix 2020-01-06 13:54:16 +08:00
weiting2 2758db39aa calibration table 2020-01-06 13:49:26 +08:00
yichin 6c82c6447c calibration table 2020-01-06 11:31:10 +08:00
yichin eaffe0b917 calibration 2020-01-06 11:30:34 +08:00
weiting2 bad7c412c8 Merge remote-tracking branch 'origin/neulive/development' into neulive/development 2020-01-06 10:56:00 +08:00
weiting2 71fcd7bffe new LSK decoder testing 2020-01-04 14:57:35 +08:00
yichin d5d2952fec error fix 2020-01-03 19:08:46 +08:00
yichin f130a9ce2a error fix 2020-01-03 18:50:43 +08:00
weiting2 9eebdcfa24 new LSK decoder testing 2020-01-03 18:13:22 +08:00
weiting2 12dca5bde4 new LSK decoder testing 2020-01-03 17:42:58 +08:00
weiting2 c5756104c0 new LSK decoder testing 2020-01-03 17:38:28 +08:00
weiting2 9f50fe43f7 new LSK decoder testing 2020-01-03 17:04:00 +08:00
weiting2 e28d246b60 new LSK decoder testing 2020-01-03 17:00:59 +08:00
weiting2 eb12cda156 new LSK decoder testing 2020-01-03 16:59:27 +08:00
weiting2 c0125497b3 new LSK decoder testing 2020-01-03 16:51:44 +08:00
weiting2 629f78f9e2 new LSK decoder testing 2020-01-03 16:08:45 +08:00
weiting2 5b0b11fb74 Merge remote-tracking branch 'origin/neulive/development' into neulive/development 2020-01-03 15:50:57 +08:00
weiting2 17ba44da8b error fix 2020-01-03 15:50:49 +08:00
yichin 09b40fa24a error fix 2020-01-03 15:38:47 +08:00
weiting2 92901e6963 error fix 2020-01-03 15:11:00 +08:00
weiting2 c94ae4a6d9 update LSK decode 2020-01-03 15:05:33 +08:00
weiting2 e1e2855d6f update LSK decode 2020-01-03 14:17:07 +08:00
weiting2 efa948a95b use preamble correctly 2020-01-03 12:19:47 +08:00
weiting2 222bb3a966 use preamble correctly 2020-01-02 19:25:28 +08:00
weiting2 ec7e082b27 check LSK to decide restart or not 2020-01-02 18:59:10 +08:00
weiting2 891d0c3f9a check LSK to decide restart or not 2020-01-02 18:38:37 +08:00
weiting2 e087cec666 check LSK to decide restart or not 2020-01-02 17:27:50 +08:00
weiting2 4da9b99cf6 check LSK to decide restart or not 2020-01-02 17:02:32 +08:00
weiting2 13c60bdaca check LSK to decide restart or not 2020-01-02 16:33:00 +08:00
weiting2 54bd693c87 check LSK to decide restart or not 2020-01-02 16:17:46 +08:00
weiting2 8ebca1228c check LSK to decide restart or not 2020-01-02 16:08:34 +08:00
weiting2 5c3a110c3c Merge remote-tracking branch 'origin/neulive/development' into neulive/development 2020-01-02 15:40:47 +08:00
weiting2 47b68817e2 check LSK to decide restart or not 2020-01-02 15:40:36 +08:00
yichin 4a5c76f13e Merge remote-tracking branch 'origin/neulive/development' into neulive/development 2020-01-02 15:29:26 +08:00
weiting2 2fd9b80a20 check LSK to decide restart or not 2020-01-02 15:29:11 +08:00
yichin 2fdd61c23c error fix 2020-01-02 15:23:12 +08:00
yichin 9ebf171d9b error fix 2020-01-02 15:21:56 +08:00
weiting2 28553126ef check LSK to decide restart or not 2020-01-02 15:20:39 +08:00
weiting2 04d2a60ea6 check LSK to decide restart or not 2020-01-02 14:18:08 +08:00
yichin 2eab4b6227 error fix 2020-01-02 13:40:07 +08:00
yichin 74e417136c Merge remote-tracking branch 'origin/neulive/development' into neulive/development 2020-01-02 13:34:35 +08:00
weiting2 91d4e8c42d check LSK to decide restart or not 2020-01-02 13:33:09 +08:00
yichin 3cb98ed6bb Merge remote-tracking branch 'origin/neulive/development' into neulive/development 2020-01-02 11:23:30 +08:00
weiting2 e9c8175e91 check LSK to decide restart or not 2020-01-02 11:12:40 +08:00
yichin 1347d89577 Merge remote-tracking branch 'origin/neulive/development' into neulive/development 2019-12-31 13:46:55 +08:00
weiting2 6e2a275f31 send recording para only 2019-12-31 13:44:42 +08:00
yichin f869c1ae3c Merge remote-tracking branch 'origin/neulive/development' into neulive/development 2019-12-31 11:50:31 +08:00
weiting2 6e9d4685fc go to config done directly 2019-12-31 11:49:37 +08:00
yichin cc55716b6e Merge remote-tracking branch 'origin/neulive/development' into neulive/development 2019-12-31 11:44:09 +08:00
weiting2 7a469c3231 go to config done directly 2019-12-31 11:42:18 +08:00
yichin f6400ee6c6 change ADC level timeOK 2019-12-31 11:28:35 +08:00
weiting2 7dd490adc1 go to config done directly 2019-12-31 11:25:10 +08:00
weiting2 224c2494c0 2650 send recording (amp) parameter only 2019-12-31 10:41:44 +08:00
weiting2 eff7e84dd7 2650 send recording (amp) parameter only 2019-12-30 11:07:37 +08:00
weiting2 c159b8b0d6 Merge remote-tracking branch 'origin/neulive/development' into neulive/development 2019-12-27 18:43:33 +08:00
weiting2 7918644b08 DBS using VIS break "start" instruction 2019-12-27 18:43:20 +08:00
YiChin 5a2b9a0061 error fix 2019-12-27 18:40:51 +08:00
YiChin 3292c9bcec error fix 2019-12-27 18:39:09 +08:00
weiting2 3effed2d65 DBS using VIS break "start" instruction 2019-12-27 18:37:11 +08:00
weiting2 f2d07eea76 DBS using VIS break "start" instruction 2019-12-27 16:42:29 +08:00
weiting2 0005e654c1 DBS interrupt & restart testing 2019-12-27 12:38:28 +08:00
weiting2 7a7f848930 DBS interrupt & restart testing 2019-12-27 12:28:13 +08:00
weiting2 e4e08ffbdc DBS interrupt & restart testing 2019-12-27 12:27:43 +08:00
weiting2 8774bad1b1 DBS interrupt & restart testing 2019-12-27 11:47:29 +08:00
weiting2 618e3ad01a DBS interrupt & restart testing 2019-12-27 10:33:59 +08:00
weiting2 8ed8201c0c VIS_FUH call DBS interrupt 2019-12-26 15:10:07 +08:00
YiChin c8f6ec239d error fix 2019-12-26 14:45:17 +08:00
weiting2 4930e8845b VIS_FUH call DBS interrupt 2019-12-26 14:38:51 +08:00
YiChin 5549d07208 error fix 2019-12-26 11:57:01 +08:00
weiting2 9380ecacec VIS_FUH call DBS interrupt 2019-12-26 11:51:52 +08:00
weiting2 e4a25a6225 DBS interrupt => back to configure => check if MUX configure correctly 2019-12-26 11:01:02 +08:00
weiting2 338b21fd65 read LSK directly to check restart issue 2019-12-25 17:16:15 +08:00
weiting2 b5762c0f65 FlushSPIrx(); make sure lsk pass check correct 2019-12-25 16:52:18 +08:00
weiting2 5799223d69 check configure instruction work well 2019-12-25 15:15:46 +08:00
weiting2 e72463b60a check configure instruction work well 2019-12-25 15:06:53 +08:00
weiting2 634f2fbd47 check configure instruction work well 2019-12-25 15:05:00 +08:00
weiting2 9aa508c6cf check configure instruction work well 2019-12-25 14:37:54 +08:00
weiting2 65a380cbca check configure instruction work well 2019-12-25 11:52:46 +08:00
weiting2 f1eb0dd727 check configure instruction work well 2019-12-25 11:19:21 +08:00
weiting2 a190f3212e add debug state in lsk; check every MISO SPI 2019-12-25 10:24:56 +08:00
weiting2 c5e55c4e96 add debug state in lsk; check every MISO SPI 2019-12-24 15:39:15 +08:00
weiting2 2a321cbd0e start PWM after turn on; add debug state in lsk 2019-12-24 15:23:47 +08:00
weiting2 468e4c491a test PWM (system clk) 2019-12-23 17:04:12 +08:00
weiting2 828f96c96c test PWM (system clk) 2019-12-23 16:49:35 +08:00
48 changed files with 1332 additions and 5669 deletions
+1 -2
View File
@@ -6,5 +6,4 @@ ccsv8/
simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/app/.config/
# CSS build files
FlashROM/
/Elite_test.txt
FlashROM/
-7
View File
@@ -1,7 +0,0 @@
MAC 18:04:ED:37:C6:6A .
. coeff offset
ADC_C1 311760871.760443 -50619.5024488329
ADC_C2 0.065484773376246 -1061.19682828209
ADC_C3 0.003142283837061 -50.9228211021286
DAC -1.05569320115838 -0.000624379961454
ADC_V1 56126.9201379636 10.1198174952741
-29
View File
@@ -1,29 +0,0 @@
no device y=ax+b MAC a+ b+ a- b- avg
1 c6be c6be 1804ED37C6BE 2270 -7040 2259 -14129 4.15063496100114
2 8cd0 8cd0 0081F9E48CD0 2199 -4616 2162 -16396 4.67288597901671
3 c694 c694 1804ED37C694 2354 -12824 2354 -11216 4.34663132771076
4 c6c7 c6c7 1804ED37C6C7 2199 -7238 2221 -15702 4.63164432837751
5 9b97 9b97 0081F9E49B97 2227 -9846 2151 -26609 4.75015860006776
6 c6df c6df 1804ED37C6DF 2132 -3844 2054 -21545 4.89066238118665
7 c652 c652 18:04:ED:37:C6:52 2024 -7687 2086 -11283 4.88850143182858
8 c5ed c5ed 18:04:ED:37:C5:ED 2231 -1711 2353 -70845 4.45265043545859
9 9bef 9bef 0081F9E49BEF 2383 -8585 2415 -20347 4.2758539244186
10 8b50 8b50 00:81:F9:E4:8B:50 2369 -11005 2360 -11797 4.30475635707671
11 c641 c641 18:04:ED:37:C6:41 2090 4616 1997 -40665 5.07591391714942
12 E8E6 E8E6 A4:DA:32:D4:E8:E6 2306 -88454 2418 -15140 4.2686494968089
13 E73B E73B A4:DA:32:D4:E7:3B 2262 -564 2298 44746 4.35551198222141
14 EEE2 EEE2 A4:DA:32:D4:EE:E2 2057 5980 2096 -21411 4.82094019052184
15 E871 E871 A4:DA:32:D4:E8:71 2175 -4549 2220 31468 4.60684608395208
16 EFC4 EFC4 A4:DA:32:D4:EF:C4 2348 -4371 2374 -26606 4.45106768611704
17 EF85 EF85 A4:DA:32:D4:EF:85 2136 -3339 2189 -30040 4.61909624778354
18 E7DA E7DA A4:DA:32:D4:E7:DA 2081 -3015 2122 -21543 4.79766509652981
19 E6EA E6EA A4:DA:32:D4:E6:EA 2039 -262 2127 -47259 4.79384458739747
20 EEDB EEDB A4:DA:32:D4:EE:DB 2214 -1170 2351 -24636 4.44485358085645
21 E73A E73A A4:DA:32:D4:E7:3A 2210 -4855 2339 -16434 4.47776494604746
22 E6CF E6CF A4:DA:32:D4:E6:CF 2135 -5206 2193 -30885 4.73462680884304
23 E76A E76A A4:DA:32:D4:E7:6A 2076 1154 2096 -1073 4.840805202
24 F0AC F0AC A4:DA:32:D4:F0:AC 2125 -6660 2170 -439 4.667508288
25 E87C E87C A4:DA:32:D4:E8:7C 2265 6685 2230 2124 4.529796387
26 EF39 EF39 A4:DA:32:D4:EF:39 1976 6641 2035 2834 5.071840495
27 E91D E91D A4:DA:32:D4:E9:1D 2075 6344 2002 -5562 5.036438558
28 E87A E87A A4:DA:32:D4:E8:7A 2180 6651 2254 136 4.60339152
-39
View File
@@ -1,39 +0,0 @@
#!/bin/bash
#path=$(pwd)
#folder=$($path | awk -F"/" '{$NF}')
folder=$(basename "$(pwd)")
if [ "$folder" == "bioprocc2650" ]; then
year=$(date +%-y)
month=$(date +%-m)
day=$(date +%-d)
hour=$(date +%-H)
minute=$(date +%-M)
hash=$(git rev-parse HEAD)
branch=$(git rev-parse --abbrev-ref HEAD)
sed -i "5c #define VERSION_DATE_YEAR ${year}"\
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_version.h
sed -i "6c #define VERSION_DATE_MONTH ${month}"\
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_version.h
sed -i "7c #define VERSION_DATE_DAY ${day}"\
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_version.h
sed -i "8c #define VERSION_DATE_HOUR ${hour}"\
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_version.h
sed -i "9c #define VERSION_DATE_MINUTE ${minute}"\
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_version.h
sed -i "13c #define VERSION_HASH ${hash}"\
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_version.h
sed -i "14c #define VERSION_GIT_BRANCH ${branch}"\
./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_version.h
#cat ./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_version.h
fi
@@ -1,9 +1,10 @@
/*
** Stack Frontier Generator 1.1.0 (2016-03-03 16:08:48.603000)
** Stack Frontier Generator 1.1.0 (2019-12-27 16:40:05.273000)
**
** WARNING - Auto-generated file. Modifications could be lost!
*/
--define=ICALL_STACK0_ADDR=0xd001
--define=ICALL_STACK0_START=0xd000
--define=ICALL_RAM0_START=0x200041e0
--define=ICALL_RAM0_START=0x20004160
@@ -1,9 +1,10 @@
/*
** Stack Frontier Generator 1.1.0 (2016-03-03 16:08:48.603000)
** Stack Frontier Generator 1.1.0 (2019-12-27 16:40:05.273000)
**
** WARNING - Auto-generated file. Modifications could be lost!
*/
--define=ICALL_RAM0_START=0x200041e0
--define=ICALL_RAM0_START=0x20004160
--define=ICALL_STACK0_START=0xd000
--define=ICALL_STACK0_ADDR=0xd001
@@ -18,11 +18,11 @@
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" errorParsers="org.eclipse.rtsc.xdctools.parsers.ErrorParser;com.ti.rtsc.XDCtools.parsers.ErrorParser;com.ti.ccstudio.errorparser.CoffErrorParser;com.ti.ccstudio.errorparser.LinkErrorParser;com.ti.ccstudio.errorparser.AsmErrorParser;org.eclipse.cdt.core.GmakeErrorParser" id="com.ti.ccstudio.buildDefinitions.TMS470.Default.67178137" name="FlashROM" parent="com.ti.ccstudio.buildDefinitions.TMS470.Default" postbuildStep="${CG_TOOL_HEX} -order MS --memwidth=8 --romwidth=8 --intel -o ${ProjName}.hex ${ProjName}.out" prebuildStep="">
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Default.67178137." name="/" resourcePath="">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.508772074"
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.1709087891"
name="TI Build Tools"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain"
targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.253004641">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.307496426"
targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.592637328">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.187891791"
superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.CC2650F128"/>
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
@@ -40,44 +40,44 @@
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.1440951273"
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.469507241"
superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION"
value="18.1.5.LTS" valueType="string"/>
<targetPlatform
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug.1602976043"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug.99739349"
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.1636245865"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug.1796363579"
name="GNU Make.FlashROM" parallelBuildOn="true" parallelizationNumber="optimal"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug"/>
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.970988650"
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.912613276"
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.1857210705"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.728819715"
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.714636443"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.1616377459"
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.261228559"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.1976507365"
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.1228981473"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN.452052562"
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.605071558"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.737944281"
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.108821138"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.2110497520"
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.957532787"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH.1752465424"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH"
valueType="includePath">
<listOptionValue builtIn="false" value="${CG_TOOL_ROOT}/include"/>
@@ -108,7 +108,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.1105424988"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.958203846"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE"
valueType="definedSymbols">
<listOptionValue builtIn="false" value="BOARD_DISPLAY_EXCLUDE_UART"/>
@@ -130,39 +130,39 @@
<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.1032444705"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEBUGGING_MODEL.1087634147"
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.1070661718"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.377303910"
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.476728347"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GCC.723459219"
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.1028582292"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS.919200658"
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.1576358748"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.1430944716"
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.839364861"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.1887447155"
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.1520544614"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER.565376519"
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.632756283"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.GEN_FUNC_SUBSECTIONS.1229454694"
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.1953982293"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE.532606003"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE"
valueType="stringList">
<listOptionValue builtIn="false" value="${SRC_EX}/config/build_components.opt"/>
@@ -171,38 +171,38 @@
value="${ORG_PROJ_DIR}/../../ccs/config/ccs_compiler_defines.bcfg"/>
</option>
<inputType
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.311618182"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.2040949282"
name="C Sources"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS"/>
<inputType
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.1172126406"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.895597825"
name="C++ Sources"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS"/>
<inputType
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.1875232524"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.1325128518"
name="Assembly Sources"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS"/>
<inputType
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.1021129889"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.246253993"
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.253004641"
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.592637328"
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.163894365"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE.655691751"
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.446557062"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE.1472363766"
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.1183163963"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE.957386741"
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.1489194034"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE.2087532765"
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.83785030"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY.1685845719"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY"
valueType="libs">
<listOptionValue builtIn="false" value="libc.a"/>
@@ -211,86 +211,86 @@
<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.531184787"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.2103736078"
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.1981415630"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.590476821"
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.649902168"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1116110693"
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.1729779528"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER.1780443887"
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.1878611611"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO.1365571559"
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.202293784"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.472342113"
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.320082858"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.183676739"
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.1085231487"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS.816325003"
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.1108737317"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS.228816199"
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.75789309"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS.2004850048"
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.1993143283"
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.1041100349"
name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.1082701845"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.1878555334"
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.1869306517"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH.1303276943"
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.823229474"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.448647073"
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.91063780" name="XDCtools"
<tool id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.1642099341" name="XDCtools"
superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool">
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.1479641733"
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.XDC_PATH.1034906850"
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.141072820"
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.TARGET.1318413439"
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.29309402"
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM.1046279113"
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.655405343"
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.PLATFORM_RAW.645098492"
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.2098255943"
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.BUILD_PROFILE.1655263222"
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.1106331477"
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.CODEGEN_TOOL_DIR.1686967050"
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.803098937"
<option id="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS.2031730779"
superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS"
value="&quot;${COMPILER_FLAGS}&quot;" valueType="string"/>
</tool>
@@ -17,11 +17,6 @@
<property Type="choicelist" Value="1" id="XDS110 Aux Port"/>
</choice>
</property>
<property Type="choicelist" Value="1" id="Debug Probe Selection">
<choice Name="Select by serial number" value="0">
<property Type="stringfield" Value="L1000537" id="-- Enter the serial number"/>
</choice>
</property>
<platform XML_version="1.2" id="platform_0">
<instance XML_version="1.2" desc="CC2650F128_0" href="devices/cc2650f128.xml" id="CC2650F128_0" xml="cc2650f128.xml" xmlpath="devices"/>
</platform>
@@ -13,14 +13,20 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties="" cleanCommand="${CG_CLEAN_CMD}" description="" id="com.ti.ccstudio.buildDefinitions.TMS470.Default.1209999684" name="FlashROM" parent="com.ti.ccstudio.buildDefinitions.TMS470.Default" postannouncebuildStep="" postbuildStep="${CG_TOOL_HEX} -order MS --memwidth=8 --romwidth=8 --intel -o ${ProjName}.hex ${ProjName}.out;${TOOLS_BLE}/frontier/frontier.exe ccs ${PROJECT_LOC}/${ConfigName}/${ProjName}_linkInfo.xml ${ORG_PROJ_DIR}/../../ccs/config/ccs_compiler_defines.bcfg ${ORG_PROJ_DIR}/../../ccs/config/ccs_linker_defines.cmd" preannouncebuildStep="" prebuildStep="&quot;${TOOLS_BLE}/lib_search/lib_search.exe&quot; ${ORG_PROJ_DIR}/build_config.opt &quot;${TOOLS_BLE}/lib_search/params_split_cc2640.xml&quot; ${SRC_BLE_CORE}/../blelib &quot;${ORG_PROJ_DIR}/../../ccs/config/lib_linker.cmd&quot;">
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Default.1209999684." name="/"
<configuration artifactExtension="out" artifactName="${ProjName}" buildProperties=""
cleanCommand="${CG_CLEAN_CMD}" description=""
id="com.ti.ccstudio.buildDefinitions.TMS470.Default.1209999684" name="FlashROM"
parent="com.ti.ccstudio.buildDefinitions.TMS470.Default" postannouncebuildStep=""
postbuildStep="${CG_TOOL_HEX} -order MS --memwidth=8 --romwidth=8 --intel -o ${ProjName}.hex ${ProjName}.out;${TOOLS_BLE}/frontier/frontier.exe ccs ${PROJECT_LOC}/${ConfigName}/${ProjName}_linkInfo.xml ${ORG_PROJ_DIR}/../../ccs/config/ccs_compiler_defines.bcfg ${ORG_PROJ_DIR}/../../ccs/config/ccs_linker_defines.cmd"
preannouncebuildStep=""
prebuildStep="&quot;${TOOLS_BLE}/lib_search/lib_search.exe&quot; ${ORG_PROJ_DIR}/build_config.opt &quot;${TOOLS_BLE}/lib_search/params_split_cc2640.xml&quot; ${SRC_BLE_CORE}/../blelib &quot;${ORG_PROJ_DIR}/../../ccs/config/lib_linker.cmd&quot;">
<folderInfo id="com.ti.ccstudio.buildDefinitions.TMS470.Default.1209999684." name="/"
resourcePath="">
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.1245523372"
<toolChain id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain.1559304320"
name="TI Build Tools"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.DebugToolchain"
targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.1451981696">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.905558853"
targetTool="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.1852625411">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.1086881235"
superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList">
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=Cortex M.CC2650F128"/>
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/>
@@ -32,44 +38,53 @@
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE="/>
<listOptionValue builtIn="false" value="OUTPUT_TYPE=executable"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.690267428"
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.649543706"
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.703901656"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.targetPlatformDebug.111961287"
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.578715889"
name="GNU Make.FlashROM" parallelBuildOn="true" parallelizationNumber="optimal"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.builderDebug.707210004"
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.124004045"
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.compilerDebug.1071730275"
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.1471387206"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.SILICON_VERSION.1796388867"
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.1989883015"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CODE_STATE.982642710"
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.26908680"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.ABI.598060242"
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.161170469"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.LITTLE_ENDIAN.1990088850"
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.202178130"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_LEVEL.244600603"
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.477462079"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.OPT_FOR_SPEED.1629603334"
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.2135144875"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.INCLUDE_PATH.1891480534"
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"/>
@@ -84,9 +99,9 @@
<listOptionValue builtIn="false" value="${SRC_COMMON}/osal/src/inc"/>
<listOptionValue builtIn="false" value="${SRC_COMMON}/services/src/nv/cc26xx"/>
<listOptionValue builtIn="false" value="${SRC_COMMON}/services/src/nv"/>
<listOptionValue builtIn="false" value="${SRC_COMMON}/services/src/saddr"/>
<listOptionValue builtIn="false" value="${SRC_COMMON}/icall/src/inc"/>
<listOptionValue builtIn="false" value="${SRC_BLE_CORE}/inc"/>
<listOptionValue builtIn="false" value="${SRC_COMMON}/services/src/saddr"/>
<listOptionValue builtIn="false" value="${SRC_COMMON}/icall/src/inc"/>
<listOptionValue builtIn="false" value="${SRC_BLE_CORE}/inc"/>
<listOptionValue builtIn="false" value="${SRC_BLE_CORE}/rom"/>
<listOptionValue builtIn="false" value="${SRC_BLE_CORE}/controller/cc26xx/inc"/>
<listOptionValue builtIn="false" value="${SRC_COMMON}/services/src/aes/cc26xx"/>
@@ -97,7 +112,8 @@
<listOptionValue builtIn="false" value="${SRC_EX}/profiles/roles"/>
<listOptionValue builtIn="false" value="${CC26XXWARE}"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.1493730349"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE.2049411711"
name="Pre-define NAME (--define, -D)"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DEFINE"
valueType="definedSymbols">
<listOptionValue builtIn="false" value="CC26XX"/>
@@ -110,7 +126,7 @@
<listOptionValue builtIn="false" value="FLASH_ROM_BUILD"/>
<listOptionValue builtIn="false" value="INCLUDE_AES_DECRYPT"/>
<listOptionValue builtIn="false" value="NEAR_FUNC="/>
<listOptionValue builtIn="false" value="OSAL_CBTIMER_NUM_TASKS=1"/>
<listOptionValue builtIn="false" value="OSAL_CBTIMER_NUM_TASKS=1"/>
<listOptionValue builtIn="false" value="OSAL_SNV=1"/>
<listOptionValue builtIn="false" value="USE_ICALL"/>
<listOptionValue builtIn="false" value="xDEBUG"/>
@@ -121,67 +137,78 @@
<listOptionValue builtIn="false" value="xTESTMODES"/>
<listOptionValue builtIn="false" value="xTEST_BLEBOARD"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.1032660795"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.C_DIALECT.706882445"
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.DIAG_SUPPRESS.1680463954"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_SUPPRESS.970002376"
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"/>
<listOptionValue builtIn="false" value="16004"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.1766518960"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WARNING.593508122"
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.1804087261"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DIAG_WRAP.1665686728"
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.733166450"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.DISPLAY_ERROR_NUMBER.981942367"
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.CMD_FILE.1033506009"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compilerID.CMD_FILE.822258685"
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"/>
</option>
<inputType
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.1352027396"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS.1611178351"
name="C Sources"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__C_SRCS"/>
<inputType
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.1465774058"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS.719858209"
name="C++ Sources"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__CPP_SRCS"/>
<inputType
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.1739768713"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS.1727820922"
name="Assembly Sources"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM_SRCS"/>
<inputType
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.79045750"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.compiler.inputType__ASM2_SRCS.226678329"
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.1451981696"
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exe.linkerDebug.1852625411"
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.816733227"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.STACK_SIZE.1116602715"
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.1515084002"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.HEAP_SIZE.453097232"
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.1765940845"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.MAP_FILE.1766042498"
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.272429594"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.OUTPUT_FILE.1085668260"
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.2076163355"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.LIBRARY.1465601902"
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"/>
@@ -192,13 +219,15 @@
<listOptionValue builtIn="false"
value="${CC26XXWARE}/driverlib/bin/ccs/driverlib.lib"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.1967226591"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.SEARCH_PATH.104670659"
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.17239932"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_SUPPRESS.694076948"
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="16002-D"/>
@@ -206,60 +235,70 @@
<listOptionValue builtIn="false" value="10325-D"/>
<listOptionValue builtIn="false" value="10229-D"/>
</option>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.773340389"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DIAG_WRAP.1793504671"
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.2126747201"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.DISPLAY_ERROR_NUMBER.1064066608"
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.1785926765"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.XML_LINK_INFO.1985154852"
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.ENTRY_POINT.683577056"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.ENTRY_POINT.1240213933"
name="Specify program entry point for the output module (--entry_point, -e)"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.ENTRY_POINT"
value="startup_entry" valueType="string"/>
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.1312810581"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.COMPRESS_DWARF.274912320"
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.1324674660"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.linkerID.UNUSED_SECTION_ELIMINATION.101724544"
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.1903606010"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD_SRCS.1747499519"
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.872286488"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__CMD2_SRCS.428284916"
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.1603687860"
id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.exeLinker.inputType__GEN_CMDS.755369992"
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.1441542763"
name="ARM Hex Utility" superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.210948887"
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.995125643" name="ARM Hex Utility"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.1812746902"
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.514543379"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.MEMWIDTH.535955299"
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.2135898037"
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.OUTPUT_FORMAT.137845789"
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>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="cc26x0f128.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
</folderInfo>
<sourceEntries>
<entry excluding="cc26x0f128.cmd" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath"
name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
@@ -12,6 +12,7 @@
<stringAttribute key="com.ti.ccstudio.debug.debugModel.ATTR_TARGET_CONFIG" value="${target_config_active_default:simple_peripheral_cc2650em_stack}"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS100v3 USB Debug Probe_0/Cortex_M3_0" value="C:/ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\FlashROM\simple_peripheral_cc2650em_stack.out"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe/Cortex_M3_0" value="C:/ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\FlashROM\simple_peripheral_cc2650em_stack.out"/>
<stringAttribute key="com.ti.ccstudio.debug.debugModel.MRU_PROGRAM.C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\targetConfigs\CC2650F128.ccxml.Texas Instruments XDS110 USB Debug Probe_0/Cortex_M3_0" value="C:/ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\stack\FlashROM\simple_peripheral_cc2650em_stack.out"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/simple_peripheral_cc2650em_stack"/>
</listAttribute>
@@ -51,7 +51,6 @@ extern "C" {
#include <ti/drivers/PIN.h>
#include <driverlib/ioc.h>
#define HEADSTAGE_UNI_2_0
#ifdef HEADSTAGE_UNI_2_0
#include "neu/headstage_pin.h"
#else
@@ -1,51 +0,0 @@
#!/bin/bash
input="./Elite_test.txt"
declare -i col_index=0
declare -i row_index=0
declare -i channel=0
declare -i gain=0
declare -i current_line=2
declare -a value
MAC="MAC"
while read -r line; do
for word in $line; do
# get device MAC
if [ $row_index -eq 1 ] && [ $col_index -eq 0 ];then
MAC=$word
sed -i "${current_line} i \\\n#elif defined(BOARD_${MAC}){" ./test.txt
sed -i 's/:/_/g' ./test.txt
current_line=$current_line+2
# if [ $row_index -gt 0 ];then
# # row 1~8 is the least gain clai data
# channel=`expr $row_index - 1`
# channel=`expr $channel % 8`
#
# gain=`expr $row_index - 1`
# gain=`expr $gain / 8`
#
# if [ $col_index -eq 4 ];then
# sed -i "${current_line} i \\\t.Ch[${channel}].Gain[${gain}] = $word," ./test.txt
# current_line=$current_line+1
# elif [ $col_index -eq 6 ];then
# sed -i "${current_line} i \\\t.Ch[${channel}].Offset[${gain}] = $word," ./test.txt
# current_line=$current_line+1
# fi
fi
#update index
if [ $col_index -lt 5 ];then
col_index=$col_index+1
else
col_index=0
row_index=$row_index+1
fi
done
done < $input
#sed -i "${current_line} i }" ./test.txt
@@ -23,7 +23,7 @@ Instruction Specification
file defined:
Bio_Pro_Sci / 嚙踝蕭赤 / Pi3/DataServer / CC2650 / CC2650嚙踐垓蕭嚙踝隤嚙
Bio_Pro_Sci /  / Pi3/DataServer / CC2650 / CC2650誘銵
```
struct instruction {
@@ -56,10 +56,10 @@ instruction operator
| VIS_INT | 0x60 | interrupt device |
| | 0x70 | not used |
| | 0x80 | not used |
| VIS_STI | 0x90 | en/disable stimulation |
| VIS_FUH | 0x90 | not used |
| VIS_CAL | 0xA0 | not used |
| | 0xB0 | not used |
| VIS_START| 0xC0 | device start working |
| VIS_STI | 0xC0 | device start working |
| | 0xD0 | not used |
| | 0xE0 | not used |
| VIS_RST | 0xF0 | device reset |
@@ -93,63 +93,6 @@ instruction operator
#include <ti/sysbios/knl/Semaphore.h>
#include "simple_gatt_profile.h"
/** State for SPI (SPI callback to do task) **/
typedef enum {
CLOSE_SPI, // close SPI after MISO transmit
CONTINUOUS_TRANS, // transmit DBS data
FLUSH_BUFFER, // clean SPI buffer, used after a "write" SPI instruction (MISO)
FLUSH_BUFFER2, // clean SPI buffer twice
READ_REG, // read DBS register value, used after a "read" SPI instruction (MISO)
READ_REG2, // read DBS register value, used after a "read" SPI instruction (MISO)
END_TRANSMIT, // read DBS register value, used after a "read" SPI instruction (MISO)
ONE_SHOT_SPI, // end spi instruction
READ_MOSI
} SPI_CB_MODE;
/*========================
==== Global Variable ====
=========================*/
static bool STI = false;
static bool IsFirstData = true;
static uint8_t spi_state_counter = 0;
static uint8_t check_reg_counter = 0;
static bool ConnectState = false;
static bool ErrorRestart = false;
static SPI_CB_MODE SPICallBack;
static uint8 adc_spi_en_switch = 1;
/*
* Let C = command, S = status;
* StiCommand = 0b00CC_00SS
* The first C is record command, the second is sti
* The first S is record status, the second is sti
*
* rec_sti_command | meaning |
* 0x00 | command = interrupt; status = idle |
* 0x01 | command = interrupt; status = sti without rec |
* 0x02 | command = interrupt; status = rec without sti |
* 0x03 | command = interrupt; status = sti & rec |
* 0x10 | command = start rec; status = idle |
* 0x11 | command = start rec; status = sti without rec |
* 0x12 | command = start rec; status = rec without sti |
* 0x13 | command = start rec; status = sti & rec |
* 0x20 | command = start sti; status = idle |
* 0x21 | command = start sti; status = sti without rec |
* 0x22 | command = start sti; status = rec without sti |
* 0x23 | command = start sti; status = sti & rec |
* 0x30 | command = rec & sti; status = idle |
* 0x31 | command = rec & sti; status = sti without rec |
* 0x32 | command = rec & sti; status = rec without sti |
* 0x33 | command = rec & sti; status = sti & rec |
*/
#define ENABLE_REC 0x20
#define ENABLE_STI 0x10
#define STATUS_REC 0x02
#define STATUS_STI 0x01
static uint8_t rec_sti_command = 0x00; // 0=NOP; 0x01=stop; 2=start;
/*======================
==== event control ====
=====================*/
@@ -214,7 +157,6 @@ extern ICall_Semaphore semaphore;
// command return characteristic
#define BLE_CDR_BUFF_CHAR SIMPLEPROFILE_CHAR2
#define BLE_CDR_BUFF_SIZE SIMPLEPROFILE_CHAR2_LEN
#define BLE_CDR_SAMLL_SIZE 10
// instruction input characteristic
#define BLE_INS_BUFF_CHAR SIMPLEPROFILE_CHAR3
@@ -240,25 +182,22 @@ extern ICall_Semaphore semaphore;
#define INS_TYPE_CIS 0x70
// VIS operator
#define VIS_REC 0x10
#define VIS_STI 0x20
#define VIS_STOP_REC 0x30
#define VIS_STOP_STI 0x40
#define VIS_ASK 0x50
#define VIS_INT 0x60
#define VIS_FAST_SET 0x70
#define VIS_EN_ADC_CLK 0x80
#define VIS_CAL 0xA0
#define VIS_START 0xC0
#define VIS_RST 0xF0
#define VIS_ASK 0x30
#define VIS_INT 0x60
#define VIS_FUH 0x90
#define VIS_CAL 0xA0
#define VIS_STI 0xC0
#define VIS_RST 0xF0
#define VIS_PAU 0x10 // pause
#define VIS_HANDSHAKE_TO_CONFIG 0x20
#define VIS_CONFIG 0x40
#define VIS_CONFIG2 0x70
// CIS operator
#define CIS_NOP 0x00
#define CIS_VOLT 0x10
#define CIS_LED 0x20
#define CIS_CALI 0x30
#define CIS_VERSION 0x40
// CIS return status code
#define CDR_SUCCESS 0x0
@@ -356,7 +295,7 @@ static uint16_t CONNECT_HANDLE = 0;
/**
* command instruction buffer
*/
static uint8_t cdr_buf[BLE_CDR_SAMLL_SIZE] = {0};
static uint8_t cdr_buf[BLE_CDR_BUFF_SIZE] = {0};
/*====================
==== event table ====
@@ -382,7 +321,7 @@ typedef struct {
==== device implement implement header ====
=========================================*/
#include "headstage_neu.h"
#include "headstage_uni.h"
/*!
* main function
@@ -434,8 +373,6 @@ static void headstage_update_instruction(uint8_t *instruction) {
uint8_t ins_oper = instruction[1] & 0xF0;
uint8_t ins_len = instruction[1] & 0x0F;
switch (ins_type) {
case INS_TYPE_RIS: {
headstage_update_ris_instruction(ins_len, instruction + 2);
@@ -446,14 +383,7 @@ static void headstage_update_instruction(uint8_t *instruction) {
break;
}
case INS_TYPE_CIS: {
if(ins_oper == CIS_CALI){
// CIS has only 20 byte now
// need ins[2] to choose return gain or offset
SendCaliValue(instruction[2]);
}
else{
headstage_update_cis_instruction(ins_oper);
}
headstage_update_cis_instruction(ins_oper);
break;
}
}
@@ -0,0 +1,45 @@
#ifndef NEU_CALI
#define NEU_CALI
#include "neulive13_CalibrationTable.h"
/*
*
* How to define Calibration()
*
* let y be DBS ADC raw data, which has value 0~1023
* x is UI display value, x = (y-512)/1000
* r is the real voltage value
*
* Before calibration we have r = (x - offset) / gain
*
* we want to have y' = Calibration(y), such that r = x_WithCali = (y' - 512)/1000
*
* => r = (x_WithOutCali - offset)/gain = x_WithCali = (y'-512)/1000
*
* => (x_WithOutCali - offset)/gain = ((y-512)/1000 - Offset)/gain = (y'-512)/1000
*
* => y' = 512 + [1000 * ((y-512)/1000 - Offset) / gain ]
*
* => y' = 512 + (y-512)/gain - [(1000 * Offset)/gain]
*
* => y' = (y-512)/gain + 512 - [(1000 * Offset)/gain]
*
*/
static uint16_t Calibration(uint8_t* DataBuf, uint8_t ch, uint8_t gain){
uint32_t raw, ret;
raw = (DataBuf[1] & 0x0f) << 6 | (DataBuf[2] & 0xFC) >> 2;
ret = 1000 * (raw-512)/CaliTable.Ch[ch].Gain[gain] + 512000 - 1000*1000*CaliTable.Ch[ch].Offset[gain] / CaliTable.Ch[ch].Gain[gain];
ret = ret / 1000;
// ret = ret * 10;
// ret = 1000 * (ret - CaliTable.Ch[ch].Offset[gain]) / CaliTable.Ch[ch].Gain[gain];
return (uint16_t) (ret);
}
#endif
@@ -1,14 +0,0 @@
#ifndef BIT_COUNT
#define BIT_COUNT
static uint8_t BitCount(uint8_t u8_value){
uint8_t ret = 0;
for(int i=0 ; i<8 ; i++){
if(u8_value & (1 << i)){
ret ++;
}
}
return ret;
}
#endif
@@ -12,31 +12,9 @@ static uint8_t headstage_battery_percent() {
uint32_t internal_batt_sense = AONBatMonBatteryVoltageGet();
internal_batt_sense = (internal_batt_sense * 125) >> 5;
internal_batt_sense = (internal_batt_sense * 100) / MAX_BATTERY_CAPACITY;
internal_battery_percent = internal_batt_sense & 0xFF;
internal_battery_percent = internal_batt_sense & 0xff;
if (internal_battery_percent < battery_percent) battery_percent = internal_battery_percent;
return battery_percent;
}
static uint8_t battery_volt;
static uint8_t headstage_battery_volt1() {
uint8_t internal_battery_percent;
uint32_t internal_batt_sense = AONBatMonBatteryVoltageGet();
// internal_batt_sense = (internal_batt_sense * 125) >> 5;
// internal_batt_sense = (internal_batt_sense * 100) / MAX_BATTERY_CAPACITY;
internal_battery_percent = internal_batt_sense & 0xFF;
battery_volt = internal_battery_percent;
return battery_volt;
}
static uint8_t headstage_battery_volt2() {
uint8_t internal_battery_percent;
uint32_t internal_batt_sense = AONBatMonBatteryVoltageGet();
// internal_batt_sense = (internal_batt_sense * 125) >> 5;
// internal_batt_sense = (internal_batt_sense * 100) / MAX_BATTERY_CAPACITY;
internal_battery_percent = (internal_batt_sense >> 8) & 0xFF;
battery_volt = internal_battery_percent;
return battery_volt;
}
#endif // HEADSTAGE_BATT_H
@@ -1,51 +0,0 @@
#ifndef NEU_CALI_FXN
#define NEU_CALI_FXN
#include "headstage_cali_table.h"
static void CaliTable2u8(uint8_t* cali){
for(int i=0 ; i<12 ; i++){
for(int j=0 ; j<3 ; j++){
*(cali + 12*i + 2*j) = (uint8_t) (CaliTable.Ch[i].Gain[j] | 0xFF00) >> 8;
*(cali + 12*i + 2*j+1) = (uint8_t) (CaliTable.Ch[i].Gain[j] | 0x00FF);
*(cali + 12*i + 2*j+6) = (uint8_t) (CaliTable.Ch[i].Offset[j] | 0xFF00) >> 8;
*(cali + 12*i + 2*j+7) = (uint8_t) (CaliTable.Ch[i].Offset[j] | 0x00FF);
}
}
}
/*
* SendCaliValue
* CaliNumber : 0~23
* - 0: ch1 gain value
* - 1: ch1 offset value
* - 2: ch2 gain
* - .......
*/
static void SendCaliValue(uint8_t CaliNumber){
uint8_t ch, cali_buf[BLE_CDR_BUFF_SIZE];
// ch = 2 * (CaliNumber % 4);
// uint8_t gain_level = CaliNumber / 4; // 0:gain, 1:offset
uint8_t channel_number = 8, index = 1;
uint8_t gain_level = 0;
if(CaliNumber < 4){
gain_level = CaliNumber;
}
cali_buf[0] = CHIP_ID;
for(int i=0 ; i<channel_number ; i++){
cali_buf[index++] = (uint8_t) (CaliTable.Ch[i].Gain[gain_level] >> 8) & 0xFF;
cali_buf[index++] = (uint8_t) CaliTable.Ch[i].Gain[gain_level] & 0x00FF;
cali_buf[index++] = (uint8_t) (CaliTable.Ch[i].Offset[gain_level] >> 8) & 0xFF;
cali_buf[index++] = (uint8_t) CaliTable.Ch[i].Offset[gain_level] & 0x00FF;
}
// for(int i=1 ; i<BLE_CDR_BUFF_SIZE ; i++){
// cali_buf[i] = i;
// }
SimpleProfile_SetParameter(BLE_CDR_BUFF_CHAR, index, cali_buf);
}
#endif
@@ -1,243 +0,0 @@
#ifndef NEU_CALI_STI_H
#define NEU_CALI_STI_H
#include "headstage_cali_table.h"
typedef struct _StiCali{
uint16_t coefficient;
int16_t offset;
}StiCali;
struct _StiCaliStiTable{
StiCali p_ch;
StiCali n_ch;
}StiCaliTable =
#ifdef BOARD_TEST
{
.p_ch.coefficient = 10000,
.p_ch.offset = 0,
.n_ch.coefficient = 10000,
.n_ch.offset = 0
};
#elif defined(BOARD_00_81_F9_E4_8C_D0)
{
.p_ch.coefficient = 2199,
.p_ch.offset = -4615,
.n_ch.coefficient = 2162,
.n_ch.offset = -16395
};
#elif defined(BOARD_18_04_ED_37_C6_BE)
{
.p_ch.coefficient = 2270,
.p_ch.offset = -7039,
.n_ch.coefficient = 2259,
.n_ch.offset = -14128
};
#elif defined(BOARD_18_04_ED_37_C6_41)
{
.p_ch.coefficient = 2090,
.p_ch.offset = 4616,
.n_ch.coefficient = 1997,
.n_ch.offset = -40664
};
#elif defined(BOARD_18_04_ED_37_C6_DF)
{
.p_ch.coefficient = 2132,
.p_ch.offset = -3843,
.n_ch.coefficient = 2054,
.n_ch.offset = -21544
};
#elif defined(BOARD_18_04_ED_37_C6_C7)
{
.p_ch.coefficient = 2199,
.p_ch.offset = -7237,
.n_ch.coefficient = 2221,
.n_ch.offset = -15701
};
#elif defined(BOARD_00_81_F9_E4_8B_50)
{
.p_ch.coefficient = 2369,
.p_ch.offset = -11004,
.n_ch.coefficient = 2360,
.n_ch.offset = -11796
};
#elif defined(BOARD_00_81_F9_E4_9B_97)
{
.p_ch.coefficient = 2227,
.p_ch.offset = -9845,
.n_ch.coefficient = 2151,
.n_ch.offset = -26608
};
#elif defined(BOARD_18_04_ED_37_C6_52)
{
.p_ch.coefficient = 2024,
.p_ch.offset = -7686,
.n_ch.coefficient = 2086,
.n_ch.offset = -11282
};
#elif defined(BOARD_00_81_F9_E4_9B_EF)
{
.p_ch.coefficient = 2383,
.p_ch.offset = -8584,
.n_ch.coefficient = 2415,
.n_ch.offset = -20346
};
#elif defined(BOARD_A4_DA_32_D4_E9_1D)
{
.p_ch.coefficient = 2075,
.p_ch.offset = 6344,
.n_ch.coefficient = 2002,
.n_ch.offset = -5562
};
#elif defined(BOARD_A4_DA_32_D4_E8_7A)
{
.p_ch.coefficient = 2180,
.p_ch.offset = 6651,
.n_ch.coefficient = 2254,
.n_ch.offset = 136
};
#elif defined(BOARD_A4_DA_32_D4_F0_AC)
{
.p_ch.coefficient = 2125,
.p_ch.offset = -6660,
.n_ch.coefficient = 2170,
.n_ch.offset = -439
};
#elif defined(BOARD_A4_DA_32_D4_E8_7C)
{
.p_ch.coefficient = 2265,
.p_ch.offset = 6685,
.n_ch.coefficient = 2230,
.n_ch.offset = 2124
};
#elif defined(BOARD_A4_DA_32_D4_EF_39)
{
.p_ch.coefficient = 1976,
.p_ch.offset = 6641,
.n_ch.coefficient = 2035,
.n_ch.offset = 2834
};
#elif defined(BOARD_A4_DA_32_D4_E7_6A)
{
.p_ch.coefficient = 2076,
.p_ch.offset = 1154,
.n_ch.coefficient = 2096,
.n_ch.offset = -1073
};
#elif defined(BOARD_A4_DA_32_D4_E8_E6)
{
.p_ch.coefficient = 2306,
.p_ch.offset = -88454,
.n_ch.coefficient = 2418,
.n_ch.offset = -15140
};
#elif defined(BOARD_A4_DA_32_D4_E7_3B)
{
.p_ch.coefficient = 2262,
.p_ch.offset = -564,
.n_ch.coefficient = 2298,
.n_ch.offset = 44746
};
#elif defined(BOARD_A4_DA_32_D4_EE_E2)
{
.p_ch.coefficient = 2057,
.p_ch.offset = 5980,
.n_ch.coefficient = 2096,
.n_ch.offset = -21411
};
#elif defined(BOARD_A4_DA_32_D4_E8_71)
{
.p_ch.coefficient = 2175,
.p_ch.offset = -4549,
.n_ch.coefficient = 2220,
.n_ch.offset = 31468
};
#elif defined(BOARD_A4_DA_32_D4_EF_C4)
{
.p_ch.coefficient = 2348,
.p_ch.offset = -5830,
.n_ch.coefficient = 2374,
.n_ch.offset = -26403
};
#elif defined(BOARD_A4_DA_32_D4_EF_85)
{
.p_ch.coefficient = 2136,
.p_ch.offset = -3339,
.n_ch.coefficient = 2189,
.n_ch.offset = -30040
};
#elif defined(BOARD_A4_DA_32_D4_E7_DA)
{
.p_ch.coefficient = 2081,
.p_ch.offset = -3015,
.n_ch.coefficient = 2122,
.n_ch.offset = -21543
};
#elif defined(BOARD_A4_DA_32_D4_E6_EA)
{
.p_ch.coefficient = 2039,
.p_ch.offset = -262,
.n_ch.coefficient = 2127,
.n_ch.offset = -47259
};
#elif defined(BOARD_A4_DA_32_D4_EE_DB)
{
.p_ch.coefficient = 2214,
.p_ch.offset = -1170,
.n_ch.coefficient = 2351,
.n_ch.offset = -24636
};
#elif defined(BOARD_A4_DA_32_D4_E7_3A)
{
.p_ch.coefficient = 2210,
.p_ch.offset = -4855,
.n_ch.coefficient = 2339,
.n_ch.offset = -16434
};
#elif defined(BOARD_A4_DA_32_D4_E6_CF)
{
.p_ch.coefficient = 2135,
.p_ch.offset = -5206,
.n_ch.coefficient = 2193,
.n_ch.offset = -30885
};
#else
{
.p_ch.coefficient = 10000,
.p_ch.offset = 0,
.n_ch.coefficient = 10000,
.n_ch.offset = 0
};
#endif
#endif
@@ -0,0 +1,90 @@
#ifndef NEU_CHECK_LSK
#define NEU_CHECK_LSK
#define LSK_CHECKING_ERROR 0
#define LSK_NO_ERROR 1
#define LSK_ERROR 2
#define CHECK_NUMBER 50
#define VALUE_OFFSET 512
static uint16_t CheckLSKBuf[CHECK_NUMBER] = {0};
static uint8_t CheckLSKBufIndex = 0;
/***************************************
* @fn static void headstage_uni_delay()
* @brief make some delay
***************************************/
static void headstage_uni_delay() {
for (uint16_t i = 0; i < 1023; i++)
;
}
static uint8_t CheckLSK(uint8_t* data_buf){
uint16_t Data = 0;
// check LSK data preamble ( 0b0110_0000_1 ) 58(01011000) 2c(00101100)
// sometimes we lose the first bit , it means we only receive
// 0110_0000_1010_1xxx_xxxx_xxxX_XXXX_XXXX and
// 1100_0001_0101_xxxx_xxxx_xxXX_XXXX_XXXX
if ( data_buf[0] == 0x60 && ((data_buf[1] & 0xF8) == 0xA8) ) {
headstage_led_spi_color_debug(0xE1, 0xFF, 0x00, 0xFF);
Data = ((data_buf[1] & 0x07) << 7) | ((data_buf[2] & 0xFE) >> 1);
}
else if ( data_buf[0] == 0xC1 && ((data_buf[1] & 0xF0) == 0x50) ) {
headstage_led_spi_color_debug(0xE1, 0xFF, 0x00, 0xFF);
Data = ((data_buf[1] & 0x0F) << 6) | ((data_buf[2] & 0xFC) >> 2);
}
else if ( data_buf[0] == 0x30 && ((data_buf[1] & 0xFC) == 0x54) ) {
headstage_led_spi_color_debug(0xE1, 0xFF, 0x00, 0xFF);
Data = ((data_buf[1] & 0x03) << 8) | ((data_buf[2] & 0xFF));
}
else{
return LSK_CHECKING_ERROR;
}
headstage_led_spi_color_debug(0x0F, 0xFF, 0x0F, 0x0F);
// uint8_t channel;
//
// if ((INSTRUCTION.enable_channel_number == 1) || (dat_buf[0] == 0xc1)) {
// channel = reverse_channel[INSTRUCTION.last_enable_channel];
// } else {
// uint8_t channel_pointer = (INSTRUCTION.channel_pointer + 1) % INSTRUCTION.last_enable_channel;
// channel = reverse_channel[INSTRUCTION.channel_mux[channel_pointer]];
// INSTRUCTION.channel_pointer = channel_pointer;
// }
CheckLSKBuf[CheckLSKBufIndex] = Data;
CheckLSKBufIndex ++;
if(CheckLSKBufIndex >= CHECK_NUMBER){
CheckLSKBufIndex = 0;
// check LSK work well or not
uint32_t avg = 0;
uint8_t avgNumber = 0;
// sum all value that abs value < 100 mv
for(int i=0 ; i<CHECK_NUMBER ; i++){
if(-100+VALUE_OFFSET < CheckLSKBuf[i] && CheckLSKBuf[i] < 100+VALUE_OFFSET){
avg = avg + CheckLSKBuf[i];
avgNumber ++;
}
}
avg = avg / avgNumber;
if(10+VALUE_OFFSET < avg && avg < 30+VALUE_OFFSET){
return LSK_ERROR;
}
else if(-10+VALUE_OFFSET < avg && avg < -30+VALUE_OFFSET){
return LSK_ERROR;
}
else{
return LSK_NO_ERROR;
}
}
return LSK_CHECKING_ERROR;
}
#endif
@@ -1,182 +0,0 @@
#ifndef NEU_CHECK_INSTRUCTION
#define NEU_CHECK_INSTRUCTION
#include "headstage_instruction.h"
#include "neu/headstage_spi.h"
#include "neu/headstage_reset.h"
static uint8_t check_ins(uint16_t trans_ins){
uint16_t recv_ins;
recv_ins = spi_rxbuf[1] << 8 | spi_rxbuf[2];
return (trans_ins == recv_ins);
}
static void check_register(uint8_t register_to_check, uint16_t instruction_to_fit, NEU_WORK_STATE next_state){
if(check_reg_counter < 6){
SPICallBack = CONTINUOUS_TRANS;
spi_txbuf[0] = register_to_check & 0x7F;
spi_txbuf[1] = NEULIVE_STATE.state;
spi_txbuf[2] = check_reg_counter;
check_reg_counter ++;
headstage_spi_transaction(3);
}
else{
check_reg_counter = 0;
if(check_ins(instruction_to_fit)){
NEULIVE_STATE.state = next_state;
SPICallBack = ONE_SHOT_SPI;
}
else{
// resend instruction
SPI_close(headstage_spi_handle);
// DBSReset();
// start recording failed
if( (rec_sti_command & ENABLE_REC) && !(rec_sti_command & STATUS_REC) ){
NEULIVE_STATE.state = NEU_WRITE_REC_INS;
NEULIVE_STATE.config_type = NEU_WARM_UP;
INSTRUCTION.ins_opcode = BIAS_ONE;
}
// start sti failed
else if( (rec_sti_command & ENABLE_STI) && !(rec_sti_command & STATUS_STI) ){
NEULIVE_STATE.state = NEU_WRITE_STI_INS;
NEULIVE_STATE.config_type = NEU_WARM_UP;
INSTRUCTION.ins_opcode = T_ZE;
// make sure rec can restart
not_buf_offset = NOT_BUF_OFFSET_INIT;
IsFirstData = true;
}
// stop sti failed
else if( !(rec_sti_command & ENABLE_STI) && (rec_sti_command & STATUS_STI) ){
NEULIVE_STATE.state = NEU_STI_INT;
// make sure rec can restart
not_buf_offset = NOT_BUF_OFFSET_INIT;
IsFirstData = true;
}
SPICallBack = ONE_SHOT_SPI;
ReopenSPI();
}
headstage_spi_transaction(3);
}
}
static uint8_t check_sti_register(uint8_t address, uint16_t instruction_to_fit);
static void check_sti_t1_t5(NEU_WORK_STATE next_state){
// get sti channel
uint8_t index, sti_channel[9];
for(index=0 ; index<9 ; index++){
sti_channel[index] = 0xFF;
}
// sti_channel will be [active_ch1, active_ch2, ..., 0xFF, 0xFF]
// where active_ch is the sti channel; 0xFF is used as an EOF
index = 0;
for(int i=0 ; i<8 ; i++){
if( (1 << i) & INSTRUCTION.sti_channel ){
sti_channel[index++] = i;
}
}
uint8_t register_address[5], register_index, success; // this is t1~t5 and sti_cycle number register address
uint16_t value_to_fit;
// check every active channel alternatively
for(index = 0 ; sti_channel[index]!=0xFF ; index++){
// check t1~t5 and sti-cycle register
for(register_index = 0 ; register_index < 5 ; register_index++){
// get register address
if(register_index < 4){
register_address[register_index] = sti_channel[index] * 4 + register_index + 1;
}
else{
register_address[register_index] = (sti_channel[index] / 2) + 42; // sti_cycle address
}
// get value to fit
if(register_index == 0){
uint16_t t1 = INSTRUCTION.sti_t1[sti_channel[index]];
uint16_t t21 = (INSTRUCTION.sti_t2[sti_channel[index]] & 0x003F) << 10;
value_to_fit = (t21) | (t1);
}
else if(register_index == 1){
uint16_t t22 = (INSTRUCTION.sti_t2[sti_channel[index]] >> 6) & 0x000F;
uint16_t t3 = INSTRUCTION.sti_t3[sti_channel[index]] << 4;
uint16_t t41 = (INSTRUCTION.sti_t4[sti_channel[index]] & 0x03) << 14;
value_to_fit = t41 | t3 | t22;
}
else if(register_index == 2){
uint16_t t42 = (INSTRUCTION.sti_t4[sti_channel[index]] >> 2) & 0xFFFF;
value_to_fit = t42;
}
else if(register_index == 3){
uint16_t t5 = (INSTRUCTION.sti_t5[sti_channel[index]]) & 0x03FF;
value_to_fit = t5;
}
else{
uint8_t odd_even = sti_channel[index] % 2;
if (!odd_even){
value_to_fit = (INSTRUCTION.current_sti_cycle[sti_channel[index] + 1] << 8) | (INSTRUCTION.current_sti_cycle[sti_channel[index]]);
}
else{
value_to_fit = (INSTRUCTION.current_sti_cycle[sti_channel[index]] << 8) | (INSTRUCTION.current_sti_cycle[sti_channel[index] - 1]);
}
}
success = check_sti_register(register_address[register_index], value_to_fit);
if(!success){
break;
}
}
if(!success){
break;
}
}
if(!success){
SPI_close(headstage_spi_handle);
NEULIVE_STATE.state = NEU_WRITE_STI_INS;
NEULIVE_STATE.config_type = NEU_WARM_UP;
INSTRUCTION.ins_opcode = T_ZE;
// make sure rec can restart
not_buf_offset = NOT_BUF_OFFSET_INIT;
IsFirstData = true;
ReopenSPI();
}
else{
NEULIVE_STATE.state = next_state;
}
SPICallBack = ONE_SHOT_SPI;
headstage_spi_transaction(3);
}
static uint8_t check_sti_register(uint8_t address, uint16_t instruction_to_fit){
check_reg_counter = 0;
while(check_reg_counter < 6){
SPICallBack = READ_REG;
spi_txbuf[0] = address & 0x7F;
spi_txbuf[1] = address;
spi_txbuf[2] = address;
headstage_spi_transaction(3); // check_reg_counter++ would be executed in SPI callback
}
check_reg_counter = 0;
// success = 1; failed = 0
return check_ins(instruction_to_fit);
}
#endif
@@ -1,94 +0,0 @@
#ifndef NEU_INSTRUCTION
#define NEU_INSTRUCTION
/** amounts of channel */
#define NEU_STI_CHANNEL_COUNTS 9 // channel 0~7 is current sti; channel 8 = voltage sti
#define NEU_REC_CHANNEL_COUNTS 16 /**< recording channel counts */
struct HEADSTAGE_PARAMETER_TABLE {
uint8_t current_sti_cycle[NEU_STI_CHANNEL_COUNTS]; /** stimulation times will be executed. */
// sti_tx[0~7] is current stimulate
// sti_tx[8] assign to voltage mode channel. */
uint16_t sti_t1[NEU_STI_CHANNEL_COUNTS]; /**< first stimulation pulse duration, it can't be 0. */
uint16_t sti_t2[NEU_STI_CHANNEL_COUNTS]; /**< interval between biphasic pulses. */
uint16_t sti_t3[NEU_STI_CHANNEL_COUNTS]; /**< second stimulation pulse duration. */
uint32_t sti_t4[NEU_STI_CHANNEL_COUNTS]; /**< discharge time per stimulation. */
uint16_t sti_t5[NEU_STI_CHANNEL_COUNTS]; /**< discharge time after final stimulation. */
bool sti_mode; /**< if true: continuous mode, else limited mode. */
bool sti_h_bridge; /**< if true: enable h bridge, else single ended. */
bool sti_ref; /**< if true: reference cell body to gnd, else single ended is used. */
uint16_t current_sti_polarity; /**<
* default : low side.
* define which channel is high side or low side.
*/
uint8_t voltage_sti_channel; /**<
* voltage_channel[7:4] represent pmos channel,
* voltage_channel[3:0] represent nmos channel
*/
uint8_t amplifier_gain; /**<
* parameter table to represent actual amplifier gain
* ----------
* | bit |mean|
* ----------
* |0b00 | 100|
* ----------
* |0b01 | 400|
* ----------
* |0b10 | 800|
* -----------
* |0b11 | 25 |
* -----------
*/
/**< these parameter define the bias voltage of amplifier. */
uint16_t vgrp;
uint16_t vgrn;
uint16_t vgr_int_old;
uint16_t vgr_intp;
uint16_t vgr_intn;
uint8_t ins_opcode; /**< check instruction opcode which is transmitted to DBS. */
uint8_t voltage_sti_amplitude; /**< voltage mode stimulation amplitude control. */
uint16_t arbitrary_index; /**< this index to keep address of arbitrary data we have already stored. */
uint16_t arbitrary_en; /**< if true: enable arbitrary mode stimulation. */
uint16_t recording_channel; /**< recording_channel[17] represent enabling channel 17. */
uint16_t sti_amplitude_h; /**< positive side amplitude. */
uint16_t sti_amplitude_l; /**< negative side amplitude. */
uint16_t sti_amplitude_h_cali;
uint16_t sti_amplitude_l_cali;
uint16_t sys_clk_ratio; /**< frequency divider ratio for digital core clock. */
uint16_t adc_clock_ratio; /**< frequency divider ratio for adc clock. */
uint16_t sti_clock_ratio; /**< frequency divider ratio for stimulation clock. */
uint16_t chopper_ratio; /**< freqeuncy divider for chopper. */
uint16_t sti_channel; /**<
* if stimulation[7] == true, stimulation channel 7 is enabled .
* if stimulation[4] == true. stimulation channel 4 is enabled .
*/
uint8_t sti_ch_config_done; // number of stimulate channel which is config done
} INSTRUCTION = {0};
/**
* @brief:
* manage which operation to be conducted
*/
struct HEADSTAGE_STATE {
NEU_WORK_STATE state;
NEU_CONFIG_TYPE config_type;
uint8_t index;
} NEULIVE_STATE={NEU_IDLE, NEU_WARM_UP, 0};
#endif
@@ -82,7 +82,6 @@ static uint16_t headstage_led_set_buffer(uint16_t *ins_buf, uint8_t repeat, LEDP
#define COLOR_BLUE 5
#define COLOR_CYAN 6
#define COLOR_MAGENTA 7
#define COLOR_PURPLE 8
#define COLOR_WHITE 9
// clang-format on
@@ -94,7 +93,7 @@ static uint8_t headstage_led_set_color(uint16_t *ins_buf, uint8_t repeat, uint8_
parameter = (LEDParameter){.luminance = 0xE1, .red = 0xFF, .green = 0x00, .blue = 0x00};
break;
case COLOR_ORANGE:
parameter = (LEDParameter){.luminance = 0xE1, .red = 0xFF, .green = 0x98, .blue = 0x00};
parameter = (LEDParameter){.luminance = 0xE1, .red = 0xFF, .green = 0x03, .blue = 0x00};
break;
case COLOR_YELLOW:
parameter = (LEDParameter){.luminance = 0xE1, .red = 0x0F, .green = 0x0F, .blue = 0x00};
@@ -114,9 +113,6 @@ static uint8_t headstage_led_set_color(uint16_t *ins_buf, uint8_t repeat, uint8_
case COLOR_WHITE:
parameter = (LEDParameter){.luminance = 0xE1, .red = 0x0F, .green = 0x7F, .blue = 0x1F};
break;
case COLOR_PURPLE:
parameter = (LEDParameter){.luminance = 0xE1, .red = 0x7F, .green = 0x0F, .blue = 0x7F};
break;
default:
case COLOR_BLACK:
parameter = (LEDParameter){.luminance = 0x00, .red = 0x00, .green = 0x00, .blue = 0x00};
@@ -196,7 +192,7 @@ static void headstage_led_color(uint8_t color) {
==== LED implement (GPIO) ====
============================*/
#ifdef HEADSTAGE_UNI_H
#if defined (HEADSTAGE_UNI_H) || defined(HEADSTAGE_TEST_DATA_H)
#define HEADSTAGE_LED_USE_GPIO
#endif
@@ -226,31 +222,13 @@ static void headstage_led_spi_color(uint8_t color) {
headstage_led_spi_transmit();
}
#endif // HEADSTAGE_LED_USE_GPIO
static void headstage_led_control(){
if( (rec_sti_command & STATUS_REC) && (rec_sti_command & STATUS_STI) ){
headstage_led_color(COLOR_MAGENTA);
}
else if((rec_sti_command & STATUS_REC)){
headstage_led_color(COLOR_BLUE);
}
else if((rec_sti_command & STATUS_STI)){
headstage_led_color(COLOR_ORANGE);
}
else{
if(ErrorRestart){
headstage_led_color(COLOR_RED);
}
else if(ConnectState){
headstage_led_color(COLOR_CYAN);
}
else{
headstage_led_color(COLOR_GREEN); // color green
}
}
static void headstage_led_spi_color_debug(uint8_t brightness, uint8_t red, uint8_t green, uint8_t blue) {
LEDParameter parameter;
parameter = (LEDParameter){.luminance = brightness, .red = red, .green = green, .blue = blue};
headstage_led_set_buffer(headstage_spi_led_txbuf, SPI_LED_REPEAT, &parameter);
headstage_led_spi_transmit();
}
#endif // HEADSTAGE_LED_USE_GPIO
#endif // HEADSTAGE_LED_H
@@ -44,61 +44,31 @@ static uint8_t headstage_notify_buffer[BLE_NOT_BUFF_SIZE] = {0};
*
*/
static void headstage_notify_send() {
//#ifdef HEADSTAGE_NOTIFY_USE_ATT
// uint16_t buffer_size = BLE_NOT_BUFF_SIZE;
// uint8_t *value = (uint8 *)GATT_bm_alloc(CONNECT_HANDLE, ATT_HANDLE_VALUE_NOTI, GATT_MAX_MTU, &buffer_size);
//
// if (value != NULL) {
// memcpy(value, headstage_notify_buffer, buffer_size);
//
// attHandleValueNoti_t notify = {
// // clang-format off
// .handle = 0x1E,
// .len = buffer_size,
// .pValue = value
// // clang-format on
// };
//
// if (GATT_Notification(CONNECT_HANDLE, &notify, 0) != SUCCESS) {
// // notify not send
// GATT_bm_free((gattMsg_t *)&notify, ATT_HANDLE_VALUE_NOTI);
// }
// }
//
//#else
SimpleProfile_SetParameter(BLE_NOT_BUFF_CHAR, BLE_NOT_BUFF_SIZE, headstage_notify_buffer);
#ifdef HEADSTAGE_NOTIFY_USE_ATT
uint16_t buffer_size = BLE_NOT_BUFF_SIZE;
uint8_t *value = (uint8 *)GATT_bm_alloc(CONNECT_HANDLE, ATT_HANDLE_VALUE_NOTI, GATT_MAX_MTU, &buffer_size);
//#endif
}
if (value != NULL) {
memcpy(value, headstage_notify_buffer, buffer_size);
/*
// | | 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 | length = N |
// | timestamp |
// | time delta |
// | data [0] | data[1] |
// | ............................ | data[15] |
*/
static void FlushNotify(){
// headstage_notify_buffer[0] = INSTRUCTION.chip_id;
headstage_notify_buffer[0] = CHIP_ID;
headstage_notify_buffer[1] = 1; // data length = 1 when flushing notify
attHandleValueNoti_t notify = {
// clang-format off
.handle = 0x1E,
.len = buffer_size,
.pValue = value
// clang-format on
};
for (int i = 2; i < BLE_NOT_BUFF_SIZE ; i++) {
headstage_notify_buffer[i] = 0;
if (GATT_Notification(CONNECT_HANDLE, &notify, 0) != SUCCESS) {
// notify not send
GATT_bm_free((gattMsg_t *)&notify, ATT_HANDLE_VALUE_NOTI);
}
}
// 1 Timestamp = 32 usec; 31 Timestamp ~= 1 msec
uint32_t flush_time_stamp = 0; // msec
headstage_notify_buffer[2] = flush_time_stamp & 0xFF;
headstage_notify_buffer[3] = (flush_time_stamp >> 8) & 0xFF;
headstage_notify_buffer[4] = (flush_time_stamp >> 16) & 0xFF;
headstage_notify_buffer[5] = (flush_time_stamp >> 24) & 0xFF;
#else
SimpleProfile_SetParameter(BLE_NOT_BUFF_CHAR, BLE_NOT_BUFF_SIZE, headstage_notify_buffer);
#endif
}
#endif // HEADSTAGE_NOTIFY_H
@@ -4,6 +4,6 @@
#include <ti/drivers/Power.h>
#include <ti/drivers/power/PowerCC26XX.h>
#define headstage_power_shutdown() Power_shutdown(NULL, 0)
#define headstage_power_shutdown() Power_shutdown(0, 0)
#endif // HEADSTAGE_POWER_H
@@ -1,103 +0,0 @@
#ifndef NEU_REC_INS_H
#define NEU_REC_INS_H
#include "headstage_instruction.h"
/**
* @fn build amplifier bias
*/
static bool build_amp_bias(uint32_t* value) {
uint8_t ins_opcode = INSTRUCTION.ins_opcode;
switch (ins_opcode) {
case BIAS_ONE: {
*value = (0x01 << 23) | (0x39 << 16) | NEU_LNA_BIAS_ONE;
INSTRUCTION.ins_opcode = BIAS_TWO;
return false;
}
case BIAS_TWO: {
*value = (0x01 << 23) | (0x3A << 16) | NEU_LNA_BIAS_TWO;
INSTRUCTION.ins_opcode = BIAS_TWO;
return true;
}
default: {
return false;
}
}
}
static NEU_CONFIG_TYPE build_rec_ins(NEU_CONFIG_TYPE config_type, uint32_t* value) {
bool done;
switch (config_type) {
/* These are recording parameter */
case NEU_WARM_UP:{
*value = (0x00 << 23) | (0x01 << 16) | 1;
return NEU_WARM_UP2;
}
case NEU_WARM_UP2:{
*value = (0x00 << 23) | (0x01 << 16) | 2;
return NEU_WARM_UP3;
}
case NEU_WARM_UP3:{
*value = (0x00 << 23) | (0x01 << 16) | 3;
return NEU_SET_GENERAL_EN;
}
case NEU_SET_GENERAL_EN: {
*value = (0x01 << 23) | (0x2F << 16) | NEU_GENERAL_EN;
return NEU_SET_REC_CHANNEL;
}
case NEU_SET_REC_CHANNEL: {
*value = (0x01 << 23) | (0x30 << 16) | INSTRUCTION.recording_channel;
return NEU_SET_AMP_GAIN;
}
case NEU_SET_AMP_GAIN: {
*value = (0x01 << 23) | (0x31 << 16) | INSTRUCTION.amplifier_gain;
return NEU_SET_VGRP;
}
case NEU_SET_VGRP:{
*value = (0x01 << 23) | (0x39 << 16) | (INSTRUCTION.vgrp << 5) | INSTRUCTION.vgrn;
return NEU_SET_VGRP_OLD;
}
case NEU_SET_VGRP_OLD:{
*value = (0x01 << 23) | (0x3A << 16) | (INSTRUCTION.vgr_int_old << 10) | (INSTRUCTION.vgr_intp << 5) | INSTRUCTION.vgr_intn;
return NEU_SETUP_DONE;
}
// case NEU_SET_SYS_CLK: {
// *value = (0x01 << 23) | (0x32 << 16) | INSTRUCTION.sys_clk_ratio;
// return NEU_SET_ADC_CLK;
// }
case NEU_SET_ADC_CLK: {
if(INSTRUCTION.adc_clock_ratio < 28){
INSTRUCTION.adc_clock_ratio = 28;
}
*value = (0x01 << 23) | (0x33 << 16) | INSTRUCTION.adc_clock_ratio;
// *value = (0x01 << 23) | (0x33 << 16) | 0x00C8;
return NEU_SET_AMP_BIAS;
}
case NEU_SET_AMP_BIAS: {
done = build_amp_bias(value);
if (done){
return NEU_SETUP_DONE;
}
else{
return NEU_SET_AMP_BIAS;
}
}
// case NEU_SET_CHOPPER: {
// *value = (0x01 << 23) | (0x3B << 16) | INSTRUCTION.chopper_ratio;
// return NEU_SETUP_DONE;
// }
default: {
return NEU_WARM_UP;
}
}
}
#endif
@@ -1,30 +0,0 @@
#ifndef STI_CALI_H
#define STI_CALI_H
#include "headstage_cali_sti.h"
static uint16_t UserCode2StiCode(uint16_t amp, uint8_t positive_ch){
// get real current value (uA)
uint32_t sti_code, real_amp = amp * 5;
if(StiCaliTable.p_ch.coefficient == 10000 && StiCaliTable.p_ch.offset == 0){
return amp;
}
if(StiCaliTable.n_ch.coefficient == 10000 && StiCaliTable.n_ch.offset == 0){
return amp;
}
// trans into sti code
if(positive_ch){
sti_code = StiCaliTable.p_ch.coefficient * real_amp + StiCaliTable.p_ch.offset;
}
else{
sti_code = StiCaliTable.n_ch.coefficient * real_amp + StiCaliTable.n_ch.offset;
}
sti_code = sti_code / 10000;
return (uint16_t) (sti_code);
}
#endif
@@ -1,213 +0,0 @@
#ifndef NEU_STI_INS_H
#define NEU_STI_INS_H
#include "headstage_sti_cali.h"
#include "headstage_instruction.h"
/**
* @fn get_sti_channel
*/
#define ALL_STI_CH_CONFIG_DONE 0xFF
static uint8_t get_sti_channel(uint8_t sti_channel, uint8_t ch_number_config_done) {
uint8_t sti_ch;
uint8_t total_sti_ch_number = BitCount(sti_channel);
if(ch_number_config_done == total_sti_ch_number){ return ALL_STI_CH_CONFIG_DONE; }
for (uint8_t i = 0; i < NEU_STI_CHANNEL_COUNTS-1 ; i++) {
if ( (1 << i) & sti_channel) {
if(ch_number_config_done > 0){
ch_number_config_done --;
}
else{
sti_ch = i;
return sti_ch;
}
}
}
return 9;
}
/**
* @fn build sti instruction with channel information
*/
static bool build_sti_cur_instruction(uint8_t sti_channel, uint32_t* value) {
uint8_t ins_opcode = INSTRUCTION.ins_opcode;
uint8_t op_neu; /** this is the final opcode to write register table in DBS */
switch (ins_opcode) {
case T_ZE:{
// sending garbage SPI (want to warm up SPI)
op_neu = 1;
*value = (0x00 << 23) | (op_neu << 16) | 1;
INSTRUCTION.ins_opcode = T_ST;
return false;
}
case T_ST: {
op_neu = sti_channel * 4 + 1;
uint16_t t1 = INSTRUCTION.sti_t1[sti_channel];
uint16_t t21 = (INSTRUCTION.sti_t2[sti_channel] & 0x003F) << 10;
*value = (0x01 << 23) | (op_neu << 16) | (t21) | (t1);
INSTRUCTION.ins_opcode = T_ND;
return false;
}
case T_ND: {
op_neu = sti_channel * 4 + 2;
uint16_t t22 = (INSTRUCTION.sti_t2[sti_channel] >> 6) & 0x000F;
uint16_t t3 = INSTRUCTION.sti_t3[sti_channel] << 4;
uint16_t t41 = (INSTRUCTION.sti_t4[sti_channel] & 0x03) << 14;
*value = (0x01 << 23) | (op_neu << 16) | t41 | t3 | t22;
INSTRUCTION.ins_opcode = T_RD;
return false;
}
case T_RD: {
op_neu = sti_channel * 4 + 3;
uint16_t t42 = (INSTRUCTION.sti_t4[sti_channel] >> 2) & 0xFFFF;
*value = (0x01 << 23) | (op_neu << 16) | t42;
INSTRUCTION.ins_opcode = T_FT;
return false;
}
case T_FT: {
op_neu = sti_channel * 4 + 4;
uint16_t t5 = (INSTRUCTION.sti_t5[sti_channel]) & 0x03FF;
*value = (0x01 << 23) | (op_neu << 16) | t5;
INSTRUCTION.ins_opcode = STI_CYCLE;
return false;
}
case STI_CYCLE: {
op_neu = (sti_channel / 2) + 42;
uint8_t odd_even = sti_channel % 2;
INSTRUCTION.ins_opcode = T_ZE;
// if (NEULIVE_STATE.config_type == NEU_SET_STI_VOLT) INSTRUCTION.ins_opcode = HIGH_SIDE;
if(sti_channel == 8){
// voltage stimulate
op_neu = 41;
*value = (0x01 << 23) | (op_neu << 16) | (0x00 << 8) | (INSTRUCTION.current_sti_cycle[sti_channel]);
return true;
}
if (!odd_even){
*value = (0x01 << 23) | (op_neu << 16) | (INSTRUCTION.current_sti_cycle[sti_channel + 1] << 8) | (INSTRUCTION.current_sti_cycle[sti_channel]);
}
else{
*value = (0x01 << 23) | (op_neu << 16) | (INSTRUCTION.current_sti_cycle[sti_channel] << 8) | (INSTRUCTION.current_sti_cycle[sti_channel - 1]);
}
return true;
}
default: {
INSTRUCTION.ins_opcode = T_ZE;
return false;
}
}
}
/**
* @fn build stimulation voltage
*/
static bool build_sti_amplitude(uint32_t* value) {
uint8_t ins_opcode = INSTRUCTION.ins_opcode;
switch (ins_opcode) {
case HIGH_SIDE: {
*value = (0x01 << 23) | (0x25 << 16) | INSTRUCTION.sti_amplitude_h_cali;
INSTRUCTION.ins_opcode = LOW_SIDE;
return false;
}
case LOW_SIDE: {
*value = (0x01 << 23) | (0x26 << 16) | INSTRUCTION.sti_amplitude_l_cali;
// INSTRUCTION.ins_opcode = VOLT_MODE_AMP;
INSTRUCTION.ins_opcode = BIAS_ONE;
// return false;
return true;
}
case VOLT_MODE_AMP: {
*value = (0x01 << 23) | (0x27 << 16) | INSTRUCTION.voltage_sti_amplitude;
INSTRUCTION.ins_opcode = BIAS_ONE;
return true;
}
default: {
return false;
}
}
}
static NEU_CONFIG_TYPE build_sti_ins(NEU_CONFIG_TYPE config_type, uint32_t* value){
bool single_ch_config_done;
bool done;
switch (config_type) {
/* These are recording parameter */
case NEU_WARM_UP:{
*value = (0x00 << 23) | (0x01 << 16) | 1;
return NEU_WARM_UP2;
}
case NEU_WARM_UP2:{
*value = (0x00 << 23) | (0x01 << 16) | 2;
return NEU_WARM_UP3;
}
case NEU_WARM_UP3:{
*value = (0x00 << 23) | (0x01 << 16) | 3;
return NEU_SET_STI_CUR;
}
// set stimulate t1~t5
case NEU_SET_STI_CUR: {
uint8_t sti_channel = get_sti_channel(INSTRUCTION.sti_channel, INSTRUCTION.sti_ch_config_done);
// go to config sti amplitude
if (sti_channel == ALL_STI_CH_CONFIG_DONE) {
INSTRUCTION.sti_ch_config_done = 0;
INSTRUCTION.ins_opcode = HIGH_SIDE;
// get correct amplitude sti code
INSTRUCTION.sti_amplitude_h_cali = UserCode2StiCode(INSTRUCTION.sti_amplitude_h, POSITIVE_CHANNEL);
INSTRUCTION.sti_amplitude_l_cali = UserCode2StiCode(INSTRUCTION.sti_amplitude_l, NEGATIVE_CHANNEL);
return NEU_SET_STI_VOLT;
}
// config next sti channel
else {
single_ch_config_done = build_sti_cur_instruction(sti_channel, value);
if(single_ch_config_done){ INSTRUCTION.sti_ch_config_done++; }
return NEU_SET_STI_CUR;
}
}
// config sti amplitude
case NEU_SET_STI_VOLT: {
done = build_sti_amplitude(value);
if (done) {
return NEU_SET_POLARITY;
} else {
return NEU_SET_STI_VOLT;
}
}
case NEU_SET_POLARITY: {
*value = (0x01 << 23) | (0x28 << 16) | INSTRUCTION.current_sti_polarity;
return NEU_SET_STI_CLK;
}
case NEU_SET_STI_CLK: {
*value = (0x01 << 23) | (0x34 << 16) | INSTRUCTION.sti_clock_ratio;
*value = (0x01 << 23) | (0x34 << 16) | 2;
return NEU_SET_STI_MODE;
}
// case NEU_SET_ARBITRARY: {
// *value = (0x01 << 23) | (0x36 << 16) | INSTRUCTION.arbitrary_en;
// return NEU_SET_ARB_INDEX;
// }
// case NEU_SET_ARB_INDEX: {
// *value = (0x01 << 23) | (0x37 << 16) | INSTRUCTION.arbitrary_index;
// return NEU_SET_STI_MODE;
// }
case NEU_SET_STI_MODE: {
*value = (0x01 << 23) | (0x38 << 16) | (INSTRUCTION.sti_mode << 2) | (INSTRUCTION.sti_h_bridge << 1) | (INSTRUCTION.sti_ref);
return NEU_SETUP_DONE;
}
default: {
return NEU_WARM_UP;
}
}
}
#endif
@@ -123,9 +123,7 @@
#include "uni/headstage_spi.h"
#include "uni/headstage_pwm.h"
#include "uni/uni1.3_parameter.h"
#include "neulive13_CalibrationTable.h"
#include "headstage_calibration_CIS.h"
#include "headstage_version.h"
#include "headstage_checkLSK.h"
/************************************
* instruction building macro
@@ -291,6 +289,8 @@
#define RIS_UMC_TRIG 0xC0 /**< control box to cc2650 instruction opcode, trigger stimulation */
#define RIS_DEBUG 0xE0 /* largest value of RIS, (RIS = ins[1] & 0xE0) */
/***********************
* stimulation waveform
***********************/
@@ -305,8 +305,8 @@
/*******************************
* reserved virtual instruction
*******************************/
#define VIS_BLE_T 0b10100000
#define VIS_SHIFT_T 0b01010000
#define VIS_BLE_T 0xA0
#define VIS_SHIFT_T 0x50
/// all the categories of instruction we can change .
@@ -507,14 +507,10 @@ struct HEADSTAGE_PARAMETER_TABLE {
bool amp_rst;
} INSTRUCTION = {0};
/***************************************
* @fn static void headstage_uni_delay()
* @brief make some delay
***************************************/
static void headstage_uni_delay() {
for (uint16_t i = 0; i < 1023; i++)
;
}
static uint8_t build_umn_ins_config(uint8_t config_type, uint32_t* value);
static uint8_t StartSync = 0;
static uint8_t SingleCh = 0;
static void rearrange_channel_mux_table() {
uint8_t enable_channel_number = 0;
@@ -537,6 +533,7 @@ static void rearrange_channel_mux_table() {
if (enable_channel_number == 1) {
INSTRUCTION.channel_mux[0] = last_enable_channel;
SingleCh = 1;
return;
}
@@ -550,6 +547,7 @@ static void rearrange_channel_mux_table() {
int8_t i = next_enable_channel - 1;
while (i >= 0) {
// find largest enable ch number
if (INSTRUCTION.channel_table[i]) {
next_enable_channel = i;
break;
@@ -589,8 +587,13 @@ static void rearrange_channel_mux_table() {
#define UMC_STATE_LIMITED 0x08
#define UMC_STATE_TRIGGER 0x09
#define UMC_STATE_WAIT_TRIGGER 0x0A
#define UMC_STATE_PAUSE 0x0B
#define UMC_STATE_RESTART 0x0C
#define UMC_STATE_INTERRUPT 0x0D
#define UMC_STATE_CHECK_LSK 0x0E
#define UMC_STATE_REC_STI 0x0F
#define UPDATE_DONE 0xFF
#define DEBUG 0xEE
// clang-format on
/*******************
@@ -601,9 +604,9 @@ struct {
uint8_t state;
uint8_t config_type;
uint8_t trigger_times;
uint8_t reset_flag;
} UMC_STATE = {0};
@@ -672,14 +675,16 @@ static void headstage_spi_lsk_callback(SPI_Handle handle, SPI_Transaction* trans
}
static void headstage_reset() {
headstage_led_spi_color(COLOR_GREEN);
memset(&INSTRUCTION, 0, sizeof(struct HEADSTAGE_PARAMETER_TABLE));
memset(spi_txbuf, 0, SPI_BUFFER_SIZE);
memset(spi_rxbuf, 0, SPI_BUFFER_SIZE);
memset(headstage_debug_buffer, 0, SPI_BUFFER_SIZE);
UMC_STATE.reset_flag = 1;
StartSync = 0;
headstage_spi_transaction_cancel(headstage_spi_lsk_handle);
headstage_pwm_stop(headstage_poly_r_pwm_handle);
headstage_pwm_stop(headstage_system_pwm_handle);
// headstage_pwm_stop(headstage_poly_r_pwm_handle);
// headstage_pwm_stop(headstage_system_pwm_handle);
headstage_pin_output(PIN_RESET, 0);
headstage_cpu_delay_ms(1);
headstage_pin_output(PIN_RESET, 1);
@@ -702,6 +707,8 @@ static void headstage_init() {
headstage_pin_output(PIN_STI_SEL, 1); // chip select is ok
headstage_pin_output(PIN_VGRP, 1);
headstage_pin_output(PIN_FASTSET, 0);
headstage_pwm_start(headstage_system_pwm_handle);
headstage_pwm_start(headstage_poly_r_pwm_handle);
}
static void headstage_update_ris_instruction(uint8_t ins_len, uint8_t* instruction) {
@@ -732,8 +739,8 @@ static void headstage_update_ris_instruction(uint8_t ins_len, uint8_t* instructi
uint8_t amp_gain = (instruction[0] & 0x1C) >> 2;
uint8_t pulse_width = ((instruction[0] & 0x03) << 2) | ((instruction[1] & 0xC0) >> 6);
uint8_t sti_times = (instruction[1] & 0x3F);
uint8_t sti_freq = (instruction[2] & 0x3F);
uint8_t mode = (instruction[2] & 0xC0) >> 6;
uint8_t sti_freq = (instruction[2] & 0x3F);
uint8_t cha = (instruction[3] & 0x0F);
uint8_t chb = (instruction[4] & 0xF0) >> 4;
uint8_t chc = (instruction[4] & 0x0F);
@@ -765,12 +772,25 @@ static void headstage_update_ris_instruction(uint8_t ins_len, uint8_t* instructi
headstage_spi_ask_transaction(4);
break;
}
case RIS_DEBUG:{
headstage_state = DEBUG;
headstage_led_spi_color(COLOR_BLUE);
uint32_t value;
uint8_t new_config_type = build_umn_ins_config(CONFIG_DONE, &value);
tx_put_u32(0, value);
headstage_spi_ask_transaction(4);
break;
}
default:
break;
}
}
static uint8_t VIS_START = 0;
static void headstage_update_vis_instruction(uint8_t vis_oper) {
uint32_t value;
uint8_t new_config_type;
switch (vis_oper) {
// reset
case VIS_RST:
@@ -780,6 +800,7 @@ static void headstage_update_vis_instruction(uint8_t vis_oper) {
break;
case VIS_STI:
if (headstage_state == UMC_STATE_INTERRUPT) {
// go back to configure state by DBS interrupt
headstage_state = UMC_STATE_INITIAL;
rearrange_channel_mux_table();
UMC_STATE.config_type = CONFIG_AMP_MUX;
@@ -789,20 +810,30 @@ static void headstage_update_vis_instruction(uint8_t vis_oper) {
} else {
headstage_state = UMC_STATE_HANDSHAKE;
rearrange_channel_mux_table();
headstage_pwm_start(headstage_system_pwm_handle);
headstage_pwm_start(headstage_poly_r_pwm_handle);
UMC_STATE.config_type = CONFIG_AMP_MUX;
UMC_STATE.reset_flag = 0;
headstage_led_spi_color(COLOR_BLUE);
flag_notify(EVT_UMC_LSK);
}
VIS_START = 0;
break;
// interrupt
case VIS_INT:
headstage_reset();
headstage_state = UMC_STATE_HANDSHAKE;
VIS_START = 0;
break;
case VIS_PAU:
// go back to configure state by DBS interrupt
headstage_state = UMC_STATE_PAUSE;
// rearrange_channel_mux_table();
UMC_STATE.config_type = CONFIG_AMP_MUX;
tx_put_u32(0, build_configure_instruction(UMC_IRQ, UMC_IRQ_CODE));
headstage_spi_ask_transaction(4);
break;
case VIS_BLE_T:
@@ -812,9 +843,44 @@ static void headstage_update_vis_instruction(uint8_t vis_oper) {
break;
case VIS_SHIFT_T:
// headstage_led_spi_color(COLOR_BLUE);
// uint32_t value;
// uint8_t new_config_type = build_umn_ins_config(CONFIG_DONE, &value);
// tx_put_u32(0, value);
// headstage_spi_ask_transaction(4);
break;
case VIS_FUH:
// send config done to DBS
headstage_state = UMC_STATE_WAIT_START;
new_config_type = build_umn_ins_config(CONFIG_DONE, &value);
tx_put_u32(0, value);
headstage_spi_ask_transaction(4);
break;
case VIS_HANDSHAKE_TO_CONFIG:
VIS_START = 1;
headstage_state = UMC_STATE_HANDSHAKE;
rearrange_channel_mux_table();
UMC_STATE.config_type = CONFIG_AMP_MUX;
UMC_STATE.reset_flag = 0;
headstage_led_spi_color(COLOR_BLUE);
flag_notify(EVT_UMC_LSK);
break;
case VIS_CONFIG:
// choose recording channel
headstage_state = DEBUG;
UMC_STATE.config_type = CONFIG_AMP_MUX;
UMC_STATE.config_type = build_umn_ins_config(CONFIG_AMP_MUX, &value);
tx_put_u32(0, value);
headstage_spi_ask_transaction(4);
break;
case VIS_CONFIG2:
// set gain and other amp parameter
headstage_state = UMC_STATE_CONFIGURE;
UMC_STATE.config_type = build_umn_ins_config(UMC_STATE.config_type, &value);
tx_put_u32(0, value);
headstage_spi_ask_transaction(4);
break;
default:
break;
}
@@ -855,13 +921,9 @@ static void headstage_update_cis_instruction(uint8_t cis_oper) {
break;
}
#endif
case CIS_VERSION:{
cdr_buf[0] = VERSION_DATE_YEAR;
cdr_buf[1] = VERSION_DATE_MONTH;
cdr_buf[2] = VERSION_DATE_DAY;
cdr_buf[3] = VERSION_DATE_HOUR;
cdr_buf[4] = VERSION_DATE_MINUTE;
case CIS_CALI:{
cdr_buf[0] = 87;
cdr_buf[1] = 187;
SimpleProfile_SetParameter(BLE_CDR_BUFF_CHAR, BLE_CDR_BUFF_SIZE, cdr_buf);
break;
}
@@ -889,40 +951,60 @@ static uint8_t headstage_debug_instruction(uint8_t* ins_buf) {
// todo: check data length extension with this function -> this function should be
static void headstage_uni_umc_data_append_notify_buffer(uint8_t* dat_buf) {
// check LSK data preamble ( 0b01100_0001 ) 58(01011000) 2c(00101100)
// check LSK data preamble ( 0b0110_0000_1 ) 58(01011000) 2c(00101100)
// sometimes we lose the first bit , it means we only receive
// 0110_0000_1010_1xxx_xxxx_xxxX_XXXX_XXXX and
// 1100_0001_0101_xxxx_xxxx_xxXX_XXXX_XXXX
if (((dat_buf[0] & 0xC1) != 0xC1) && (dat_buf[0] != 0x00)) {
headstage_led_spi_color(COLOR_CYAN);
headstage_uni_delay();
} else {
if ((dat_buf[1] & 0x28) == 0x28) {
// headstage_led_spi_color(COLOR_YELLOW);
dat_buf[0] = (dat_buf[0] << 1) | ((dat_buf[1] >> 7) & 0x01);
dat_buf[1] = (dat_buf[1] << 1) | ((dat_buf[2] >> 7) & 0x01);
dat_buf[2] = (dat_buf[2] << 1) | ((dat_buf[3] >> 7) & 0x01);
// if (((dat_buf[0] & 0xC1) != 0xC1) && (dat_buf[0] != 0x00)) {
//// headstage_led_spi_color(COLOR_CYAN);
// headstage_uni_delay();
// } else
// dat_buf[0] = (dat_buf[0] << 1) | ((dat_buf[1] >> 7) & 0x01);
// dat_buf[2] = ((dat_buf[1] & 0b00000111) << 2) | (dat_buf[2] & 0b11100000);
// dat_buf[1] = (dat_buf[1] >> 3) & 0b00001111;
if(!StartSync){
// headstage_led_spi_color(COLOR_RED);
if(SingleCh){
if((dat_buf[1] & 0b01111000) == 0b00101000){
StartSync = 1;
}
}
// multi channel should read preamble to allocate every channel
else{
if((dat_buf[0] & 0xFF) == 0x60 && (dat_buf[1] & 0xF8) == 0xA8){
StartSync = 1;
}
}
}
if(StartSync){
// check header, which is also a sync for single channel
dat_buf[0] = (dat_buf[0] << 1) | ((dat_buf[1] >> 7) & 0x01);
dat_buf[1] = (dat_buf[1] << 1) | ((dat_buf[2] >> 7) & 0x01);
dat_buf[2] = (dat_buf[2] << 1) | ((dat_buf[3] >> 7) & 0x01);
uint8_t channel;
if ((INSTRUCTION.enable_channel_number == 1) || (dat_buf[0] == 0xc1)) {
if ((INSTRUCTION.enable_channel_number == 1)) {
channel = reverse_channel[INSTRUCTION.last_enable_channel];
} else {
uint8_t channel_pointer = (INSTRUCTION.channel_pointer + 1) % INSTRUCTION.last_enable_channel;
channel = reverse_channel[INSTRUCTION.channel_mux[channel_pointer]];
INSTRUCTION.channel_pointer = channel_pointer;
}
uint8_t data_size = headstage_notify_append_data(channel, dat_buf);
// SimpleProfile_SetParameter(BLE_NOT_BUFF_CHAR, BLE_NOT_BUFF_SIZE, headstage_notify_buffer);
uint8_t data_size = headstage_notify_append_data(channel, dat_buf, INSTRUCTION.amp_gain);
// headstage_notify_buffer[0] = CHIP_ID;
// headstage_notify_buffer[1] = 200;
// headstage_notify_send();
if (data_size >= BLE_NOT_BUFF_SIZE) {
headstage_notify_flip_buffer();
headstage_notify_send();
// headstage_led_spi_color(COLOR_YELLOW);
// headstage_led_spi_color(COLOR_CYAN);
}
}
else{
headstage_uni_delay();
}
// uint16_t data_value = (uint16_t)(((dat_buf[1] & 0x0F) << 6) | ((dat_buf[2] & 0xFC) >> 2));
headstage_spi_lsk_transaction(3);
}
@@ -945,7 +1027,8 @@ static uint8_t build_umn_ins_config(uint8_t config_type, uint32_t* value) {
case CONFIG_AMP_GAIN:
*value = build_configure_instruction(CONFIG_AMP_GAIN, amp_gain_table[INSTRUCTION.amp_gain]);
return CONFIG_STI_VOLT;
// return CONFIG_STI_VOLT;
return CONFIG_AMP_BAND;
case CONFIG_STI_VOLT:
*value = build_configure_instruction(CONFIG_STI_VOLT, INSTRUCTION.sti_volt);
@@ -953,7 +1036,8 @@ static uint8_t build_umn_ins_config(uint8_t config_type, uint32_t* value) {
case CONFIG_AMP_BAND:
*value = build_configure_instruction(CONFIG_AMP_BAND, amp_band_table[INSTRUCTION.amp_low_band_freq]);
return CONFIG_STI_PULSE_WIDTH;
// return CONFIG_STI_PULSE_WIDTH;
return CONFIG_ADC_RATE;
case CONFIG_STI_PULSE_WIDTH:
*value = build_configure_instruction(CONFIG_STI_PULSE_WIDTH, sti_pulse_width_table[INSTRUCTION.pulse_width]);
@@ -965,7 +1049,8 @@ static uint8_t build_umn_ins_config(uint8_t config_type, uint32_t* value) {
case CONFIG_ADC_RATE:
*value = build_configure_instruction(CONFIG_ADC_RATE, adc_clock_table[INSTRUCTION.frequency]);
return CONFIG_STI_CHANNEL_P;
// return CONFIG_STI_CHANNEL_P;
return CONFIG_DONE;
case CONFIG_STI_CHANNEL:
case CONFIG_STI_CHANNEL_P:
@@ -1037,6 +1122,8 @@ static void headstage_umc_state_transfer_ask() {
case UMC_STATE_WAIT_START:
headstage_spi_lsk_transaction(8);
break;
case UMC_STATE_CHECK_LSK:
case UMC_STATE_REC_STI:
case UMC_STATE_TRIGGER:
case UMC_STATE_CONTINUOUS:
case UMC_STATE_LIMITED:
@@ -1046,6 +1133,12 @@ static void headstage_umc_state_transfer_ask() {
headstage_state = UMC_STATE_TRIGGER;
headstage_spi_lsk_transaction(3);
break;
case UMC_STATE_PAUSE:
headstage_spi_lsk_transaction(8);
break;
case UMC_STATE_RESTART:
headstage_spi_lsk_transaction(8);
break;
default:
break;
}
@@ -1054,6 +1147,8 @@ static void headstage_umc_state_transfer_ask() {
/**
* @fn headstage_umc_state_transfer_lsk
*/
static uint8_t TestCounter = 0;
static uint8_t PassCheck = 0; // PassCheck=1 => DBS receive ASK, else ASK failed
static void headstage_umc_state_transfer_lsk() {
switch (headstage_state) {
case UMC_STATE_IDLE:
@@ -1063,8 +1158,10 @@ static void headstage_umc_state_transfer_lsk() {
case UMC_STATE_HANDSHAKE:
// if we receive handshake data , prepare handshake echo and call spi_tx transfer
if (umc_handshake_check(spi_rxbuf)) {
FlushSPIrx();
tx_put_u32(0, UMC_HAND_SHAKE_RECV);
headstage_state = UMC_STATE_HANDSHAKE_RECEIVE;
// headstage_state = DEBUG;
headstage_spi_ask_transaction(4); // transmit handshake echo
} else {
headstage_spi_lsk_transaction(2); // listen to LSK for handshake data again
@@ -1074,10 +1171,10 @@ static void headstage_umc_state_transfer_lsk() {
case UMC_STATE_HANDSHAKE_RECEIVE:
/**< if we success to receive handshake data */
if (umc_pass_check()) {
FlushSPIrx();
tx_put_u32(0, build_configure_instruction(UMC_CALIB_DONE, UMC_MODE_LSK_OUT));
headstage_state = UMC_STATE_INITIAL;
headstage_spi_ask_transaction(4);
} else {
headstage_spi_ask_transaction(4);
@@ -1086,12 +1183,17 @@ static void headstage_umc_state_transfer_lsk() {
case UMC_STATE_INITIAL:
if (umc_pass_check()) {
FlushSPIrx();
TestCounter = 0;
headstage_state = UMC_STATE_CONFIGURE;
if(VIS_START){
headstage_state = DEBUG;
}
headstage_spi_ask_transaction(4);
} else {
headstage_spi_ask_transaction(4);
}
TestCounter ++;
break;
case UMC_STATE_CONFIGURE:
@@ -1108,69 +1210,98 @@ static void headstage_umc_state_transfer_lsk() {
if (new_config_type == CONFIG_DONE) {
headstage_state = UMC_STATE_WAIT_START;
if(VIS_START){ headstage_state = DEBUG; }
} else {
headstage_state = UMC_STATE_CONFIGURE;
}
TestCounter = 0;
headstage_spi_ask_transaction(4);
}
} else {
headstage_spi_ask_transaction(4);
}
TestCounter ++;
break;
/**
* conservative instruction need golden key to trigger DBS
*/
// conservative instruction need golden key to trigger DBS
case UMC_STATE_WAIT_START:
if (headstage_debug_buffer[1] > 18) {
// this transaction make cause amplifier data right shift
switch (INSTRUCTION.mode) {
case 0:
// continuous mode
headstage_state = UMC_STATE_TRIGGER;
UMC_STATE.trigger_times = 0;
headstage_spi_lsk_transaction(3);
break;
case 1:
// trigger mode
headstage_state = UMC_STATE_TRIGGER;
UMC_STATE.trigger_times = 0;
headstage_spi_lsk_transaction(3);
break;
case 2:
// limited mode
headstage_state = UMC_STATE_LIMITED;
UMC_STATE.trigger_times = INSTRUCTION.sti_times;
headstage_spi_lsk_transaction(3);
break;
case 3:
// continuous mode
headstage_state = UMC_STATE_CONTINUOUS;
UMC_STATE.trigger_times = 0;
headstage_spi_lsk_transaction(3);
break;
default:
headstage_state = UMC_STATE_CONTINUOUS;
UMC_STATE.trigger_times = 0;
headstage_spi_lsk_transaction(3);
break;
}
// headstage_state = UMC_STATE_CHECK_LSK;
headstage_state = UMC_STATE_REC_STI;
headstage_spi_lsk_transaction(3);
} else if (headstage_debug_buffer[1] > 10) {
headstage_debug_buffer[1] += 1;
tx_put_u32(0, UMC_GOLDEN_KEY);
headstage_spi_ask_transaction(4);
} else {
headstage_debug_buffer[1] += 1;
headstage_debug_buffer[1] ++;
tx_put_u32(0, build_configure_instruction(CONFIG_DONE, 0xFF));
headstage_spi_ask_transaction(4);
}
break;
// check lsk, make sure DBS chip have no error
case UMC_STATE_CHECK_LSK:{
uint8_t NoError = 0;
NoError = CheckLSK(spi_rxbuf);
if(NoError == LSK_NO_ERROR){
headstage_state = UMC_STATE_REC_STI;
headstage_led_spi_color_debug(0xE1, 0x00, 0x00, 0xFF);
}
else if(NoError == LSK_CHECKING_ERROR){
headstage_state = UMC_STATE_CHECK_LSK;
headstage_led_spi_color(COLOR_GREEN);
}
else if(NoError == LSK_ERROR){
headstage_state = UMC_STATE_REC_STI;
headstage_led_spi_color_debug(0xE1, 0xF1, 0x00, 0x00);
}
else{
headstage_led_spi_color_debug(0xE1, 0xF1, 0xF1, 0xF1);
headstage_state = UMC_STATE_REC_STI;
}
headstage_spi_lsk_transaction(3);
break;
}
case UMC_STATE_REC_STI:
// this transaction make cause amplifier data right shift
switch (INSTRUCTION.mode) {
case 0:
// continuous mode
headstage_state = UMC_STATE_TRIGGER;
UMC_STATE.trigger_times = 0;
headstage_spi_lsk_transaction(3);
break;
case 1:
// trigger mode
headstage_state = UMC_STATE_TRIGGER;
UMC_STATE.trigger_times = 0;
headstage_spi_lsk_transaction(3);
break;
case 2:
// limited mode
headstage_state = UMC_STATE_LIMITED;
UMC_STATE.trigger_times = INSTRUCTION.sti_times;
headstage_spi_lsk_transaction(3);
break;
case 3:
// continuous mode
headstage_state = UMC_STATE_CONTINUOUS;
UMC_STATE.trigger_times = 0;
headstage_spi_lsk_transaction(3);
break;
default:
headstage_state = UMC_STATE_CONTINUOUS;
UMC_STATE.trigger_times = 0;
headstage_spi_lsk_transaction(3);
break;
}
break;
case UMC_STATE_TRIGGER:
// headstage_led_spi_color(COLOR_GREEN);
headstage_uni_umc_data_append_notify_buffer(spi_rxbuf);
break;
@@ -1192,6 +1323,30 @@ static void headstage_umc_state_transfer_lsk() {
break;
case UMC_STATE_INTERRUPT:
break;
case DEBUG:
UMC_STATE.reset_flag = 1;
break;
case UMC_STATE_PAUSE:
if (umc_pass_check()) {
headstage_led_spi_color(COLOR_RED);
// headstage_state = UMC_STATE_RESTART;
}
else {
headstage_spi_ask_transaction(4);
}
break;
case UMC_STATE_RESTART:
// if (umc_pass_check()) {
// headstage_led_spi_color(COLOR_YELLOW);
INSTRUCTION.mode = 0;
headstage_state = UMC_STATE_WAIT_START;
headstage_spi_ask_transaction(4);
// } else {
// headstage_spi_ask_transaction(4);
// }
break;
default:
break;
}
@@ -1,44 +0,0 @@
#ifndef VERSION_DATE
#define VERSION_DATE
#define VERSION_DATE_YEAR 20
#define VERSION_DATE_MONTH 7
#define VERSION_DATE_DAY 9
#define VERSION_DATE_HOUR 10
#define VERSION_DATE_MINUTE 16
// this is NOT the version hash !!
// it's the last version hash
#define VERSION_HASH 549db3f6d4f60019e726ba2b4318c2dd968cf3d5
#define VERSION_GIT_BRANCH Neulive2.0_developement
static void get_board_name(char *board_name_ch, uint8 *board_name_int, uint8 name_size){
uint8 name_offset = 18;
for(int i=0, k=0; i<name_size+1 ; i++){
if('0' <= board_name_ch[name_offset + i] && board_name_ch[name_offset + i] <= '9'){
board_name_int[k++] = board_name_ch[name_offset + i] - '0';
}
else if('A' <= board_name_ch[name_offset + i] && board_name_ch[name_offset + i] <= 'F'){
board_name_int[k++] = board_name_ch[name_offset + i] - 'A' + 10;
}
else if(board_name_ch[name_offset + i] == '_'){
continue;
}
else{
// error occur
for(int j=0 ; j<name_size/2 ; j++){
board_name_int[j] = 0xFF;
}
return;
}
}
for(int i=0 ; i<name_size/2 ; i++){
board_name_int[i] = (board_name_int[2*i] << 4) | (board_name_int[2*i + 1]);
}
}
#endif
@@ -1,23 +0,0 @@
#ifndef CHECK_MOSI
#define CHECK_MOSI
#include "headstage_led.h"
/*
* MOSI channel meet with INSTRUCTION.recording_channel ?
*/
static uint8_t CheckMOSI(uint8_t* MOSI){
uint8_t ch = MOSI[0];
uint16_t selectCh = 0x0001 << ch;
if(selectCh & INSTRUCTION.recording_channel){
return 1;
}
else{
// headstage_led_color(COLOR_RED);
// headstage_led_color(COLOR_GREEN);
return 0;
}
}
#endif
@@ -10,7 +10,7 @@
#define NOT_BUF_OFFSET_INIT 8
static uint8_t not_buf_offset = NOT_BUF_OFFSET_INIT;
static uint32_t not_buf_offset = NOT_BUF_OFFSET_INIT;
static uint32_t not_time_stamp = 0;
static void headstage_notify_set_timestamp() {
@@ -23,7 +23,7 @@ static void headstage_notify_set_timestamp() {
}
static void headstage_notify_flip_buffer() {
uint8_t data_count = (not_buf_offset - NOT_BUF_OFFSET_INIT) / 3;
uint8_t data_count = (not_buf_offset - NOT_BUF_OFFSET_INIT) / 2;
headstage_notify_buffer[0] = CHIP_ID;
headstage_notify_buffer[1] = data_count;
@@ -39,15 +39,13 @@ static uint8_t headstage_notify_append_data(uint8_t *data_value) {
if (data_value == NULL) {
headstage_notify_buffer[not_buf_offset++] = 0x00;
headstage_notify_buffer[not_buf_offset++] = 0x00;
headstage_notify_buffer[not_buf_offset++] = 0x00;
headstage_notify_buffer[not_buf_offset++] = 0x03;
} else {
headstage_notify_buffer[not_buf_offset++] = data_value[0];
headstage_notify_buffer[not_buf_offset++] = data_value[1];
headstage_notify_buffer[not_buf_offset++] = data_value[2];
}
if (not_buf_offset >= BLE_NOT_BUFF_SIZE - 1) {
if (not_buf_offset == BLE_NOT_BUFF_SIZE) {
uint32_t current = headstage_time_stamp_us();
uint32_t time_delta = ((current - not_time_stamp)) & 0xFFFF;
@@ -25,19 +25,19 @@
// clang-format off
#define PIN_LED_SDI IOID_0 // SPI1 to receive LSK
#define PIN_LED_CLK IOID_1 // SPI1 clock
#define PIN_RESET IOID_0 // SPI1 to receive LSK
#define PIN_EN_ADC_SPI_CLK IOID_1 // SPI1 clock
#define PIN_DC_DC IOID_2 // STI select need
#define PIN_EN_ADC_SPI_CLK IOID_3 //
#define PIN_BATT_HALF IOID_4 //
#define PIN_SPI_MISO IOID_7 //
#define PIN_SPI_MOSI IOID_8 //
#define PIN_SPI_CS IOID_9 //
#define PIN_SPI_CLK IOID_10 //
#define PIN_SYS_CLK IOID_11 //
#define PIN_RESET IOID_12 //
#define PIN_AMP_VCK IOID_13 //
#define PIN_STI_CLK IOID_14 //
#define PIN_BATT_HALF IOID_3 //
#define PIN_AMP_VCK IOID_4 //
#define PIN_LED_SDI IOID_7 //
#define PIN_LED_CLK IOID_8 //
#define PIN_STI_CLK IOID_9 //
#define PIN_SPI_MISO IOID_10 //
#define PIN_SPI_MOSI IOID_11 //
#define PIN_SPI_CS IOID_12 //
#define PIN_SPI_CLK IOID_13 //
#define PIN_SYS_CLK IOID_14 //
// clang-format on
#endif
@@ -47,8 +47,7 @@
#define Board_SPI0_MISO PIN_SPI_MISO
#define Board_SPI0_MOSI PIN_SPI_MOSI
#define Board_SPI0_CLK PIN_SPI_CLK
//#define Board_SPI0_CSN PIN_SPI_CS
#define Board_SPI0_CSN PIN_UNASSIGNED
#define Board_SPI0_CSN PIN_SPI_CS
/*
* SPI1 interface work with LED
@@ -1,118 +0,0 @@
#ifndef NEU_2_RST
#define NEU_2_RST
#include "headstage_instruction.h"
#include "neu/headstage_spi.h"
static void ResetINSTRUCTION();
static void MCUReset(){
// Reset INSTRUCTION & NEULIVE_STATE
ResetINSTRUCTION();
// global variable reset
STI = false;
rec_sti_command = 0;
IsFirstData = true;
// SPI reset
SPI_close(headstage_spi_handle);
spi_state_counter = 0;
check_reg_counter = 0;
for(int i=0 ; i<SPI_BUFFER_SIZE ; i++ ){
spi_txbuf[i] = 0;
spi_rxbuf[i] = 0;
}
SPICallBack = ONE_SHOT_SPI;
ReopenSPI();
for(int i=0 ; i<SPI_LED_BUFF_SIZE ; i++){
headstage_spi_led_txbuf[i] = 0;
}
// CIS buffer reset
for(int i=0 ; i<BLE_CDR_SAMLL_SIZE ; i++){
cdr_buf[i] = 0;
}
// Notify Buffer reset
for(int i=0 ; i<BLE_NOT_BUFF_SIZE ; i++){
headstage_notify_buffer[i] = 0;
}
not_buf_offset = NOT_BUF_OFFSET_INIT;
not_time_stamp = 0;
if(ErrorRestart){
headstage_led_color(COLOR_RED);
}
else if(ConnectState){
headstage_led_color(COLOR_CYAN);
}
else{
headstage_led_color(COLOR_GREEN); // color green
}
// this flag is set by SimpleBLEPeripheral_processStateChangeEvt() in simple_peripheral.c
// ConnectState = false;
}
static void DBSReset(){
headstage_pin_output(PIN_RESET, 0);
headstage_cpu_delay_ms(10);
headstage_pin_output(PIN_DC_DC, 1);
headstage_pin_output(PIN_EN_ADC_SPI_CLK, 1);
headstage_pin_output(PIN_RESET, 1);
}
static void Neu2Reset(){
DBSReset();
MCUReset();
}
static void ResetINSTRUCTION(){
INSTRUCTION.vgrp = 16;
INSTRUCTION.vgrn = 16;
INSTRUCTION.vgr_intp = 16;
INSTRUCTION.vgr_intn = 16;
INSTRUCTION.vgr_int_old = 16;
INSTRUCTION.recording_channel = 0b0000000000000000;
INSTRUCTION.adc_clock_ratio = 100;
INSTRUCTION.sys_clk_ratio = 10;
INSTRUCTION.sti_clock_ratio = 10;
INSTRUCTION.amplifier_gain = 0;
INSTRUCTION.chopper_ratio = 2;
INSTRUCTION.sti_t1[1] = 0;
INSTRUCTION.sti_t2[1] = 0;
INSTRUCTION.sti_t3[1] = 0;
INSTRUCTION.sti_t4[1] = 0;
INSTRUCTION.sti_t5[1] = 0;
INSTRUCTION.sti_channel = 0;
INSTRUCTION.arbitrary_en = 0;
INSTRUCTION.arbitrary_index = 0;
INSTRUCTION.sti_h_bridge = 0;
INSTRUCTION.sti_mode = 0;
INSTRUCTION.sti_ref = 0;
INSTRUCTION.current_sti_polarity = 0;
INSTRUCTION.sti_amplitude_h = 0;
INSTRUCTION.sti_amplitude_l = 0;
INSTRUCTION.sti_amplitude_h_cali = 0;
INSTRUCTION.sti_amplitude_l_cali = 0;
INSTRUCTION.ins_opcode = BIAS_ONE;
INSTRUCTION.sti_ch_config_done = 0;
// uint8_t voltage_sti_channel = 0;
// uint8_t voltage_sti_amplitude = 0;
for(int i=0 ; i<NEU_STI_CHANNEL_COUNTS ; i++){
INSTRUCTION.current_sti_cycle[i] = 0;
}
NEULIVE_STATE.state = NEU_IDLE;
NEULIVE_STATE.config_type = NEU_WARM_UP;
NEULIVE_STATE.index = 0;
}
#endif
@@ -12,7 +12,7 @@
#include <ti/drivers/dma/UDMACC26XX.h>
#include <ti/drivers/spi/SPICC26XXDMA.h>
#define SPI_BUFFER_SIZE 3
#define SPI_BUFFER_SIZE 20
static uint8_t spi_txbuf[SPI_BUFFER_SIZE] = {0};
static uint8_t spi_rxbuf[SPI_BUFFER_SIZE] = {0};
@@ -38,14 +38,14 @@ static void headstage_spi_callback(SPI_Handle handle, SPI_Transaction* transacti
headstage_spi_handle = SPI_open(Board_SPI0, &spi_parameter); \
} while (0)
//#define headstage_spi_transaction(handle, length, tx, rx) \
// ({ \
// SPI_Transaction transaction = headstage_spi_transaction ; \
// transaction.count = (length); \
// transaction.txBuf = (tx); \
// transaction.rxBuf = (rx); \
// SPI_transfer(handle, &transaction); \
// })
#define headstage_spi_transaction(handle, length, tx, rx) \
({ \
SPI_Transaction transaction = headstage_spi_transaction ; \
transaction.count = (length); \
transaction.txBuf = (tx); \
transaction.rxBuf = (rx); \
SPI_transfer(handle, &transaction); \
})
#define headstage_spi_transaction(length) \
({ \
@@ -70,54 +70,4 @@ static void headstage_spi_callback(SPI_Handle handle, SPI_Transaction* transacti
} \
} while (0)
static void ReopenSPI(){
SPI_init();
SPI_Params spi_parameter;
SPI_Params_init(&spi_parameter);
spi_parameter.transferMode = SPI_MODE_CALLBACK;
spi_parameter.mode = SPI_SLAVE;
spi_parameter.bitRate = NEU_SPI_FREQ;
spi_parameter.dataSize = 8;
spi_parameter.frameFormat = SPI_POL0_PHA1;
spi_parameter.transferCallbackFxn = headstage_spi_callback;
headstage_spi_handle = SPI_open(Board_SPI0, &spi_parameter);
}
//static void WriteSPI(uint8_t length){
// if(OpenSPI){
// ReopenSPI();
// }
//
// for(int i=length ; i<SPI_BUFFER_SIZE ; i++){
// spi_rxbuf[i] = 0x00;
// }
//
// SPICallBack = FLUSH_BUFFER;
// headstage_spi_transaction.count = 3;
// headstage_spi_transaction.txBuf = spi_txbuf;
// headstage_spi_transaction.rxBuf = spi_rxbuf;
//
// SPI_transfer(headstage_spi_handle, &headstage_spi_transaction);
//}
//static void ReadSPI(){
// if(OpenSPI){
// ReopenSPI();
// }
//
// SPICallBack = READ_REG;
// headstage_spi_transaction.count = 3;
// headstage_spi_transaction.txBuf = spi_txbuf;
// headstage_spi_transaction.rxBuf = spi_rxbuf;
//
// SPI_transfer(headstage_spi_handle, &headstage_spi_transaction);
//}
static void AppendSPITX(uint8_t index, uint32_t value){
tx_put_u24(index, value);
for(int i=3 ; i<SPI_BUFFER_SIZE ; i++){
spi_txbuf[i] = 0;
}
}
#endif
#endif
@@ -0,0 +1,107 @@
#ifndef NEU_CALI_TABLE
#define NEU_CALI_TABLE
#define BOARD_NAME
typedef struct _SingleChannelCali{
uint16_t Gain[3];
int16_t Offset[3];
}SingleChannelCali;
struct _CaliTable{
SingleChannelCali Ch[12];
}CaliTable =
#ifdef BOARD_NAME
{
.Ch[0].Gain[0] = 23,
.Ch[0].Offset[0] = -3,
.Ch[0].Gain[1] = 106,
.Ch[0].Offset[1] = -13,
.Ch[0].Gain[2] = 233,
.Ch[0].Offset[2] = -27,
.Ch[1].Gain[0] = 23,
.Ch[1].Offset[0] = 1,
.Ch[1].Gain[1] = 109,
.Ch[1].Offset[1] = 6,
.Ch[1].Gain[2] = 241,
.Ch[1].Offset[2] = 16,
.Ch[2].Gain[0] = 24,
.Ch[2].Offset[0] = -14,
.Ch[2].Gain[1] = 112,
.Ch[2].Offset[1] = -60,
.Ch[2].Gain[2] = 241,
.Ch[2].Offset[2] = -131,
.Ch[3].Gain[0] = 23,
.Ch[3].Offset[0] = 16,
.Ch[3].Gain[1] = 110,
.Ch[3].Offset[1] =70,
.Ch[3].Gain[2] = 231,
.Ch[3].Offset[2] = 156,
.Ch[4].Gain[0] = 69,
.Ch[4].Offset[0] = 0,
.Ch[4].Gain[1] = 322,
.Ch[4].Offset[1] = 10,
.Ch[4].Gain[2] = 665,
.Ch[4].Offset[2] = 15,
.Ch[5].Gain[0] = 69,
.Ch[5].Offset[0] = 9,
.Ch[5].Gain[1] = 320,
.Ch[5].Offset[1] = 35,
.Ch[5].Gain[2] = 632,
.Ch[5].Offset[2] = 75,
.Ch[6].Gain[0] = 69,
.Ch[6].Offset[0] = 21,
.Ch[6].Gain[1] = 323,
.Ch[6].Offset[1] = 86,
.Ch[6].Gain[2] = 551,
.Ch[6].Offset[2] = 167,
.Ch[7].Gain[0] = 69,
.Ch[7].Offset[0] = -20,
.Ch[7].Gain[1] = 316,
.Ch[7].Offset[1] = -82,
.Ch[7].Gain[2] = 577,
.Ch[7].Offset[2] = -148,
.Ch[8].Gain[0] = 69,
.Ch[8].Offset[0] = 12,
.Ch[8].Gain[1] = 322,
.Ch[8].Offset[1] = 58,
.Ch[8].Gain[2] = 613,
.Ch[8].Offset[2] = 105,
.Ch[9].Gain[0] = 69,
.Ch[9].Offset[0] = -6,
.Ch[9].Gain[1] = 325,
.Ch[9].Offset[1] = -15,
.Ch[9].Gain[2] = 622,
.Ch[9].Offset[2] = -14,
.Ch[10].Gain[0] = 24,
.Ch[10].Offset[0] = -5,
.Ch[10].Gain[1] = 103,
.Ch[10].Offset[1] = -24,
.Ch[10].Gain[2] = 209,
.Ch[10].Offset[2] = -50,
.Ch[11].Gain[0] = 116,
.Ch[11].Offset[0] = 49,
.Ch[11].Gain[1] = 388,
.Ch[11].Offset[1] = 202,
.Ch[11].Gain[2] = 340,
.Ch[11].Offset[2] = 273
};
#endif
#else
{0};
#endif
@@ -8,9 +8,11 @@
#error "headstage/headstage_notify.h not included"
#endif
#include "headstage13_calibration.h"
#define NOT_BUF_OFFSET_INIT 8
static uint8_t not_buf_offset = NOT_BUF_OFFSET_INIT;
static uint32_t not_buf_offset = NOT_BUF_OFFSET_INIT;
static uint32_t not_time_stamp = 0;
static void headstage_notify_set_timestamp() {
@@ -31,7 +33,9 @@ static void headstage_notify_flip_buffer() {
not_buf_offset = NOT_BUF_OFFSET_INIT;
}
static uint8_t headstage_notify_append_data(uint8_t channel, uint8_t *data_value) {
static uint8_t headstage_notify_append_data(uint8_t channel, uint8_t *data_value, uint8_t gain) {
uint16_t data;
if (not_buf_offset <= NOT_BUF_OFFSET_INIT) {
headstage_notify_set_timestamp();
not_buf_offset = NOT_BUF_OFFSET_INIT;
@@ -41,8 +45,13 @@ static uint8_t headstage_notify_append_data(uint8_t channel, uint8_t *data_value
headstage_notify_buffer[not_buf_offset++] = ((channel & 0x0F) << 4);
headstage_notify_buffer[not_buf_offset++] = 0x03;
} else {
headstage_notify_buffer[not_buf_offset++] = ((channel & 0x0f) << 4) | (data_value[1] & 0x0f);
headstage_notify_buffer[not_buf_offset++] = data_value[2] & 0xFC;
// data = Calibration(data_value, channel, gain);
data = (data_value[1] & 0x0F) << 6 | (data_value[2] & 0xFC) >>2;
data = not_buf_offset;
// headstage_notify_buffer[not_buf_offset++] = ((channel & 0x0F) << 4) | (data_value[1] & 0x0F);
// headstage_notify_buffer[not_buf_offset++] = data_value[2] & 0xFC;
headstage_notify_buffer[not_buf_offset++] = ((channel & 0x0F) << 4) | (data & 0x03C0) >> 6;
headstage_notify_buffer[not_buf_offset++] = (data & 0x003F) << 2;
}
if (not_buf_offset == BLE_NOT_BUFF_SIZE) {
@@ -76,14 +76,14 @@
#endif
//static PIN_Config headstage_pin_configuration[] = { //
// PIN_STI_SEL | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
// PIN_RESET | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
// PIN_VGRP | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
// PIN_FASTSET | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
// PIN_LED_CLK | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
// PIN_LED_OUT | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
// //
// PIN_TERMINATE};
static PIN_Config headstage_pin_configuration[] = { //
PIN_STI_SEL | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
PIN_RESET | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
PIN_VGRP | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
PIN_FASTSET | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
PIN_LED_CLK | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
PIN_LED_OUT | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
//
PIN_TERMINATE};
#endif // HEADSTAGE_PIN_UNI_H
@@ -89,4 +89,12 @@ static void headstage_spi_lsk_callback(SPI_Handle handle, SPI_Transaction* trans
} \
} while (0)
static void FlushSPIrx(){
for(int i=0 ; i<SPI_BUFFER_SIZE ; i++){
spi_rxbuf[i] = 0;
}
}
#endif // HEADSTAGE_SPI_H
@@ -114,29 +114,21 @@
#ifndef FEATURE_OAD
// Minimum connection interval (units of 1.25ms, 80=100ms) if automatic
// parameter update request is enabled
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 8
//#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 14
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 6
// Maximum connection interval (units of 1.25ms, 800=1000ms) if automatic
// parameter update request is enabled
//#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 6
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 30
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 6
#else //! FEATURE_OAD
// Minimum connection interval (units of 1.25ms, 8=10ms) if automatic
// parameter update request is enabled
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 80
//#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 14
// Maximum connection interval (units of 1.25ms, 8=10ms) if automatic
// parameter update request is enabled
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 80
//#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 25
#endif // FEATURE_OAD
#define SBP_PERIODIC_EVT_PERIOD DEFAULT_DESIRED_MIN_CONN_INTERVAL + 2
// Slave latency to use if automatic parameter update request is enabled
#define DEFAULT_DESIRED_SLAVE_LATENCY 0
@@ -168,7 +160,6 @@
#define SBP_STATE_CHANGE_EVT 0x0001
#define SBP_CHAR_CHANGE_EVT 0x0002
#define SBP_CONN_EVT_END_EVT 0x0004
#define SBP_PERIODIC_EVT 0x0008
// clang-format on
/*********************************************************************
@@ -325,7 +316,7 @@ static void SimpleBLEPeripheral_init(void) {
application_message_queue = Util_constructQueue(&application_message);
// Setup the GAP
GAP_SetParamValue(TGAP_CONN_PAUSE_PERIPHERAL, DEFAULT_CONN_PAUSE_PERIPHERAL);
GAP_SetParamValue(TGAP_GAP_SetParamValueCONN_PAUSE_PERIPHERAL, DEFAULT_CONN_PAUSE_PERIPHERAL);
// Setup the GAP Peripheral Role Profile
{
@@ -416,9 +407,7 @@ static void SimpleBLEPeripheral_init(void) {
// Register for GATT local events and ATT Responses pending for transmission
GATT_RegisterForMsgs(self);
// HCI_LE_ReadMaxDataLenCmd();
//
// HCI_LE_WriteSuggestedDefaultDataLenCmd(251, 2120); // this is used for data length extension
headstage_led_spi_color(COLOR_GREEN);
}
@@ -510,7 +499,7 @@ static void headstage_init_device_info() {
break;
}
uint8_t scanRspData[64];
uint8_t scanRspData[120];
uint8_t *p = scanRspData;
*p++ = sizeof(DEVICE_NAME);
*p++ = GAP_ADTYPE_LOCAL_NAME_COMPLETE;
@@ -518,7 +507,7 @@ static void headstage_init_device_info() {
for (unsigned int i = 0; i < sizeof(DEVICE_NAME) - 1; i++) {
*p++ = DEVICE_NAME[i];
}
*p++ = 16;
*p++ = 15;
*p++ = GAP_ADTYPE_MANUFACTURER_SPECIFIC;
// unsafe_memcpy(p, "BPHS", 4);
*p++ = 'B';
@@ -534,9 +523,7 @@ static void headstage_init_device_info() {
*p++ = 'B';
*p++ = 'A';
*p++ = 'T';
*p++ = headstage_battery_volt1();
*p++ = headstage_battery_volt2();
*p++ = headstage_battery_percent();
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(DEVICE_NAME), DEVICE_NAME);
@@ -612,15 +599,6 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
headstage_event_handle();
}
// if (events & SBP_PERIODIC_EVT) {
// events &= ~SBP_PERIODIC_EVT;
//
// // Util_startClock(&periodicClock);
//
// // Perform periodic application task
// SimpleBLEPeripheral_performPeriodicTask();
// }
#ifdef FEATURE_OAD
while (!Queue_empty(oad_queue_handle)) {
oadTargetWrite_t *oadWriteEvt = Queue_get(oad_queue_handle);
@@ -803,45 +781,6 @@ static void SimpleBLEPeripheral_stateChangeCB(gaprole_States_t newState) {
SimpleBLEPeripheral_enqueueMsg(SBP_STATE_CHANGE_EVT, newState);
}
/*********************************************************************
* @fn BitReverse
*
* @brief Change input Array in bit reversed index 0101(5)->1010(10)
* cause FFT need Butterfly pairs.
*
* @param newState - new state (??)
*
* @return None.
*/
static void BitReverse(int BR_array[],int NUM_FFT) {
#if (NUM_FFT >= 512)
unsigned int swapA, swapB, sw_cnt;
#endif
#if (NUM_FFT <= 256)
unsigned int swapA, swapB, sw_cnt;
#endif
unsigned char BR_table = [0,4,2,6,1,3,5,7];
int TemStore;
for (sw_cnt=1; sw_cnt<NUM_FFT/2; sw_cnt++){
swapA = sw_cnt;
swapB = BR_table[sw_cnt] *2;
if (swapB > swapA){
TemStore = BR_array[swapA];
BR_array[swapA] = BR_array[swapB];
BR_array[swapB] = TemStore;
}
}
}
/*********************************************************************
* @fn SimpleBLEPeripheral_processStateChangeEvt
*
@@ -859,34 +798,11 @@ static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState)
GAPRole_GetParameter(GAPROLE_BD_ADDR, ownAddress);
uint16_t CH1[], CH2[], CH3[], CH4[], CH5[], CH6[], CH7[], CH8[]; // <======= BS 0709
// use 6 bytes of device address for 8 bytes of system ID value
systemId[0] = ownAddress[0];
systemId[1] = ownAddress[1];
systemId[2] = ownAddress[2];
switch(ch){ // <======= BS 0709
case(1):
idx = size(CH1);
if (idx<6){
CH1[idx+1] = dataIN;
}
else if (idx<FFT_NUM){
LFP_tmp = CH1[idx-1]*w1 + CH1[idx-2]*w2 + CH1[idx-3]*w3 + CH1[idx-4]*w4 + CH1[idx-5]*w5;
CH1[idx+1] = (LFP_tmp < 0) ? 0 - LFP_tmp : LFP_tmp;
}
else{
BitReverse(CH1);
FFT(CH1)
}
break;
}
// set middle bytes to zero
systemId[4] = 0x00;
systemId[3] = 0x00;
@@ -907,15 +823,12 @@ 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
uint16_t requestedPDUSize = 251;
uint16_t requestTxTime = 2120; // (LL payload + 14) * 8
uint16_t requestTxTime = 2120;
GAPRole_GetParameter(GAPROLE_CONNHANDLE, &cxnHandle);
if (SUCCESS == HCI_LE_SetDataLenCmd(cxnHandle, requestedPDUSize, requestTxTime)) {
ConnectState = true;
headstage_led_color(COLOR_CYAN);
headstage_led_spi_color(COLOR_CYAN);
}
// Use numActive to determine the connection handle of the last
// connection
@@ -930,26 +843,18 @@ static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState)
case GAPROLE_WAITING:
// Device is started but not advertising, is in waiting period before advertising again
SimpleBLEPeripheral_freeAttRsp(bleNotConnected);
ConnectState = false;
if(ErrorRestart){
headstage_led_color(COLOR_RED);
}
else{
headstage_led_color(COLOR_GREEN);
}
break;
case GAPROLE_WAITING_AFTER_TIMEOUT:
// Device just timed out from a connection but is not yet advertising, is in waiting period before advertising again
// disconnected
SimpleBLEPeripheral_freeAttRsp(bleNotConnected);
ErrorRestart = true;
headstage_led_spi_color(COLOR_RED); /** for neulive1.3 call headstage_led_spi_color ; for neulive2.0 call headstage_led_color */
CONNECT_HANDLE = 0xFFFF;
flag_notify(EVT_DISCONNECTED);
headstage_led_color(COLOR_RED);
break;
case GAPROLE_ERROR: // Error occurred - invalid state
headstage_led_color(COLOR_RED);
headstage_led_spi_color(COLOR_RED);
break;
case GAPROLE_INIT: // Waiting to be started
case GAPROLE_ADVERTISING: // Currently Advertising
@@ -1,289 +0,0 @@
/******************************************************************************
@file main.c
@brief main entry of the BLE stack sample application.
Group: WCS, BTS
Target Device: CC2650, CC2640
******************************************************************************
Copyright (c) 2013-2018, Texas Instruments Incorporated
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Texas Instruments Incorporated nor the names of
its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************************************************************
Release Name: ble_sdk_2_02_02_25
Release Date: 2018-04-02 18:03:35
*****************************************************************************/
/*******************************************************************************
* INCLUDES
*/
#include <xdc/runtime/Error.h>
#include <ti/drivers/Power.h>
#include <ti/drivers/power/PowerCC26XX.h>
#include <ti/sysbios/BIOS.h>
#include "icall.h"
#include "hal_assert.h"
#include "central.h"
#include "simple_central.h"
/* Header files required to enable instruction fetch cache */
#include <inc/hw_memmap.h>
#include <driverlib/vims.h>
#ifndef USE_DEFAULT_USER_CFG
#include "ble_user_config.h"
// BLE user defined configuration
bleUserCfg_t user0Cfg = BLE_USER_CFG;
#endif // USE_DEFAULT_USER_CFG
#include <ti/mw/display/Display.h>
#ifdef USE_FPGA
#include <inc/hw_prcm.h>
#endif // USE_FPGA
/*******************************************************************************
* MACROS
*/
/*******************************************************************************
* CONSTANTS
*/
#if defined( USE_FPGA )
#define RFC_MODE_BLE PRCM_RFCMODESEL_CURR_MODE1
#define RFC_MODE_ANT PRCM_RFCMODESEL_CURR_MODE4
#define RFC_MODE_EVERYTHING_BUT_ANT PRCM_RFCMODESEL_CURR_MODE5
#define RFC_MODE_EVERYTHING PRCM_RFCMODESEL_CURR_MODE6
//
#define SET_RFC_BLE_MODE(mode) HWREG( PRCM_BASE + PRCM_O_RFCMODESEL ) = (mode)
#endif // USE_FPGA
/*******************************************************************************
* TYPEDEFS
*/
/*******************************************************************************
* LOCAL VARIABLES
*/
/*******************************************************************************
* GLOBAL VARIABLES
*/
/*******************************************************************************
* EXTERNS
*/
extern void AssertHandler(uint8 assertCause, uint8 assertSubcause);
extern Display_Handle dispHandle;
/*******************************************************************************
* @fn Main
*
* @brief Application Main
*
* input parameters
*
* @param None.
*
* output parameters
*
* @param None.
*
* @return None.
*/
int main()
{
#if defined( USE_FPGA )
HWREG(PRCM_BASE + PRCM_O_PDCTL0) &= ~PRCM_PDCTL0_RFC_ON;
HWREG(PRCM_BASE + PRCM_O_PDCTL1) &= ~PRCM_PDCTL1_RFC_ON;
#endif // USE_FPGA
/* Register Application callback to trap asserts raised in the Stack */
RegisterAssertCback(AssertHandler);
PIN_init(BoardGpioInitTable);
#if defined( USE_FPGA )
// set RFC mode to support BLE
// Note: This must be done before the RF Core is released from reset!
SET_RFC_BLE_MODE(RFC_MODE_BLE);
#endif // USE_FPGA
// Enable iCache prefetching
VIMSConfigure(VIMS_BASE, TRUE, TRUE);
// Enable cache
VIMSModeSet(VIMS_BASE, VIMS_MODE_ENABLED);
#if !defined( POWER_SAVING ) || defined( USE_FPGA )
/* Set constraints for Standby, powerdown and idle mode */
// PowerCC26XX_SB_DISALLOW may be redundant
Power_setConstraint(PowerCC26XX_SB_DISALLOW);
Power_setConstraint(PowerCC26XX_IDLE_PD_DISALLOW);
#endif // POWER_SAVING | USE_FPGA
/* Initialize ICall module */
ICall_init();
/* Start tasks of external images - Priority 5 */
ICall_createRemoteTasks();
/* Kick off profile - Priority 3 */
GAPCentralRole_createTask();
/* Kick off application - Priority 1 */
SimpleBLECentral_createTask();
/* enable interrupts and start SYS/BIOS */
BIOS_start();
return 0;
}
/*******************************************************************************
* @fn AssertHandler
*
* @brief This is the Application's callback handler for asserts raised
* in the stack. When EXT_HAL_ASSERT is defined in the Stack
* project this function will be called when an assert is raised,
* and can be used to observe or trap a violation from expected
* behavior.
*
* As an example, for Heap allocation failures the Stack will raise
* HAL_ASSERT_CAUSE_OUT_OF_MEMORY as the assertCause and
* HAL_ASSERT_SUBCAUSE_NONE as the assertSubcause. An application
* developer could trap any malloc failure on the stack by calling
* HAL_ASSERT_SPINLOCK under the matching case.
*
* An application developer is encouraged to extend this function
* for use by their own application. To do this, add hal_assert.c
* to your project workspace, the path to hal_assert.h (this can
* be found on the stack side). Asserts are raised by including
* hal_assert.h and using macro HAL_ASSERT(cause) to raise an
* assert with argument assertCause. the assertSubcause may be
* optionally set by macro HAL_ASSERT_SET_SUBCAUSE(subCause) prior
* to asserting the cause it describes. More information is
* available in hal_assert.h.
*
* input parameters
*
* @param assertCause - Assert cause as defined in hal_assert.h.
* @param assertSubcause - Optional assert subcause (see hal_assert.h).
*
* output parameters
*
* @param None.
*
* @return None.
*/
void AssertHandler(uint8 assertCause, uint8 assertSubcause)
{
// Open the display if the app has not already done so
if ( !dispHandle )
{
dispHandle = Display_open(Display_Type_LCD, NULL);
}
Display_print0(dispHandle, 0, 0, ">>>STACK ASSERT");
// check the assert cause
switch (assertCause)
{
case HAL_ASSERT_CAUSE_OUT_OF_MEMORY:
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> OUT OF MEMORY!");
break;
case HAL_ASSERT_CAUSE_INTERNAL_ERROR:
// check the subcause
if (assertSubcause == HAL_ASSERT_SUBCAUSE_FW_INERNAL_ERROR)
{
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> INTERNAL FW ERROR!");
}
else
{
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> INTERNAL ERROR!");
}
break;
case HAL_ASSERT_CAUSE_ICALL_ABORT:
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> ICALL ABORT!");
HAL_ASSERT_SPINLOCK;
break;
default:
Display_print0(dispHandle, 0, 0, "***ERROR***");
Display_print0(dispHandle, 2, 0, ">> DEFAULT SPINLOCK!");
HAL_ASSERT_SPINLOCK;
}
return;
}
/*******************************************************************************
* @fn smallErrorHook
*
* @brief Error handler to be hooked into TI-RTOS.
*
* input parameters
*
* @param eb - Pointer to Error Block.
*
* output parameters
*
* @param None.
*
* @return None.
*/
void smallErrorHook(Error_Block *eb)
{
for (;;);
}
/*******************************************************************************
*/
@@ -1,120 +0,0 @@
/******************************************************************************
@file main.c
@brief main entry of the BLE stack sample application.
Group: WCS, BTS
Target Device: CC2650, CC2640
******************************************************************************
Copyright (c) 2013-2018, Texas Instruments Incorporated
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Texas Instruments Incorporated nor the names of
its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************************************************************
Release Name: ble_sdk_2_02_02_25
Release Date: 2018-04-02 18:03:35
*****************************************************************************/
/*================
==== include ====
===============*/
// clang-format off
#include <xdc/runtime/Error.h>
#include <ti/drivers/PIN.h>
#include <ti/drivers/Power.h>
#include <ti/drivers/power/PowerCC26XX.h>
#include <ti/sysbios/BIOS.h>
#include "icall.h"
#include "bcomdef.h"
#include "peripheral.h"
#include "simple_peripheral.h"
/* Header files required to enable instruction fetch cache */
#include <inc/hw_memmap.h>
#include <driverlib/vims.h>
// clang-format on
#ifndef USE_DEFAULT_USER_CFG
#include "ble_user_config.h"
// BLE user defined configuration
bleUserCfg_t user0Cfg = BLE_USER_CFG;
#endif // USE_DEFAULT_USER_CFG
extern const PIN_Config BoardGpioInitTable[];
/**
* @fn Main
*
* @brief Application Main
*
* input parameters
*
* @param None.
*
* output parameters
*
* @param None.
*
* @return None.
*/
int main() {
PIN_init(BoardGpioInitTable);
// Enable iCache prefetching
VIMSConfigure(VIMS_BASE, TRUE, TRUE);
// Enable cache
VIMSModeSet(VIMS_BASE, VIMS_MODE_ENABLED);
/* Initialize ICall module */
ICall_init();
/* Start tasks of external images - Priority 5 */
ICall_createRemoteTasks();
/* Kick off profile - Priority 3 */
GAPRole_createTask();
SimpleBLEPeripheral_createTask();
/* enable interrupts and start SYS/BIOS */
BIOS_start();
return 0;
}
@@ -82,10 +82,9 @@ extern "C" {
// Length of Characteristic 5 in bytes
#define SIMPLEPROFILE_CHAR1_LEN 2
#define SIMPLEPROFILE_CHAR2_LEN 50
#define SIMPLEPROFILE_CHAR2_LEN 10
#define SIMPLEPROFILE_CHAR3_LEN 20
#define SIMPLEPROFILE_CHAR4_LEN 200
//#define SIMPLEPROFILE_CHAR4_LEN 20
#define SIMPLEPROFILE_CHAR5_LEN 20
/*********************************************************************
-68
View File
@@ -1,68 +0,0 @@
#!/bin/bash
folder=$(basename "$(pwd)")
if [ "$folder" == "bioprocc2650" ]; then
input="./Neulive_sti_cali.txt"
output="./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_cali_sti.h"
#variable
declare -i current_line=96
declare -i col_index=0
declare -i row_index=0
#constant
declare -i COL_MAX=8
declare -i START_ROW=27
declare -i UN_USED_ROW=$START_ROW-1
MAC="MAC"
while read -r line; do
for word in $line; do
# get device MAC
if [ $row_index -gt $UN_USED_ROW ] && [ $col_index -eq 3 ];then
MAC=$word
sed -i "${current_line} i \\\n#elif defined(BOARD_${MAC})\\n{" "$output"
sed -i 's/:/_/g' "$output"
current_line=$current_line+3
fi
# get device positive channel coeff and offset
if [ $row_index -gt $UN_USED_ROW ] && [ $col_index -eq 4 ];then
sed -i "${current_line} i \ .p_ch.coefficient = $word," "$output"
current_line=$current_line+1
fi
if [ $row_index -gt $UN_USED_ROW ] && [ $col_index -eq 5 ];then
sed -i "${current_line} i \ .p_ch.offset = $word," "$output"
current_line=$current_line+1
fi
# get device negative channel coeff and offset
if [ $row_index -gt $UN_USED_ROW ] && [ $col_index -eq 6 ];then
sed -i "${current_line} i \ .n_ch.coefficient = $word," "$output"
current_line=$current_line+1
fi
if [ $row_index -gt $UN_USED_ROW ] && [ $col_index -eq 7 ];then
sed -i "${current_line} i \ .n_ch.offset = $word" "$output"
current_line=$current_line+1
sed -i "${current_line} i };" "$output"
current_line=$current_line+1
fi
#update index
if [ $col_index -lt $COL_MAX ];then
col_index=$col_index+1
else
col_index=0
row_index=$row_index+1
fi
done
done < $input
else
echo "This script should be executed on CC2650 periperal only"
fi