Compare commits

..

19 Commits

Author SHA1 Message Date
weiting2 63a9211c53 check SLK speed 2020-01-06 17:06:09 +08:00
weiting2 258fefe880 check SLK speed 2020-01-06 16:57:42 +08:00
weiting2 b449b655e5 Merge remote-tracking branch 'origin/Neulive13_YC' into Neulive13_YC 2020-01-06 16:44:29 +08:00
weiting2 e0a77dd9c4 check SLK speed 2020-01-06 16:44:20 +08:00
yichin 23ed9e9d16 error fix 2020-01-06 11:28:28 +08:00
yichin 0efafa937f error fix 2020-01-05 18:46:10 +08:00
weiting2 7a875a02fb calibration 2020-01-05 16:28:56 +08:00
yichin 77faf1acea error fix 2020-01-04 18:22:35 +08:00
yichin 3ebcbdfb0b error fix 2020-01-04 17:51:15 +08:00
yichin 6d6377d08d error fix 2020-01-04 17:48:35 +08:00
yichin d6b354feb4 error fix 2020-01-04 17:32:46 +08:00
yichin a70288dc7a error fix 2020-01-04 17:31:38 +08:00
weiting2 0d0a0f4a15 calibration 2020-01-04 16:53:43 +08:00
yichin 5eac1ef10f error fix 2020-01-04 16:45:13 +08:00
yichin 6de31449d4 error fix 2020-01-04 16:32:24 +08:00
weiting2 f720936120 calibration 2020-01-04 16:13:44 +08:00
weiting2 b54013fa1a calibration 2020-01-04 16:03:48 +08:00
weiting2 41698b297a calibration 2020-01-04 15:38:49 +08:00
weiting2 a11d782174 calibration 2020-01-04 15:28:21 +08:00
22 changed files with 619 additions and 1046 deletions
-33
View File
@@ -1,33 +0,0 @@
#!/bin/bash
year=$(date +%y)
month=$(date +%m)
day=$(date +%d)
hour=$(date +%H)
minute=$(date +%M)
hash=$(git rev-parse 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
#cat ./simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_version.h
@@ -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.497144271"
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.1156243080">
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.968804759"
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.1166840858"
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.914430745"
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.887436796"
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.977535427"
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.1719478128"
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.1506675875"
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.1420561111"
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.748856500"
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.798580442"
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.1547490138"
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.2024638456"
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.800973920"
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.1308530305"
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.799594274"
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.112950855"
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.392372778"
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.693593882"
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.2033778095"
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.1058327200"
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.1188480432"
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.2073227177"
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.1705098575"
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.829710362"
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.88338962"
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.856150648"
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.1156243080"
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.783257448"
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.1447359388"
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.818412493"
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.1142670741"
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.1383775664"
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.1447685687"
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.1245575978"
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.1843848040"
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.1091628589"
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.1864640500"
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.886757687"
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.204247319"
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.818411160"
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.472158428"
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.1632580884"
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"
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"
<tool id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.895448319" name="ARM Hex Utility"
superClass="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex">
<option id="com.ti.ccstudio.buildDefinitions.TMS470_18.1.hex.ROMWIDTH.145980841"
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.1226845009"
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.683766146"
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.1496154316" 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.310926378"
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.2021491136"
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.2076581956"
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.1123025537"
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.2022363573"
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.1609854343"
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.1277242683"
superClass="com.ti.rtsc.buildDefinitions.XDC_3.16.tool.COMPILE_OPTIONS"
value="&quot;${COMPILER_FLAGS}&quot;" valueType="string"/>
</tool>
@@ -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
@@ -193,8 +193,6 @@ extern ICall_Semaphore semaphore;
#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
@@ -318,7 +316,7 @@ typedef struct {
==== device implement implement header ====
=========================================*/
#include "headstage_neu.h"
#include "headstage_uni.h"
/*!
* main function
@@ -0,0 +1,50 @@
#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;
uint16_t Gain = CaliTable.Ch[ch].Gain[gain];
int16_t Offset = CaliTable.Ch[ch].Offset[gain];
raw = (DataBuf[1] & 0x0f) << 6 | (DataBuf[2] & 0xFC) >> 2;
// ret = 1000 * (raw-512)/Gain + 512000 - 1000*1000*Offset / Gain;
// ret = ret / 1000;
// ret = ret * 2;
// ret = 1000 * (ret - CaliTable.Ch[ch].Offset[gain]) / CaliTable.Ch[ch].Gain[gain];
ret = ((raw - 512)*2) + 512;
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
@@ -1,87 +0,0 @@
#ifndef NEU_INSTRUCTION
#define NEU_INSTRUCTION
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. */
uint8_t vgrp;
uint8_t vgrn;
uint8_t vgr_int_old;
uint8_t vgr_intp;
uint8_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 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 {
uint8_t state;
uint8_t config_type;
uint8_t index;
} NEULIVE_STATE = {0};
#endif
@@ -192,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
@@ -44,31 +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
#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);
//#endif
#endif
}
#endif // HEADSTAGE_NOTIFY_H
@@ -123,9 +123,6 @@
#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"
/************************************
* instruction building macro
@@ -855,17 +852,6 @@ 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;
SimpleProfile_SetParameter(BLE_CDR_BUFF_CHAR, BLE_CDR_BUFF_SIZE, cdr_buf);
break;
}
default: {
cdr_buf[0] = _B_4b4b(cis_oper, CHIP_ID);
cdr_buf[1] = _B_4b4b(CDR_FAILURE, 0);
@@ -898,14 +884,9 @@ static void headstage_uni_umc_data_append_notify_buffer(uint8_t* dat_buf) {
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);
// 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;
}
uint8_t channel;
@@ -917,7 +898,7 @@ static void headstage_uni_umc_data_append_notify_buffer(uint8_t* dat_buf) {
channel = reverse_channel[INSTRUCTION.channel_mux[channel_pointer]];
INSTRUCTION.channel_pointer = channel_pointer;
}
uint8_t data_size = headstage_notify_append_data(channel, dat_buf);
uint8_t data_size = headstage_notify_append_data(channel, dat_buf, INSTRUCTION.amp_gain);
if (data_size >= BLE_NOT_BUFF_SIZE) {
headstage_notify_flip_buffer();
headstage_notify_send();
@@ -1171,6 +1152,7 @@ static void headstage_umc_state_transfer_lsk() {
}
break;
case UMC_STATE_TRIGGER:
headstage_led_spi_color(COLOR_GREEN);
headstage_uni_umc_data_append_notify_buffer(spi_rxbuf);
break;
@@ -1,15 +0,0 @@
#ifndef VERSION_DATE
#define VERSION_DATE
#define VERSION_DATE_YEAR 20
#define VERSION_DATE_MONTH 02
#define VERSION_DATE_DAY 24
#define VERSION_DATE_HOUR 17
#define VERSION_DATE_MINUTE 58
// this is NOT the version hash !!
// it's the last version hash
#define VERSION_HASH a774a98ea462e2422a7c1793dc9cb68c4de7e948
#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,96 +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();
// SPI buffer reset
for(int i=0 ; i<SPI_BUFFER_SIZE ; i++ ){
spi_txbuf[i] = 0;
spi_rxbuf[i] = 0;
}
SPICallBack = ONE_SHOT_SPI;
// FlushSPICounter = 0;
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_BUFF_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;
headstage_led_color(COLOR_GREEN); // color green
}
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] = 1;
INSTRUCTION.sti_t2[1] = 0;
INSTRUCTION.sti_t3[1] = 0;
INSTRUCTION.sti_t4[1] = 0;
INSTRUCTION.sti_t5[1] = 0;
INSTRUCTION.sti_channel = 2;
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 = 2;
INSTRUCTION.sti_amplitude_h = 0;
INSTRUCTION.sti_amplitude_l = 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 = 0;
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};
@@ -22,7 +22,6 @@ static SPI_Handle headstage_spi_handle = NULL;
static SPI_Transaction headstage_spi_transaction;
static void headstage_spi_callback(SPI_Handle handle, SPI_Transaction* transaction);
static bool OpenSPI = false;
// SPI parameters initialize
#define headstage_spi_open() \
@@ -39,14 +38,14 @@ static bool OpenSPI = false;
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) \
({ \
@@ -71,54 +70,4 @@ static bool OpenSPI = false;
} \
} 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
@@ -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,12 @@ 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);
// data = Calibration(data_value, channel, gain);
// data = (data_value[1] & 0x0F) << 6 | (data_value[2] & 0xFC) >>2;
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
@@ -407,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);
}
@@ -509,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++ = 11;
*p++ = 15;
*p++ = GAP_ADTYPE_MANUFACTURER_SPECIFIC;
// unsafe_memcpy(p, "BPHS", 4);
*p++ = 'B';
@@ -522,6 +520,11 @@ static void headstage_init_device_info() {
*p++ = MINOR_VERSION_NUMBER;
*p++ = year;
*p++ = month;
*p++ = 'B';
*p++ = 'A';
*p++ = 'T';
*p++ = headstage_battery_percent();
GGS_SetParameter(GGS_DEVICE_NAME_ATT, sizeof(DEVICE_NAME), DEVICE_NAME);
@@ -825,7 +828,7 @@ static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState)
GAPRole_GetParameter(GAPROLE_CONNHANDLE, &cxnHandle);
if (SUCCESS == HCI_LE_SetDataLenCmd(cxnHandle, requestedPDUSize, requestTxTime)) {
headstage_led_color(COLOR_CYAN);
headstage_led_spi_color(COLOR_CYAN);
}
// Use numActive to determine the connection handle of the last
// connection
@@ -846,12 +849,12 @@ static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState)
// Device just timed out from a connection but is not yet advertising, is in waiting period before advertising again
// disconnected
SimpleBLEPeripheral_freeAttRsp(bleNotConnected);
headstage_led_color(COLOR_RED);
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);
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
@@ -85,7 +85,6 @@ extern "C" {
#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
/*********************************************************************