Compare commits

...

66 Commits

Author SHA1 Message Date
weiting2 9f33098b52 update rec cali data 2021-01-21 17:39:55 +08:00
weiting2 dd9f64662e update rec cali data 2021-01-21 17:32:06 +08:00
weiting2 a80ab9a72f E7DA special version, update cali and its formula 2021-01-21 17:14:12 +08:00
weiting2 a348b9553d [bug] "rec+sti" mode will stop read spi sometime 2020-12-22 18:26:10 +08:00
weiting2 2937fa6a11 [bug] "rec+sti" mode will stop read spi sometime 2020-12-22 18:15:36 +08:00
weiting2 4a973421df there are bug if "start all -> stop all -> start rec" 2020-12-22 09:55:22 +08:00
weiting2 521e241978 change led and enable rec after limit sti end 2020-12-18 18:09:40 +08:00
weiting2 d1ba348ea0 fast set do not reset sti now 2020-12-11 11:36:55 +08:00
weiting2 8686220e28 do not check sti in limit mode; resend rec ch when press "start rec" 2020-12-10 19:18:05 +08:00
weiting2 91e62474d1 idle state pull low MISO; send three time ins to close sti 2020-12-10 17:30:28 +08:00
weiting2 734da9a27e correct start rec bug; should be test: sti turn on/off correctly? 2020-12-10 13:58:48 +08:00
weiting2 bd48ac8d49 should be test: sti turn on/off correctly? 2020-12-09 17:07:15 +08:00
weiting2 9f68a07d31 attempt to fix sti start/stop failed issue 2020-12-09 16:41:51 +08:00
weiting2 87cac38444 fix central on_change bug 2020-11-30 11:31:10 +08:00
weiting2 7f163e85c3 special version for E7DA, E6EA 2020-11-27 18:11:56 +08:00
weiting2 7880fce151 special version for E7DA, E6EA 2020-11-25 14:06:16 +08:00
weiting2 abf67f5dd4 [stable] sti_amp with init value 2020-11-24 18:28:15 +08:00
weiting2 cf9766c786 [stable] better current cali; "start sti" no bug 2020-11-24 17:59:36 +08:00
weiting2 7063a2460a update E7DA, E6EA sti cali data 2020-11-23 14:25:16 +08:00
weiting2 11a6389a83 neulive without sti frequency on change 2020-11-16 14:48:21 +08:00
weiting2 9dde948902 Merge branch 'neulive_onchange_central_debug' into neulive20_development_onchange_central
# Conflicts:
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_dbs_object.h
#	simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage/headstage_version.h
2020-11-16 14:47:11 +08:00
weiting2 9209d9dff7 neulive without sti frequency on change 2020-11-16 14:44:17 +08:00
weiting2 acd0080929 sti_clk ratio should be system register 2020-11-13 18:30:41 +08:00
weiting2 8ae43d0628 sti_clk ratio should be system register 2020-11-13 16:06:21 +08:00
weiting2 1cde4cfe02 update sti_cali data 2020-10-26 17:03:38 +08:00
weiting2 764bd9364d amp_gain does not on change 2020-10-13 18:09:20 +08:00
weiting2 b5e0026f2e amp_gain does not on change 2020-10-13 18:09:09 +08:00
weiting2 823016d4b7 support fast settle now 2020-09-25 18:36:10 +08:00
weiting2 bee57486e0 support fast settle now 2020-09-25 18:35:55 +08:00
weiting2 214222cb1e TODO: support fast settle 2020-09-25 17:48:52 +08:00
weiting2 38572e128d increase data throughput by modify notify format 2020-09-25 16:37:27 +08:00
weiting2 9e19642081 increase data throughput by modify notify format 2020-09-25 15:57:41 +08:00
weiting2 5f2a258f49 increase data throughput by modify notify format 2020-09-25 11:56:25 +08:00
weiting2 d5158775b8 [semi-stable] TODO: increase data throughput by modify notify format 2020-09-25 11:46:16 +08:00
weiting2 282b8077a7 update central 2020-09-18 20:21:15 +08:00
weiting2 5b6430cec9 update central 2020-09-18 18:13:00 +08:00
weiting2 9484008d1e update central 2020-09-18 18:09:28 +08:00
weiting2 bd0c282d25 using central feature CIS 2020-09-16 15:26:26 +08:00
weiting2 acd590de44 sti on change is done; TODO: disable sti before every on change 2020-09-16 10:59:22 +08:00
weiting2 b8d96c32b0 sti on change is done; TODO: disable sti before every on change 2020-09-15 17:41:46 +08:00
weiting2 c3ab78e16a sti on change has some bug 2020-09-14 17:21:30 +08:00
weiting2 fde824ee34 sti on change has some bug 2020-09-14 12:54:23 +08:00
weiting2 fc3adb450c sti on change has some bug 2020-09-14 11:10:42 +08:00
weiting2 747752640a sti on change has some bug 2020-09-14 09:55:26 +08:00
weiting2 7a73097666 add sti, stop, ... etc function 2020-09-10 18:41:29 +08:00
weiting2 8a95874b0b "on change" can work; TODO: add sti, stop, ... etc function 2020-09-09 17:01:35 +08:00
weiting2 9db0984a92 attempt to support "on change" for every register 2020-09-09 10:26:13 +08:00
weiting2 b9c9cc0bbc attempt to support "on change" for every register 2020-09-08 18:06:17 +08:00
weiting2 cd44c2ecaa attempt to support "on change" for every register 2020-09-08 17:47:12 +08:00
weiting2 3bb5cee129 attempt to support "on change" for every register 2020-09-08 17:42:08 +08:00
weiting2 2480d7775f attempt to support "on change" for every register 2020-09-08 17:19:13 +08:00
weiting2 3b9e972397 attempt to support "on change" for every register 2020-09-04 16:28:34 +08:00
weiting2 36df3abed1 attempt to support "on change" for every register 2020-09-02 19:19:05 +08:00
weiting2 918584c915 attempt to support "on change" for every register 2020-09-02 17:16:00 +08:00
weiting2 cc0a21c364 attempt to support "on change" for every register 2020-09-02 11:56:12 +08:00
weiting2 388c06efe7 attempt to support "on change" for every register 2020-08-31 16:35:12 +08:00
weiting2 8bcb4cd27e attempt to support "on change" for every register 2020-08-31 11:34:45 +08:00
weiting2 5d88871e58 attempt to support "on change" for every register 2020-08-28 18:25:02 +08:00
weiting2 8635b1b878 attempt to support "on change" for every register 2020-08-28 18:24:56 +08:00
weiting2 6e9acfda78 [on sell] modify get_date script for linux version CCS 2020-07-20 17:48:14 +08:00
weiting2 81d5d86890 [on sell] TODO: modify get_date script for linux version CCS 2020-07-20 17:42:35 +08:00
weiting2 0c8c92dc83 [on sell] TODO: modify get_date script for linux version CCS 2020-07-20 17:17:50 +08:00
weiting2 308de54833 Merge remote-tracking branch 'origin/Neulive20_developement_linux' into Neulive20_developement_linux 2020-07-20 17:17:34 +08:00
weiting2 e4c999b8c7 [on sell] TODO: modify get_date script for linux version CCS 2020-07-20 17:17:22 +08:00
weiting2 5c0c2cc9a5 [WARNING] do NOT use linux version CCS on simple central.
DLE can not enable on linux CCS
2020-07-20 16:12:17 +08:00
weiting2 127b5ff4ca linux version CCS 2020-07-15 17:56:53 +08:00
41 changed files with 1238 additions and 397 deletions
+3 -3
View File
@@ -8,7 +8,7 @@ no device y=ax+b MAC a+ b+ a- b- avg
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
10 8b50 8b50 00:81:F9:E4:8B:50 2366 -5223 2402 -14971 4.35162291666667
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
@@ -16,8 +16,8 @@ no device y=ax+b MAC a+ b+ a- b- avg
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
18 E7DA E7DA A4:DA:32:D4:E7:DA 2096 -10653 2054 -14255 3.73011080492424
19 E6EA E6EA A4:DA:32:D4:E6:EA 2074 -13075 2031 -13585 3.77641447962488
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
+1 -1
View File
@@ -4,7 +4,7 @@
#folder=$($path | awk -F"/" '{$NF}')
folder=$(basename "$(pwd)")
if [ "$folder" == "bioprocc2650" ]; then
if [ "$folder" == "ti" ] ; then
year=$(date +%-y)
month=$(date +%-m)
day=$(date +%-d)
@@ -3,6 +3,6 @@
* step by the lib_search utility
*/
"C:\ti\simplelink\ble_sdk_2_02_02_25\blelib\host\host_pxxx.a"
"C:\ti\simplelink\ble_sdk_2_02_02_25\blelib\ctrl\cc2640\cc2640_ctrl_pxxx_ext.a"
"C:\ti\simplelink\ble_sdk_2_02_02_25\blelib\hci_tl\cc26xx\cc26xx_hci_tl_none_v41_v42.a"
"/home/alan/ti/simplelink/ble_sdk_2_02_02_25/blelib/host/host_pxxx.a"
"/home/alan/ti/simplelink/ble_sdk_2_02_02_25/blelib/ctrl/cc2640/cc2640_ctrl_pxxx_ext.a"
"/home/alan/ti/simplelink/ble_sdk_2_02_02_25/blelib/hci_tl/cc26xx/cc26xx_hci_tl_none_v41_v42.a"
@@ -1,6 +1,6 @@
#
# This file was generated based on the configuration script:
# C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\config\app_ble.cfg
# /home/alan/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/config/app_ble.cfg
#
# This makefile may be included in other makefiles that need to build
# the libraries containing the compiled source files generated as
@@ -14,9 +14,9 @@
#
# The absolute path to the generated source directory (at the time the
# sources were generated) is:
# C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\config\src
# /home/alan/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/config/src
#
GEN_SRC_DIR ?= ../../config/src
GEN_SRC_DIR ?= ../../../ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/config/src
ifeq (,$(wildcard $(GEN_SRC_DIR)))
$(error "ERROR: GEN_SRC_DIR must be set to the directory containing the generated sources")
@@ -1,29 +1,29 @@
XOPTS = -I"C:/ti/xdctools_3_32_02_25_core/packages/" -Dxdc_target_types__=C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/std.h -Dxdc_target_name__=M3
XOPTS = -I"/home/alan/ti/xdctools_3_32_01_22_core/packages/" -Dxdc_target_types__=/home/alan/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/std.h -Dxdc_target_name__=M3
vpath % C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/sysbios/
vpath %.c C:/ti/xdctools_3_32_02_25_core/packages/
vpath % /home/alan/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/sysbios/
vpath %.c /home/alan/ti/xdctools_3_32_01_22_core/packages/
CCOPTS = --endian=little -mv7M3 --abi=eabi -q -ms --opt_for_speed=0 --program_level_compile -o3 -g --optimize_with_debug -Dti_sysbios_knl_Task_minimizeLatency__D=FALSE -Dti_sysbios_family_arm_cc26xx_Boot_driverlibVersion=2 -Dti_sysbios_knl_Clock_stopCheckNext__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_enableException__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_disablePriority__D=32U -Dti_sysbios_family_arm_m3_Hwi_numSparseInterrupts__D=0U
XDC_ROOT = C:/ti/xdctools_3_32_02_25_core/packages/
XDC_ROOT = /home/alan/ti/xdctools_3_32_01_22_core/packages/
BIOS_ROOT = C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/sysbios/
BIOS_ROOT = /home/alan/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/sysbios/
BIOS_DEFS = -Dti_sysbios_BIOS_swiEnabled__D=TRUE -Dti_sysbios_BIOS_taskEnabled__D=TRUE -Dti_sysbios_BIOS_clockEnabled__D=TRUE -Dti_sysbios_BIOS_runtimeCreatesEnabled__D=TRUE -Dti_sysbios_knl_Task_moduleStateCheckFlag__D=FALSE -Dti_sysbios_knl_Task_objectCheckFlag__D=FALSE -Dti_sysbios_hal_Hwi_DISABLE_ALL_HOOKS -Dti_sysbios_knl_Swi_DISABLE_ALL_HOOKS -Dti_sysbios_BIOS_smpEnabled__D=FALSE -Dti_sysbios_Build_useHwiMacros -Dti_sysbios_knl_Swi_numPriorities__D=6 -Dti_sysbios_knl_Task_deleteTerminatedTasks__D=FALSE -Dti_sysbios_knl_Task_numPriorities__D=6 -Dti_sysbios_knl_Task_checkStackFlag__D=FALSE -Dti_sysbios_knl_Task_initStackFlag__D=TRUE -Dti_sysbios_knl_Task_DISABLE_ALL_HOOKS -Dti_sysbios_knl_Clock_TICK_SOURCE=ti_sysbios_knl_Clock_TickSource_TIMER -Dti_sysbios_knl_Clock_TICK_MODE=ti_sysbios_knl_Clock_TickMode_DYNAMIC -Dti_sysbios_hal_Core_delegate_getId=ti_sysbios_hal_CoreNull_getId__E -Dti_sysbios_hal_Core_delegate_interruptCore=ti_sysbios_hal_CoreNull_interruptCore__E -Dti_sysbios_hal_Core_delegate_lock=ti_sysbios_hal_CoreNull_lock__E -Dti_sysbios_hal_Core_delegate_unlock=ti_sysbios_hal_CoreNull_unlock__E -Dti_sysbios_hal_Core_numCores__D=1 -Dti_sysbios_hal_CoreNull_numCores__D=1 -Dti_sysbios_utils_Load_taskEnabled__D=TRUE -Dti_sysbios_utils_Load_swiEnabled__D=FALSE -Dti_sysbios_utils_Load_hwiEnabled__D=FALSE -Dti_sysbios_family_arm_m3_Hwi_dispatcherSwiSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherTaskSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherAutoNestingSupport__D=TRUE -Dti_sysbios_family_arm_m3_Hwi_dispatcherIrpTrackingSupport__D=TRUE -Dti_sysbios_knl_Semaphore_supportsEvents__D=FALSE -Dti_sysbios_knl_Semaphore_supportsPriority__D=FALSE -Dxdc_runtime_Assert_DISABLE_ALL -Dxdc_runtime_Log_DISABLE_ALL
BIOS_INC = -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/"
BIOS_INC = -I"/home/alan/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/"
TARGET_INC = -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/"
TARGET_INC = -I"/home/alan/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/"
INCS = $(BIOS_INC) $(TARGET_INC) --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.5.LTS/include" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/icall/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/dev_info" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/common/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/heapmgr" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/controller/cc26xx/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/target" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/cc26xx" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/sdata" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/saddr" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/components/icall/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/inc" --include_path="C:/ti/simplelink/ble_sdk_2_02_02_25/src/rom" --include_path="C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272" -IC:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/
INCS = $(BIOS_INC) $(TARGET_INC) --include_path="/home/alan/ti/ccs900/ccs/tools/compiler/ti-cgt-arm_20.2.1.LTS/include" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/inc" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/icall/inc" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles/cc26xx" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/dev_info" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile/cc26xx" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/common/cc26xx" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/components/heapmgr" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/controller/cc26xx/inc" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/target" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/cc26xx" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/sdata" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/saddr" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/components/icall/src/inc" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/inc" --include_path="/home/alan/ti/simplelink/ble_sdk_2_02_02_25/src/rom" --include_path="/home/alan/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272" -I/home/alan/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/
CC = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.5.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.5.LTS/include
ASM = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.5.LTS/bin/armcl -c $(CCOPTS) -I C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.5.LTS/include
AR = C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.5.LTS/bin/armar rq
CC = /home/alan/ti/ccs900/ccs/tools/compiler/ti-cgt-arm_20.2.1.LTS/bin/armcl -c $(CCOPTS) -I /home/alan/ti/ccs900/ccs/tools/compiler/ti-cgt-arm_20.2.1.LTS/include
ASM = /home/alan/ti/ccs900/ccs/tools/compiler/ti-cgt-arm_20.2.1.LTS/bin/armcl -c $(CCOPTS) -I /home/alan/ti/ccs900/ccs/tools/compiler/ti-cgt-arm_20.2.1.LTS/include
AR = /home/alan/ti/ccs900/ccs/tools/compiler/ti-cgt-arm_20.2.1.LTS/bin/armar rq
DEL = C:/ti/xdctools_3_32_02_25_core/packages/../bin/rm -f
CP = C:/ti/xdctools_3_32_02_25_core/packages/../bin/cp -f
DEL = rm -f
CP = cp -f
define RM
$(if $(wildcard $1),$(DEL) $1,:)
@@ -100,8 +100,8 @@ rom_sysbios.obj: BIOS.c knl/Clock.c knl/Idle.c knl/Intrinsics.c knl/Event.c knl/
rom_sysbios.aem3: rom_sysbios.obj m3_Hwi_asm.obj m3_Hwi_asm_switch.obj m3_IntrinsicsSupport_asm.obj m3_TaskSupport_asm.obj
@-$(call RM, $@)
@echo arem3 $^ ...
@$(AR) $@ $^ C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/sysbios/rom/cortexm/cc26xx/golden/CC26xx/rom_sysbios_config.obj
@$(AR) $@ $^ /home/alan/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/sysbios/rom/cortexm/cc26xx/golden/CC26xx/rom_sysbios_config.obj
clean:
@$(DEL) ..\makefile.libs
@$(DEL) ../makefile.libs
@-$(call RM, *)
@@ -106,7 +106,7 @@
*/
#ifdef USE_ICALL
#include <ICall.h>
#include <icall.h>
typedef ICall_CSState halIntState_t;
@@ -55,7 +55,7 @@
#include <inc/hw_aon_rtc.h>
#include <driverlib/aon_rtc.h>
#include <driverlib/aon_event.h>
#include "ICall.h"
#include "icall.h"
/*******************************************************************************
* MACROS
@@ -48,7 +48,7 @@
#include <stdint.h>
#include "ICall.h"
#include "icall.h"
#ifdef __cplusplus
extern "C" {
@@ -55,7 +55,7 @@ extern "C"
// includes
// ****************************************************************************
#include "hal_types.h"
#include "OSAL.h"
#include "osal.h"
// ****************************************************************************
// defines
@@ -75,7 +75,7 @@
#ifdef ICALL_JT
#include "icall_JT.h"
#else
#include <ICall.h>
#include <icall.h>
#endif /* ICALL_JT */
#endif /* USE_ICALL */
@@ -405,7 +405,7 @@ uint32 osal_build_uint32( uint8 *swapped, uint8 len )
unsigned char * _ltoa(unsigned long l, unsigned char *buf, unsigned char radix)
{
#if defined (__TI_COMPILER_VERSION) || defined (__TI_COMPILER_VERSION__)
return ( (unsigned char*)ltoa( l, (char *)buf ) );
return ( (unsigned char*)ltoa( l, (char *)buf, radix ) );
#elif defined( __GNUC__ )
return ( (char*)ltoa( l, buf, radix ) );
#else
@@ -47,8 +47,8 @@
Release Date: 2018-04-02 18:03:35
*****************************************************************************/
#include "OSAL.h"
#include "OSAL_Tasks.h"
#include "osal.h"
#include "osal_tasks.h"
#include "hal_mcu.h"
#include "osal_cbtimer.h"
@@ -51,13 +51,13 @@
*/
#include "comdef.h"
#include "OSAL.h"
#include "OSAL_Memory.h"
#include "osal.h"
#include "osal_memory.h"
#ifdef ICALL_JT
#include "icall_JT.h"
#else
#include <ICall.h>
#include <icall.h>
#endif /* ICALL_JT */
/**************************************************************************************************
@@ -59,7 +59,7 @@
#ifdef ICALL_JT
#include "icall_JT.h"
#else
#include <ICall.h>
#include <icall.h>
#endif /* ICALL_JT */
#endif /* USE_ICALL */
@@ -62,11 +62,11 @@ extern "C"
#include <limits.h>
#include "comdef.h"
#include "OSAL_Memory.h"
#include "OSAL_Timers.h"
#include "osal_memory.h"
#include "osal_timers.h"
#ifdef USE_ICALL
#include <ICall.h>
#include <icall.h>
#endif /* USE_ICALL */
/*********************************************************************
@@ -80,7 +80,7 @@ the last entry in the page (higher memory address).
#include "hal_flash.h"
#include "hal_types.h"
#include "pwrmon.h"
#include "OSAL.h"
#include "osal.h"
#include "osal_snv.h"
#include "hal_assert.h"
#include <driverlib/vims.h>
@@ -52,7 +52,7 @@
#include <inc/hw_fcfg1.h>
#include "Board.h"
#include "board.h"
// RF Driver
#include <ti/drivers/rf/RF.h>
@@ -102,8 +102,8 @@ typedef enum {
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
ONE_SHOT_FLUSH, // read DBS register value, used after a "read" SPI instruction (MISO)
CONTI_SPI_WITH_FLUSH, // end spi instruction
READ_MOSI
} SPI_CB_MODE;
@@ -119,6 +119,8 @@ static bool ConnectState = false;
static bool ErrorRestart = false;
static SPI_CB_MODE SPICallBack;
static uint8 adc_spi_en_switch = 1;
static bool rewrite_rec_en = false;
static bool rewrite_sti_en = false;
/*
* Let C = command, S = status;
@@ -214,7 +216,7 @@ 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
#define BLE_CDR_SMALL_SIZE 10
// instruction input characteristic
#define BLE_INS_BUFF_CHAR SIMPLEPROFILE_CHAR3
@@ -356,7 +358,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_SMALL_SIZE] = {0};
/*====================
==== event table ====
@@ -27,14 +27,14 @@ static void SendCaliValue(uint8_t CaliNumber){
// ch = 2 * (CaliNumber % 4);
// uint8_t gain_level = CaliNumber / 4; // 0:gain, 1:offset
uint8_t channel_number = 8, index = 1;
uint8_t channel_number = 8, index = 2;
uint8_t gain_level = 0;
if(CaliNumber < 4){
gain_level = CaliNumber;
}
cali_buf[0] = CHIP_ID;
cali_buf[1] = 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;
@@ -42,9 +42,8 @@ static void SendCaliValue(uint8_t CaliNumber){
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;
// }
cali_buf[0] = index - 1;
SimpleProfile_SetParameter(BLE_CDR_BUFF_CHAR, index, cali_buf);
}
@@ -192,18 +192,18 @@ struct _StiCaliStiTable{
#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
.p_ch.coefficient = 4834,
.p_ch.offset = -10653,
.n_ch.coefficient = 4628,
.n_ch.offset = -14255
};
#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
.p_ch.coefficient = 4980,
.p_ch.offset = -13075,
.n_ch.coefficient = 4660,
.n_ch.offset = -13585
};
#elif defined(BOARD_A4_DA_32_D4_EE_DB)
@@ -2,7 +2,7 @@
#ifndef NEU_CALI_TABLE
#define NEU_CALI_TABLE
#define BOARD_TEST
#define BOARD_A4_DA_32_D4_E7_DA
typedef struct _SingleChannelCali{
uint16_t Gain[4];
@@ -1673,70 +1673,70 @@ struct _CaliTable{
#elif defined(BOARD_A4_DA_32_D4_E7_DA)
{
.DeviceName = "BOARD_A4_DA_32_D4_E7_DA",
.Ch[0].Gain[0] = 49,
.Ch[0].Offset[0] = -13,
.Ch[1].Gain[0] = 49,
.Ch[0].Gain[0] = 48,
.Ch[0].Offset[0] = -14,
.Ch[1].Gain[0] = 48,
.Ch[1].Offset[0] = 26,
.Ch[2].Gain[0] = 49,
.Ch[2].Offset[0] = -14,
.Ch[3].Gain[0] = 49,
.Ch[2].Gain[0] = 48,
.Ch[2].Offset[0] = -15,
.Ch[3].Gain[0] = 48,
.Ch[3].Offset[0] = 17,
.Ch[4].Gain[0] = 49,
.Ch[4].Offset[0] = 5,
.Ch[5].Gain[0] = 49,
.Ch[5].Offset[0] = -2,
.Ch[6].Gain[0] = 47,
.Ch[6].Offset[0] = -8,
.Ch[7].Gain[0] = 47,
.Ch[7].Offset[0] = -11,
.Ch[0].Gain[1] = 359,
.Ch[0].Offset[1] = -54,
.Ch[1].Gain[1] = 359,
.Ch[4].Gain[0] = 48,
.Ch[4].Offset[0] = 4,
.Ch[5].Gain[0] = 48,
.Ch[5].Offset[0] = -3,
.Ch[6].Gain[0] = 46,
.Ch[6].Offset[0] = -9,
.Ch[7].Gain[0] = 46,
.Ch[7].Offset[0] = -12,
.Ch[0].Gain[1] = 354,
.Ch[0].Offset[1] = -55,
.Ch[1].Gain[1] = 355,
.Ch[1].Offset[1] = 230,
.Ch[2].Gain[1] = 362,
.Ch[2].Offset[1] = -70,
.Ch[3].Gain[1] = 361,
.Ch[3].Offset[1] = 164,
.Ch[4].Gain[1] = 361,
.Ch[4].Offset[1] = 72,
.Ch[5].Gain[1] = 360,
.Ch[2].Gain[1] = 356,
.Ch[2].Offset[1] = -71,
.Ch[3].Gain[1] = 355,
.Ch[3].Offset[1] = 163,
.Ch[4].Gain[1] = 356,
.Ch[4].Offset[1] = 73,
.Ch[5].Gain[1] = 355,
.Ch[5].Offset[1] = 22,
.Ch[6].Gain[1] = 345,
.Ch[6].Offset[1] = -23,
.Ch[7].Gain[1] = 345,
.Ch[7].Offset[1] = -39,
.Ch[0].Gain[2] = 1482,
.Ch[0].Offset[2] = -197,
.Ch[1].Gain[2] = 1372,
.Ch[1].Offset[2] = 946,
.Ch[2].Gain[2] = 1473,
.Ch[2].Offset[2] = -275,
.Ch[3].Gain[2] = 1443,
.Ch[3].Offset[2] = 686,
.Ch[4].Gain[2] = 1477,
.Ch[4].Offset[2] = 313,
.Ch[5].Gain[2] = 1479,
.Ch[5].Offset[2] = 104,
.Ch[6].Gain[2] = 1424,
.Ch[6].Offset[2] = -75,
.Ch[7].Gain[2] = 1436,
.Ch[6].Gain[1] = 336,
.Ch[6].Offset[1] = -21,
.Ch[7].Gain[1] = 335,
.Ch[7].Offset[1] = -37,
.Ch[0].Gain[2] = 1458,
.Ch[0].Offset[2] = -198,
.Ch[1].Gain[2] = 1347,
.Ch[1].Offset[2] = 944,
.Ch[2].Gain[2] = 1455,
.Ch[2].Offset[2] = -271,
.Ch[3].Gain[2] = 1423,
.Ch[3].Offset[2] = 677,
.Ch[4].Gain[2] = 1454,
.Ch[4].Offset[2] = 320,
.Ch[5].Gain[2] = 1454,
.Ch[5].Offset[2] = 106,
.Ch[6].Gain[2] = 1369,
.Ch[6].Offset[2] = -65,
.Ch[7].Gain[2] = 1381,
.Ch[7].Offset[2] = -134,
.Ch[0].Gain[3] = 2821,
.Ch[0].Offset[3] = -357,
.Ch[1].Gain[3] = 1262,
.Ch[1].Offset[3] = 1440,
.Ch[2].Gain[3] = 2746,
.Ch[2].Offset[3] = -506,
.Ch[3].Gain[3] = 1934,
.Ch[3].Offset[3] = 1131,
.Ch[4].Gain[3] = 2659,
.Ch[4].Offset[3] = 576,
.Ch[5].Gain[3] = 2873,
.Ch[5].Offset[3] = 212,
.Ch[6].Gain[3] = 2770,
.Ch[6].Offset[3] = -142,
.Ch[7].Gain[3] = 2764,
.Ch[7].Offset[3] = -239
.Ch[0].Gain[3] = 2775,
.Ch[0].Offset[3] = -362,
.Ch[1].Gain[3] = 1257,
.Ch[1].Offset[3] = 1442,
.Ch[2].Gain[3] = 2713,
.Ch[2].Offset[3] = -503,
.Ch[3].Gain[3] = 1929,
.Ch[3].Offset[3] = 1125,
.Ch[4].Gain[3] = 2621,
.Ch[4].Offset[3] = 580,
.Ch[5].Gain[3] = 2834,
.Ch[5].Offset[3] = 206,
.Ch[6].Gain[3] = 2698,
.Ch[6].Offset[3] = -115,
.Ch[7].Gain[3] = 2690,
.Ch[7].Offset[3] = -250
};
#elif defined(BOARD_A4_DA_32_D4_E6_EA)
@@ -27,7 +27,7 @@ static void check_register(uint8_t register_to_check, uint16_t instruction_to_fi
check_reg_counter = 0;
if(check_ins(instruction_to_fit)){
NEULIVE_STATE.state = next_state;
SPICallBack = ONE_SHOT_SPI;
SPICallBack = CONTI_SPI_WITH_FLUSH;
// update rec_sti_command
if(!(rec_sti_command & ENABLE_STI)){
@@ -70,7 +70,7 @@ static void check_register(uint8_t register_to_check, uint16_t instruction_to_fi
IsFirstData = true;
}
SPICallBack = ONE_SHOT_SPI;
SPICallBack = CONTI_SPI_WITH_FLUSH;
ReopenSPI();
}
headstage_spi_transaction(3);
@@ -167,7 +167,7 @@ static void check_sti_t1_t5(NEU_WORK_STATE next_state){
else{
NEULIVE_STATE.state = next_state;
}
SPICallBack = ONE_SHOT_SPI;
SPICallBack = CONTI_SPI_WITH_FLUSH;
headstage_spi_transaction(3);
}
@@ -0,0 +1,214 @@
#ifndef DBS_OBJECT_H
#define DBS_OBJECT_H
#include "neu/headstage_spi.h"
#define SYS_RESERVED_INDEX 0
#define SYS_GENERAL_ENABLE_INDEX 1
#define SYS_LNA_BIOS1_INDEX 2
#define SYS_LNA_BIOS2_INDEX 3
#define SYS_STI_CLK_RATIO_INDEX 4
#define REC_CHANNEL_INDEX 0
#define REC_GAIN_INDEX 1
#define REC_ADC_CLOCK_INDEX 2
#define STI_ENABLE_INDEX 0
#define STI_AMP_POS_INDEX 1
#define STI_AMP_NEG_INDEX 2
#define STI_POLARITY_INDEX 3
#define STI_CYCLE_CH01_INDEX 4
#define STI_CYCLE_CH23_INDEX 5
#define STI_CYCLE_CH45_INDEX 6
#define STI_CYCLE_CH67_INDEX 7
#define STI_CLK_RATIO_INDEX 8
#define STI_ARBITRARY_EN_INDEX 9
#define STI_MODE_INDEX 10
#define STI_DURATION0_INDEX 11
#define STI_DURATION1_INDEX 12
#define STI_DURATION2_INDEX 13
#define STI_DURATION3_INDEX 14
//#define DBS_REGISTER \
// uint8_t address; \
// void (*write_reg) (DBSRegister *self, uint32_t reg_value); \
// uint32_t (*read_reg) (DBSRegister *self)
typedef struct _DBSRegister{
uint8_t address;
bool WriteRegister, CheckRegister;
void (*write_reg) (uint8_t self_address, uint16_t reg_value);
void (*read_reg) (struct _DBSRegister *self);
}DBSRegister;
void write_reg(uint8_t self_address, uint16_t reg_value){
spi_txbuf[0] = 0x80 | self_address;
spi_txbuf[1] = (reg_value >> 8) & 0xFF ;
spi_txbuf[2] = reg_value & 0xFF;
// self->WriteRegister = false;
// self->CheckRegister = true;
SPICallBack = CONTI_SPI_WITH_FLUSH;
headstage_spi_transaction(SPI_BUFFER_SIZE);
}
void read_reg(DBSRegister *self){
spi_txbuf[0] = 0x7F & self->address;
spi_txbuf[1] = 0; // it's don't care actually
spi_txbuf[2] = 0; // it's don't care actually
SPICallBack = READ_REG;
headstage_spi_transaction(SPI_BUFFER_SIZE);
}
static uint16_t sys_register_default_value[5] = {
0x0000,
0x40F2,
0x0210,
0x4210,
0x0002
};
static uint16_t rec_register_value[3];
static uint16_t sti_register_value[43];
static uint16_t fast_settle_param[43];
static void init_fast_settle();
static DBSRegister sys_register[5];
static DBSRegister rec_register[3];
static DBSRegister sti_register[43];
static void InitSysRegister(){
sys_register[SYS_RESERVED_INDEX].address = 0x00;
sys_register[SYS_GENERAL_ENABLE_INDEX].address = 47; // general enable
sys_register[SYS_LNA_BIOS1_INDEX].address = 57;
sys_register[SYS_LNA_BIOS2_INDEX].address = 58;
sys_register[SYS_STI_CLK_RATIO_INDEX].address = 52;
for(int i=0 ; i<sizeof(sys_register)/sizeof(DBSRegister) ; i++){
sys_register[i].WriteRegister = false;
sys_register[i].CheckRegister = false;
sys_register[i].write_reg = &write_reg;
sys_register[i].read_reg = &read_reg;
}
}
static void InitRecRegister(){
rec_register[REC_CHANNEL_INDEX].address = 48;
rec_register[REC_GAIN_INDEX].address = 49;
rec_register[REC_ADC_CLOCK_INDEX].address = 51; // sampling rate
for(int i=0 ; i<sizeof(rec_register)/sizeof(DBSRegister) ; i++){
rec_register[i].WriteRegister = false;
rec_register[i].CheckRegister = false;
rec_register[i].write_reg = &write_reg;
rec_register[i].read_reg = &read_reg;
}
rec_register_value[REC_CHANNEL_INDEX] = 0;
rec_register_value[REC_GAIN_INDEX] = 1;
rec_register_value[REC_ADC_CLOCK_INDEX] = 100;
}
static void InitStiRegister(){
sti_register[STI_ENABLE_INDEX].address = 46;
sti_register[STI_AMP_POS_INDEX].address = 37;
sti_register[STI_AMP_NEG_INDEX].address = 38;
sti_register[STI_POLARITY_INDEX].address = 40;
sti_register[STI_CYCLE_CH01_INDEX].address = 42;
sti_register[STI_CYCLE_CH23_INDEX].address = 43;
sti_register[STI_CYCLE_CH45_INDEX].address = 44;
sti_register[STI_CYCLE_CH67_INDEX].address = 45;
sti_register[STI_CLK_RATIO_INDEX].address = 52;
sti_register[STI_ARBITRARY_EN_INDEX].address = 54;
sti_register[STI_MODE_INDEX].address = 56;
for(int ch=0 ; ch<8 ; ch++){
sti_register[ch*4 + STI_DURATION0_INDEX].address = ch*4 + 1;
sti_register[ch*4 + STI_DURATION1_INDEX].address = ch*4 + 2;
sti_register[ch*4 + STI_DURATION2_INDEX].address = ch*4 + 3;
sti_register[ch*4 + STI_DURATION3_INDEX].address = ch*4 + 4;
}
for(int i=0 ; i<sizeof(sti_register)/sizeof(DBSRegister) ; i++){
sti_register[i].WriteRegister = false;
sti_register[i].CheckRegister = false;
sti_register[i].write_reg = &write_reg;
sti_register[i].read_reg = &read_reg;
}
sti_register_value[STI_AMP_POS_INDEX] = 1;
sti_register_value[STI_AMP_NEG_INDEX] = 1;
}
static void InitDBSRegister(){
InitSysRegister();
InitRecRegister();
InitStiRegister();
init_fast_settle();
for(int i=1 ; i<sizeof(sys_register)/sizeof(DBSRegister) ; i++){
sys_register[i].WriteRegister = true;
}
sys_register[0].CheckRegister = true;
sys_register[0].write_reg(sys_register[0].address, sys_register_default_value[0]);
// flag_notify(EVT_NEU_SPI);
}
static void ResetDBSRegister(){
for(int i=0 ; i<sizeof(sys_register)/sizeof(DBSRegister) ; i++){
sys_register[i].WriteRegister = false;
sys_register[i].CheckRegister = false;
sys_register[i].write_reg = &write_reg;
sys_register[i].read_reg = &read_reg;
}
for(int i=0 ; i<sizeof(rec_register)/sizeof(DBSRegister) ; i++){
rec_register[i].WriteRegister = false;
rec_register[i].CheckRegister = false;
rec_register[i].write_reg = &write_reg;
rec_register[i].read_reg = &read_reg;
}
for(int i=0 ; i<sizeof(sti_register)/sizeof(DBSRegister) ; i++){
sti_register[i].WriteRegister = false;
sti_register[i].CheckRegister = false;
sti_register[i].write_reg = &write_reg;
sti_register[i].read_reg = &read_reg;
}
}
static uint16_t fast_settle_param[43];
static void init_fast_settle(){
uint8_t ch = 7;
uint8_t t1=25, t2=0, t3=25 , t4=0, t5=0;
// setting t1~t5
fast_settle_param[ch*4 + STI_DURATION0_INDEX] = (t2 & 0x003F) << 10 | (t1 & 0x03FF);
fast_settle_param[ch*4 + STI_DURATION1_INDEX] = (t4 & 0x0003) << 14 | (t3 & 0x03FF) << 4 | (t2 & 0x03C0) >> 6;
fast_settle_param[ch*4 + STI_DURATION2_INDEX] = (t4 & 0x0007FFFC) >> 2;
fast_settle_param[ch*4 + STI_DURATION3_INDEX] = t5;
// cycle number
fast_settle_param[STI_CYCLE_CH67_INDEX] = 10 << 8 | 0;
// set polarity, it's don't care in fast settle
fast_settle_param[STI_POLARITY_INDEX] = 0;
// set stimulate mode
fast_settle_param[STI_MODE_INDEX] = 0;
// INSTRUCTION.sti_mode = 0; // 1 = continuous mode; 0 = limit mode
// INSTRUCTION.sti_h_bridge = 0; // voltage sti must use H-bridge
// INSTRUCTION.sti_ref = 0; // 1 = GND; 0 = Vref
// using minimum amplitude
fast_settle_param[STI_AMP_POS_INDEX] = 0;
fast_settle_param[STI_AMP_NEG_INDEX] = 0;
// using ch8 to fast settle
fast_settle_param[STI_ENABLE_INDEX] = 0b0000000010000000; // 0bxxxx_xxxv_cccc_cccc, c = current; v = volt, x = don't care
}
#endif
@@ -133,7 +133,7 @@ static uint8_t headstage_led_set_color(uint16_t *ins_buf, uint8_t repeat, uint8_
#ifdef HEADSTAGE_LED_USE_SPI
#include <Board.h>
#include <board.h>
#include <ti/drivers/SPI.h>
#include <ti/drivers/dma/UDMACC26XX.h>
#include <ti/drivers/spi/SPICC26XXDMA.h>
@@ -3,7 +3,7 @@
#ifndef HEADSTAGE_PIN_H
#define HEADSTAGE_PIN_H
#include <Board.h>
#include <board.h>
#include <ti/drivers/PIN.h>
#if defined(HEADSTAGE_TNI_H)
@@ -6,7 +6,7 @@
static uint16_t UserCode2StiCode(uint16_t amp, uint8_t positive_ch){
// get real current value (uA)
uint32_t sti_code, real_amp = amp * 5;
int32_t sti_code, real_amp = amp * 5;
if(StiCaliTable.p_ch.coefficient == 10000 && StiCaliTable.p_ch.offset == 0){
return amp;
@@ -15,15 +15,29 @@ static uint16_t UserCode2StiCode(uint16_t amp, uint8_t positive_ch){
return amp;
}
// trans into sti code
if(positive_ch){
sti_code = StiCaliTable.p_ch.coefficient * real_amp + StiCaliTable.p_ch.offset;
if(real_amp < 200){
sti_code = 2023 * real_amp -4170;
}
else if(real_amp <500){
sti_code = 2077 * real_amp - 11729;
}
else{
sti_code = StiCaliTable.n_ch.coefficient * real_amp + StiCaliTable.n_ch.offset;
sti_code = 2096 * real_amp - 45970;
}
sti_code = sti_code / 10000;
// 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;
// }
if(sti_code <= 10000){
sti_code = 10000;
}
sti_code = (sti_code+5000) / 10000;
return (uint16_t) (sti_code);
}
@@ -2,16 +2,16 @@
#ifndef VERSION_DATE
#define VERSION_DATE
#define VERSION_DATE_YEAR 20
#define VERSION_DATE_MONTH 7
#define VERSION_DATE_DAY 9
#define VERSION_DATE_YEAR 21
#define VERSION_DATE_MONTH 1
#define VERSION_DATE_DAY 21
#define VERSION_DATE_HOUR 17
#define VERSION_DATE_MINUTE 7
#define VERSION_DATE_MINUTE 39
// this is NOT the version hash !!
// it's the last version hash
#define VERSION_HASH b19b8189278e6ef6b9d9db3b7bc8f6f9df565f05
#define VERSION_GIT_BRANCH Neulive2.0_developement
#define VERSION_HASH dd9f64662e1a9a993a1c28c18256d230f429f8ac
#define VERSION_GIT_BRANCH neulive2_E7DA_special_version
static void get_board_name(char *board_name_ch, uint8 *board_name_int, uint8 name_size){
uint8 name_offset = 18;
@@ -3,7 +3,7 @@
#ifndef HEADSTAGE_WATCHDOG
#define HEADSTAGE_WATCHDOG
#include <Board.h>
#include <board.h>
#include <ti/drivers/Watchdog.h>
#include <ti/drivers/watchdog/WatchdogCC26XX.h>
@@ -8,11 +8,60 @@
#error "headstage/headstage_notify.h not included"
#endif
#include "headstage_dbs_object.h"
#define NOT_BUF_OFFSET_INIT 8
static uint8_t not_buf_offset = NOT_BUF_OFFSET_INIT;
static uint32_t not_time_stamp = 0;
static void headstage_notify_set_timestamp();
static void headstage_notify_flip_buffer();
static uint8_t headstage_notify_append_data(uint8_t *data_value);
/**
* @fn headstage_neu_append_notify_data
*/
#define CHANNEL_VALID (INSTRUCTION.recording_channel & (0x0001 << channel))
static void headstage_neu_append_notify_data() {
uint8_t channel = spi_rxbuf[0];
// close-reopen SPI, if the first channel received is invalid
if(IsFirstData){
// start record
if((INSTRUCTION.recording_channel & (0x0001 << channel)) && (channel < 16)){
IsFirstData = false;
}
// restart SPI
else{
SPI_close(headstage_spi_handle);
ReopenSPI();
IsFirstData = true;
return;
}
}
// discard illegal channel
uint16_t valid_channel = INSTRUCTION.recording_channel & (0x0001 << channel);
if(!(INSTRUCTION.recording_channel & (0x0001 << channel)) || (channel > 15)){
// illegal channel
return;
}
uint8_t not_buf[2];
not_buf[0] = (channel & 0x0F) << 4 | (spi_rxbuf[1] & 0x0F);
not_buf[1] = spi_rxbuf[2];
uint8_t data_size = headstage_notify_append_data(not_buf);
if (data_size >= BLE_NOT_BUFF_SIZE) {
headstage_notify_flip_buffer();
headstage_notify_send();
}
}
static void headstage_notify_set_timestamp() {
not_time_stamp = headstage_time_stamp_us();
@@ -23,7 +72,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;
@@ -40,11 +89,9 @@ 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;
} 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) {
@@ -3,7 +3,7 @@
#ifndef HEADSTAGE_PWM_H
#define HEADSTAGE_PWM_H
#include <Board.h>
#include <board.h>
#include <ti/drivers/PWM.h>
static PWM_Handle headstage_system_pwm_handle = NULL;
@@ -4,6 +4,7 @@
#include "headstage_instruction.h"
#include "neu/headstage_spi.h"
#include "headstage_dbs_object.h"
static void ResetINSTRUCTION();
@@ -25,7 +26,7 @@ static void MCUReset(){
spi_txbuf[i] = 0;
spi_rxbuf[i] = 0;
}
SPICallBack = ONE_SHOT_SPI;
SPICallBack = CONTI_SPI_WITH_FLUSH;
ReopenSPI();
for(int i=0 ; i<SPI_LED_BUFF_SIZE ; i++){
@@ -33,7 +34,7 @@ static void MCUReset(){
}
// CIS buffer reset
for(int i=0 ; i<BLE_CDR_SAMLL_SIZE ; i++){
for(int i=0 ; i<BLE_CDR_SMALL_SIZE ; i++){
cdr_buf[i] = 0;
}
@@ -70,6 +71,7 @@ static void DBSReset(){
static void Neu2Reset(){
DBSReset();
MCUReset();
InitDBSRegister();
}
static void ResetINSTRUCTION(){
@@ -7,7 +7,7 @@
#error "put HEADSTAGE_MA_USE_SPI2 in predefined"
#endif
#include <Board.h>
#include <board.h>
#include <ti/drivers/SPI.h>
#include <ti/drivers/dma/UDMACC26XX.h>
#include <ti/drivers/spi/SPICC26XXDMA.h>
@@ -120,4 +120,71 @@ static void AppendSPITX(uint8_t index, uint32_t value){
}
}
/**
* @fn headstage_spi_callback
*
* description: callback function to deal with data transmission between DBS and CC2650
*/
static void headstage_spi_callback(SPI_Handle handle, SPI_Transaction* transaction) {
switch(SPICallBack){
case CONTINUOUS_TRANS:{
for(int i=0 ; i<SPI_BUFFER_SIZE ; i++){
spi_txbuf[i] = 0x00;
}
flag_notify(EVT_NEU_SPI);
break;
}
case FLUSH_BUFFER:{
SPICallBack = FLUSH_BUFFER2;
for(int i=0 ; i<SPI_BUFFER_SIZE ; i++){
spi_txbuf[i] = 0x00;
}
headstage_spi_transaction(SPI_BUFFER_SIZE);
break;
}
case FLUSH_BUFFER2:{
SPICallBack = CONTI_SPI_WITH_FLUSH;
for(int i=0 ; i<SPI_BUFFER_SIZE ; i++){
spi_txbuf[i] = 0x00;
}
flag_notify(EVT_NEU_SPI);
// headstage_spi_transaction(SPI_BUFFER_SIZE);
break;
}
case CONTI_SPI_WITH_FLUSH:{
SPICallBack = FLUSH_BUFFER;
for(int i=0 ; i<SPI_BUFFER_SIZE ; i++){
spi_txbuf[i] = 0x00;
}
headstage_spi_transaction(SPI_BUFFER_SIZE);
break;
}
case READ_MOSI:{
flag_notify(EVT_NEU_SPI);
break;
}
case READ_REG:{
check_reg_counter ++;
flag_notify(EVT_NEU_SPI);
break;
}
case CLOSE_SPI:{
SPICallBack = CONTI_SPI_WITH_FLUSH;
SPI_close(headstage_spi_handle);
break;
}
case ONE_SHOT_FLUSH:{
tx_put_u24(0, 0);
break;
}
default:{
break;
}
}
}
#endif
@@ -561,6 +561,7 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
headstage_init_device_info();
headstage_init();
InitDBSRegister();
for (;;) {
// Waits for a signal to the semaphore associated with the calling thread.
@@ -51,7 +51,7 @@
#include "hal_types.h"
#include "ble_user_config.h"
#include <ti/drivers/rf/rf.h>
#include <ti/drivers/rf/RF.h>
#if defined(BLE_V42_FEATURES) && (BLE_V42_FEATURES & SECURE_CONNS_CFG)
#include "ecc/ECCROMCC26XX.h"
@@ -82,7 +82,8 @@ extern "C" {
// Length of Characteristic 5 in bytes
#define SIMPLEPROFILE_CHAR1_LEN 2
#define SIMPLEPROFILE_CHAR2_LEN 50
//#define SIMPLEPROFILE_CHAR2_LEN 50
#define SIMPLEPROFILE_CHAR2_LEN 34
#define SIMPLEPROFILE_CHAR3_LEN 20
#define SIMPLEPROFILE_CHAR4_LEN 200
//#define SIMPLEPROFILE_CHAR4_LEN 20