Compare commits
101 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 726f733634 | |||
| 1ecb2b8150 | |||
| 271d55718c | |||
| f675ff0b66 | |||
| 83ad8302c1 | |||
| 955c3a2e7c | |||
| 664b6e56b9 | |||
| f94e4375f3 | |||
| 1cf1c01163 | |||
| 0cd2fe0528 | |||
| fb34754e1f | |||
| 20d5804a87 | |||
| 5851dc9707 | |||
| 7cc337c0fd | |||
| 09685951c3 | |||
| 720f6d3548 | |||
| 1393d568a0 | |||
| 92b6a3a4f2 | |||
| becdca9dc7 | |||
| dc3cce9990 | |||
| f8d7296f76 | |||
| 615eba69bd | |||
| aab6d49812 | |||
| 9bfef795e7 | |||
| 428808715a | |||
| 7dfc856318 | |||
| c4743a10ee | |||
| 679ab65e1a | |||
| 98500850e5 | |||
| a297beb696 | |||
| c87fb49656 | |||
| e9956f8c80 | |||
| df21b2021a | |||
| 6cb386e578 | |||
| bd7c73f2a5 | |||
| ea21075a1d | |||
| 71a5d93a21 | |||
| c461f71cf2 | |||
| 9ce8ea1400 | |||
| b181d9273b | |||
| fc22544bf7 | |||
| 069881f5c4 | |||
| ce61501d43 | |||
| 386f2940ad | |||
| 1965f6e182 | |||
| f699ecdae9 | |||
| 6655e7dd20 | |||
| 1010138986 | |||
| b9bb12e7aa | |||
| 1101798a28 | |||
| e7836141d1 | |||
| b824867264 | |||
| a115b00822 | |||
| e34a0e9d5b | |||
| 2dee13b495 | |||
| cdd208fc7b | |||
| 86df7e4735 | |||
| 0cb04a5fdb | |||
| b05a3db6f0 | |||
| c0f9a6216c | |||
| 5f21e2bae6 | |||
| 69e2327b41 | |||
| 80d23a4dad | |||
| 6dc12400c5 | |||
| 68fcbd56f6 | |||
| 2ff06e2142 | |||
| 4ed89630f7 | |||
| 481f5d6298 | |||
| cb512647b3 | |||
| 284725f420 | |||
| d9e2aad988 | |||
| 3f0aeb68ea | |||
| 285500cd86 | |||
| c7dfaff662 | |||
| be85ccb830 | |||
| f1f7b519e5 | |||
| 694395f997 | |||
| e88fb5c895 | |||
| bbdc1cb56f | |||
| 9d94be8dd6 | |||
| 2b70c8b1d1 | |||
| 56dafa2198 | |||
| 47a9e50a2e | |||
| bffc1e89c4 | |||
| 2ad8bf988a | |||
| ef4eb1f30b | |||
| f2d1faeec4 | |||
| bbb0481774 | |||
| 67fa04b8ed | |||
| aac42015f8 | |||
| debc9b061f | |||
| 43da6cc840 | |||
| 170eb132a4 | |||
| 875f5c2d9d | |||
| fba9d4cf67 | |||
| 72ecd7e39f | |||
| 00e35e4042 | |||
| 1d3d8e0836 | |||
| db61e6b3ad | |||
| b5d76a99b2 | |||
| 2d566a420d |
@@ -3,6 +3,7 @@
|
||||
# CSS package
|
||||
xdctools_*/
|
||||
ccsv8/
|
||||
simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/app/.config/
|
||||
|
||||
# CSS build files
|
||||
FlashROM/
|
||||
Binary file not shown.
@@ -60,4 +60,30 @@ major source code path:
|
||||
|
||||
-----------------------------------------------
|
||||
|
||||
#optional
|
||||
|
||||
###external tools:
|
||||
|
||||
1. doxygen: tool to help documenting code, extract document from comments
|
||||
|
||||
1. download from main page http://www.doxygen.nl/download.html
|
||||
|
||||
2. according to different OS, download corresponding version.
|
||||
|
||||
3. set up external tool in intellij
|
||||
|
||||
4. press keyboard 'ctrl' + 'shift' + 'a' to search external tool, select 'external tools-setting'
|
||||
|
||||
5. add external tool by pressing '+'
|
||||
|
||||
6. name this external tool in the column 'name'
|
||||
|
||||
7. set the path of doxygen execute file in the column 'program'
|
||||
|
||||
8. set the repository we want to generate document automatically in the column 'working directory'
|
||||
|
||||
9. set hotkey of doxygen to run : 'File' -> 'Setting' -> 'Keymap' -> 'external tools'
|
||||
|
||||
10. press the hotkey to run doxygen
|
||||
|
||||
Copyright (c) 2019. BioPro. Scientific.
|
||||
|
||||
@@ -17,32 +17,32 @@ STI_PARAMETER = {
|
||||
}
|
||||
|
||||
NEULIVE_INSTRUCTION = {
|
||||
'RIS': '3b101#header#;2b0;3b>LB;4b0;1bCH;1bFS;3b>WF;5b>TV;4b>PM;4b>NM;4b>SR',
|
||||
'RIS': '3b101#header#;2b0;3b>LB;2b0;1bCH;1bFS;3b>WF;5b>TV;4b>PM;4b>NM;4b>SR',
|
||||
'UMC': '3b001#umc_parameter;3b>AG;4b>PW;6b>TT;2b>SB;6b>TF;1bCA;1bCB;1bCC;1bCD;4b>CHA;4b>CHB;4b>CHC;4b>CHD'
|
||||
}
|
||||
|
||||
NEULIVE_PARAMETER = {
|
||||
'LB': 0,
|
||||
'CH': 0,
|
||||
'FS': 0,
|
||||
'WF': 0,
|
||||
'TV': 0,
|
||||
'PM': 15,
|
||||
'NM': 0,
|
||||
'SR': 0,
|
||||
'AG': 5,
|
||||
'PW': 0,
|
||||
'TT': 0,
|
||||
'SB': 1,
|
||||
'TF': 3,
|
||||
'CA': 1,
|
||||
'CB': 0,
|
||||
'CC': 0,
|
||||
'CD': 0,
|
||||
'CHA': 0,
|
||||
'CHB': 1,
|
||||
'CHC': 2,
|
||||
'CHD': 3,
|
||||
'LB': 0, # LOW BAND FREQEUNCY
|
||||
'CH': 0, # CHOPPER
|
||||
'FS': 0, # FAST SETTLE
|
||||
'WF': 1, # WAVEFORM : POS, NEG, P2N...etc.
|
||||
'TV': 0, # STIMULATION VOLTAGE
|
||||
'PM': 0, # P CHANNEL SELECT
|
||||
'NM': 0, # N CHANNEL SELECT
|
||||
'SR': 0, # ADC SAMPLING RATE
|
||||
'AG': 5, # AMP GAIN
|
||||
'PW': 0, # PULSE WIDTH
|
||||
'TT': 9, # STIMULATION TIMES
|
||||
'SB': 2, # STIMULATION BEHAVIOR
|
||||
'TF': 1, # STIMULATION FREQUENCY
|
||||
'CA': 1, # AMP CHANNEL A ENABLE
|
||||
'CB': 0, # AMP CHANNEL B ENABLE
|
||||
'CC': 0, # AMP CHANNEL C ENABLE
|
||||
'CD': 0, # AMP CHANNEL D ENABLE
|
||||
'CHA': 0, # AMP CHANNEL A
|
||||
'CHB': 1, # AMP CHANNEL B
|
||||
'CHC': 2, # AMP CHANNEL C
|
||||
'CHD': 3, # AMP CHANNEL D
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
*.txt
|
||||
@@ -1,7 +1,528 @@
|
||||
def main():
|
||||
file = open('C:/ti/python_test_code/uni/att_notify.psd', 'r')
|
||||
print(file.read())
|
||||
file.close()
|
||||
"""
|
||||
purpose:
|
||||
|
||||
in order to analyze the data loss of bluetooth, a small code is needed.
|
||||
Guess that there are three type of data loss. In order to prove this idea,
|
||||
several tests are needed
|
||||
|
||||
types of data loss:
|
||||
|
||||
1. packet loss:
|
||||
bluetooth notification does not need any negotiation.
|
||||
if there is any packet loss during the connection,
|
||||
it will not be lost forever
|
||||
|
||||
2. program delay causes loss in client(headstage):
|
||||
too many effort on data packaging, it would cause
|
||||
data delay
|
||||
|
||||
3. program delay causes loss in host(controller):
|
||||
...todo and need to define
|
||||
|
||||
Assume that we have lost several bytes data. We want to analyze the type of data lost.
|
||||
method:
|
||||
compare ramp data with time stamp, there are several conditions
|
||||
if data_delta * 1 / sampling_rate == time_delta:
|
||||
this should be packet loss
|
||||
else
|
||||
this should be program delay
|
||||
|
||||
method to coped with the corresponding problem:
|
||||
1. try 'Indication' to check data loss is reduced or not.
|
||||
2. modified the procedure of data packaging
|
||||
3. after the upper two problems are excluded, this problem should be left over
|
||||
|
||||
"""
|
||||
import os.path
|
||||
import sys
|
||||
from collections import Counter
|
||||
from typing import List, Optional, Dict, Set, Any
|
||||
|
||||
|
||||
class Options:
|
||||
def __init__(self):
|
||||
self.skip = False
|
||||
self.round = 2
|
||||
self.overflow_pow: Optional[int] = None
|
||||
|
||||
# print options
|
||||
self.quiet = False
|
||||
|
||||
# graph options
|
||||
self.graph: Optional[str] = None
|
||||
self.graph_log_scale = False
|
||||
self.graph_save_path: Optional[str] = None
|
||||
|
||||
# fft graph options
|
||||
self.fft_x_log = False
|
||||
self.fft_y_norm = False
|
||||
self.fft_channel = 0
|
||||
|
||||
@staticmethod
|
||||
def print_help():
|
||||
prg = sys.argv[0]
|
||||
|
||||
print(prg, '[OPTIONS]', 'FILE', '...')
|
||||
print()
|
||||
print('OPTIONS:')
|
||||
print(' -h, --help : print help')
|
||||
print(' --skip : skip if FILE not found')
|
||||
print(' --round VALUE : floating number round')
|
||||
print(' --overflow VALUE : overflow number. 2^VALUE')
|
||||
print()
|
||||
print('OPTIONS (print):')
|
||||
print(' -q : do not print table')
|
||||
print()
|
||||
print('OPTIONS (graph):')
|
||||
print(' --graph TYPE : use matplotlib to generate graph. could be:')
|
||||
print(' ramp : ramp data, calculate value miss')
|
||||
print(' fft : sin wave data, calculate fft')
|
||||
print(' --graph-log-scale :')
|
||||
print(' --graph-save PATH : save graph file path')
|
||||
print()
|
||||
print('OPTIONS (graph=fft):')
|
||||
print(' --fft-channel CH : filter channel')
|
||||
print(' --fft-log : log x-axis')
|
||||
print(' --fft-norm : log x-axis normalize')
|
||||
print(' --fft [opt,...] : above')
|
||||
print()
|
||||
print('ARGUMENTS:')
|
||||
print(' FILE : txt data file')
|
||||
print()
|
||||
|
||||
|
||||
class Result:
|
||||
def __init__(self, data_file: str, options: Options):
|
||||
# data file information
|
||||
self.data_file = data_file
|
||||
self.date_time: Optional[str] = None
|
||||
self.device_name: Optional[str] = None
|
||||
self.device_address: Optional[str] = None
|
||||
self.parameter: Dict[str, str] = {}
|
||||
self.channel: Set[int] = set()
|
||||
self.total_duration: float = 0.0
|
||||
|
||||
# analysis data
|
||||
self.data_count = 0
|
||||
self.time_delta_counter = Counter()
|
||||
self.value_delta_counter = Counter()
|
||||
|
||||
# analysis options
|
||||
self.round = options.round
|
||||
|
||||
self.overflow: Optional[int] = None
|
||||
if options.overflow_pow is not None:
|
||||
self.overflow = 2 ** options.overflow_pow
|
||||
|
||||
# temp data
|
||||
self._prev_time: Optional[float] = None
|
||||
self._prev_value: Optional[int] = None
|
||||
self._close = False
|
||||
|
||||
@property
|
||||
def sample_rate(self) -> int:
|
||||
try:
|
||||
sample_rate = self.parameter['SAMPLE_RATE']
|
||||
except KeyError as e:
|
||||
raise RuntimeError('data file do not contain SAMPLE_RATE') from e
|
||||
|
||||
try:
|
||||
return int(sample_rate)
|
||||
except ValueError as e:
|
||||
raise RuntimeError('data file SAMPLE_RATE value not a value : ' + str(sample_rate)) from e
|
||||
|
||||
def update(self, time: float, channel: int, value: int):
|
||||
if self._close:
|
||||
raise RuntimeError('closed')
|
||||
|
||||
self.data_count += 1
|
||||
|
||||
if self._prev_time is not None:
|
||||
delta = round(time - self._prev_time, self.round)
|
||||
self.time_delta_counter[delta] += 1
|
||||
|
||||
if self._prev_value is not None:
|
||||
delta = value - self._prev_value
|
||||
self.value_delta_counter[delta] += 1
|
||||
|
||||
self._prev_time = time
|
||||
self.channel.add(channel)
|
||||
self._prev_value = value
|
||||
self.total_duration = time
|
||||
|
||||
def close(self):
|
||||
self._close = True
|
||||
|
||||
if self.overflow is not None:
|
||||
|
||||
self.value_delta_counter[1] += self.value_delta_counter[1 - self.overflow]
|
||||
del self.value_delta_counter[1 - self.overflow]
|
||||
i = 2
|
||||
|
||||
while i - self.overflow in self.value_delta_counter:
|
||||
self.value_delta_counter[i] += self.value_delta_counter[i - self.overflow]
|
||||
del self.value_delta_counter[i - self.overflow]
|
||||
i += 1
|
||||
|
||||
|
||||
def calculate(txt_file: str, options: Options) -> Result:
|
||||
if not os.path.exists(txt_file):
|
||||
raise FileNotFoundError(txt_file)
|
||||
|
||||
result = Result(txt_file, options)
|
||||
|
||||
parsing_state = 0
|
||||
|
||||
with open(txt_file) as _file:
|
||||
for line, content in enumerate(_file): # type: int, str
|
||||
content = content.strip()
|
||||
|
||||
if len(content) == 0:
|
||||
continue
|
||||
|
||||
if parsing_state == 0:
|
||||
if content.startswith('#'):
|
||||
if result.date_time is None:
|
||||
result.date_time = content[1:].strip()
|
||||
|
||||
elif content.startswith('# device_name'):
|
||||
result.device_name = content[len('# device_name'):].strip()
|
||||
|
||||
elif content.startswith('# mac_address'):
|
||||
result.device_address = content[len('# mac_address'):].strip()
|
||||
|
||||
elif content.startswith('# parameter'):
|
||||
parsing_state = 1
|
||||
|
||||
elif parsing_state == 1:
|
||||
if content.startswith('#'):
|
||||
if content.startswith('# time_stamp'):
|
||||
parsing_state = 2
|
||||
|
||||
else:
|
||||
part = content[2:].split(' ', maxsplit=2)
|
||||
|
||||
result.parameter[part[0]] = part[1]
|
||||
|
||||
elif parsing_state == 2:
|
||||
if content.startswith('#'):
|
||||
continue
|
||||
|
||||
part = content.split(' ', maxsplit=3)
|
||||
|
||||
try:
|
||||
time = part[0]
|
||||
channel = part[1]
|
||||
value = part[2]
|
||||
except IndexError:
|
||||
print('@%d' % (line + 1), 'incomplete data', ':', content)
|
||||
continue
|
||||
|
||||
check_pass = True
|
||||
|
||||
try:
|
||||
time = float(time)
|
||||
except ValueError:
|
||||
print('@%d' % (line + 1), 'incomplete time', ':', time)
|
||||
check_pass = False
|
||||
|
||||
try:
|
||||
channel = int(channel)
|
||||
except ValueError:
|
||||
print('@%d' % (line + 1), 'incomplete channel', ':', channel)
|
||||
check_pass = False
|
||||
|
||||
try:
|
||||
value = int(value)
|
||||
except ValueError:
|
||||
print('@%d' % (line + 1), 'incomplete value', ':', value)
|
||||
check_pass = False
|
||||
|
||||
if check_pass:
|
||||
result.update(time, channel, value)
|
||||
|
||||
result.close()
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def print_result(result: Result, options: Options):
|
||||
def print_table(counter: Dict[Any, Any], key_format='%10d', value_format='%d'):
|
||||
f = ' %s : %s' % (key_format, value_format)
|
||||
for k in sorted(counter.keys()):
|
||||
print(f % (k, counter[k]))
|
||||
|
||||
if not options.quiet:
|
||||
print(result.data_file)
|
||||
print('data_count', result.data_count)
|
||||
print('channel', ' '.join(list(map(str, sorted(result.channel)))))
|
||||
|
||||
try:
|
||||
sample_rate = result.sample_rate
|
||||
print('sample_rate [1/s]', sample_rate)
|
||||
print('1/sample_rate [ms]', 1000 / sample_rate)
|
||||
except RuntimeError:
|
||||
print('sample_rate', '(E)')
|
||||
|
||||
print('time_delta')
|
||||
print_table(result.time_delta_counter, '%10.2f')
|
||||
print()
|
||||
|
||||
print('value_delta')
|
||||
print_table(result.value_delta_counter)
|
||||
print()
|
||||
|
||||
# packet miss rate
|
||||
|
||||
#
|
||||
if options.graph == 'ramp':
|
||||
delta_value = list(filter(lambda it: it > 0, result.value_delta_counter))
|
||||
total = sum(map(lambda it: it * result.value_delta_counter[it], delta_value))
|
||||
miss = sum(map(lambda it: (it - 1) * result.value_delta_counter[it], delta_value))
|
||||
print('value_miss (ramp)', '%d/%d' % (miss, total), '%.2f%%' % (100 * miss / total))
|
||||
valid_time = list(filter(lambda it: it < 50, result.time_delta_counter))
|
||||
total_valid_t = sum(map(lambda it: it * result.time_delta_counter[it], valid_time))
|
||||
print('time_waste (ramp)', '%d/%d' % (total_valid_t, result.total_duration), '%.2f%%' % ( 100 * total_valid_t / result.total_duration))
|
||||
timesofwaste = list(filter(lambda it: it > 50, result.time_delta_counter))
|
||||
timesintotal = sum(map(lambda it: result.time_delta_counter[it], timesofwaste))
|
||||
print('waste time occur times (ramp)', '%d' % timesintotal)
|
||||
print()
|
||||
|
||||
paint_ramp_result(result, options)
|
||||
|
||||
elif options.graph == 'fft':
|
||||
paint_fft_result(result, options)
|
||||
|
||||
|
||||
def paint_fft_result(result: Result, options: Options):
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from scipy import signal
|
||||
from scipy.interpolate import interp1d
|
||||
from scipy.fftpack import fft
|
||||
|
||||
time_seq = []
|
||||
value_seq = []
|
||||
time_offset = None
|
||||
total_duration = 0.0
|
||||
|
||||
with open(result.data_file) as _file:
|
||||
for line in _file:
|
||||
line = line.strip()
|
||||
|
||||
if len(line) == 0 or line.startswith('#'):
|
||||
continue
|
||||
|
||||
else:
|
||||
part = line.split(' ', maxsplit=3)
|
||||
channel = int(part[1])
|
||||
|
||||
if channel == options.fft_channel:
|
||||
time = float(part[0])
|
||||
|
||||
if time_offset is None:
|
||||
time_seq.append(0.0)
|
||||
time_offset = time
|
||||
else:
|
||||
total_duration = time - time_offset
|
||||
time_seq.append(time - time_offset)
|
||||
|
||||
value_seq.append(int(part[2]))
|
||||
|
||||
if len(time_seq) == 0:
|
||||
raise RuntimeError('empty channel data : ' + str(options.fft_channel))
|
||||
|
||||
plt.figure(1)
|
||||
f1, pxx_den = signal.periodogram(value_seq, 1e3)
|
||||
plt.semilogy(f1, pxx_den)
|
||||
plt.ylim([1e-7, 1e7])
|
||||
plt.xlabel('frequency [hz]')
|
||||
plt.ylabel('PSD[v**2/Hz')
|
||||
|
||||
plt.figure(2)
|
||||
sample_rate = result.sample_rate
|
||||
time_delta = 1 / sample_rate
|
||||
total_time_step = int(total_duration / (time_delta * 1000))
|
||||
|
||||
f = interp1d(time_seq, value_seq, copy=False)
|
||||
|
||||
t = np.linspace(0, total_duration, total_time_step)
|
||||
|
||||
fft_result = fft(f(t))
|
||||
fft_result = fft_result[:len(fft_result) // 2]
|
||||
fft_x = np.linspace(0, 1.0/(2.0*time_delta), len(fft_result)//2)
|
||||
|
||||
if options.fft_x_log:
|
||||
fft_x = np.log10(fft_x)
|
||||
|
||||
if options.fft_y_norm:
|
||||
fft_result /= sum(fft_result)
|
||||
|
||||
plt.plot(fft_x, 2.0 / len(fft_result) * np.abs(fft_result[0:len(fft_result)//2]))
|
||||
|
||||
|
||||
if options.graph_save_path is not None:
|
||||
plt.savefig(options.graph_save_path, dpi=600)
|
||||
else:
|
||||
plt.show()
|
||||
|
||||
|
||||
def paint_ramp_result(result: Result, options: Options):
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
fig, (at, av) = plt.subplots(2, 1)
|
||||
|
||||
time_delta_data = list(result.time_delta_counter)
|
||||
expect_time_delta = 1000 / result.sample_rate
|
||||
time_delta_bins = int((max(time_delta_data) - min(time_delta_data)) / expect_time_delta)
|
||||
time_delta_weight = [result.time_delta_counter[k] for k in time_delta_data]
|
||||
at.hist(time_delta_data,
|
||||
bins=time_delta_bins,
|
||||
weights=time_delta_weight,
|
||||
log=options.graph_log_scale,
|
||||
align='left')
|
||||
|
||||
value_delta_data = list(result.value_delta_counter)
|
||||
value_delta_bins = max(value_delta_data) - min(value_delta_data)
|
||||
value_delta_weight = [result.value_delta_counter[k] for k in value_delta_data]
|
||||
av.hist(value_delta_data,
|
||||
bins=value_delta_bins,
|
||||
weights=value_delta_weight,
|
||||
log=options.graph_log_scale,
|
||||
align='left')
|
||||
|
||||
fig.tight_layout()
|
||||
|
||||
if options.graph_save_path is not None:
|
||||
plt.savefig(options.graph_save_path, dpi=600)
|
||||
else:
|
||||
plt.show()
|
||||
|
||||
|
||||
|
||||
|
||||
def main(argv: List[str]):
|
||||
"""
|
||||
|
||||
:param argv:
|
||||
:return:
|
||||
"""
|
||||
|
||||
# df = pd.read_csv("C:/Users/yichin/Downloads/last-2019-07-18-16-30-15-7.csv", sep=",", skiprows=12, header=None)
|
||||
# sel_df = pd.DataFrame(df)
|
||||
# column, row = sel_df.shape
|
||||
# sel_df = sel_df.fillna(value=0)
|
||||
# delta_df = sel_df.diff(periods=1)
|
||||
# delta_df = delta_df.fillna(value=0)
|
||||
# delta_df = delta_df.drop(column - 1)
|
||||
# delta_df.set_axis(['time_delta', 'data_delta'], axis='columns', inplace=True)
|
||||
|
||||
o = Options()
|
||||
|
||||
i = 0
|
||||
while i < len(argv):
|
||||
arg = argv[i]
|
||||
|
||||
if arg in ('-h', '--help'):
|
||||
o.print_help()
|
||||
return
|
||||
|
||||
elif arg == '--skip':
|
||||
o.skip = True
|
||||
i += 1
|
||||
|
||||
elif arg == '--round':
|
||||
o.round = int(argv[i + 1])
|
||||
i += 2
|
||||
|
||||
elif arg.startswith('--round='):
|
||||
o.round = int(arg[len('--round='):])
|
||||
i += 1
|
||||
|
||||
elif arg == '--overflow':
|
||||
o.overflow_pow = int(argv[i + 1])
|
||||
i += 2
|
||||
|
||||
elif arg.startswith('--overflow='):
|
||||
o.overflow_pow = int(arg[len('--overflow='):])
|
||||
i += 1
|
||||
|
||||
elif arg == '-q':
|
||||
o.quiet = True
|
||||
i += 1
|
||||
|
||||
elif arg == '--graph':
|
||||
o.graph = argv[i + 1]
|
||||
i += 2
|
||||
|
||||
elif arg.startswith('--graph='):
|
||||
o.graph = arg[len('--graph='):]
|
||||
i += 1
|
||||
|
||||
elif arg == '--graph-log-scale':
|
||||
o.graph_log_scale = True
|
||||
i += 1
|
||||
|
||||
elif arg == '--graph-save':
|
||||
o.graph_save_path = argv[i + 1]
|
||||
i += 2
|
||||
|
||||
elif arg.startswith('--graph-save='):
|
||||
o.graph = arg[len('--graph-save='):]
|
||||
i += 1
|
||||
|
||||
elif arg == '--fft-channel':
|
||||
o.fft_channel = int(argv[i + 1])
|
||||
i += 2
|
||||
|
||||
elif arg.startswith('--fft-channel='):
|
||||
o.fft_channel = int(arg[len('--fft-channel='):])
|
||||
i += 1
|
||||
|
||||
elif arg == '--fft-log':
|
||||
o.fft_x_log = True
|
||||
i += 1
|
||||
|
||||
elif arg == '--fft-norm':
|
||||
o.fft_y_norm = True
|
||||
i += 1
|
||||
|
||||
elif arg.startswith('--fft'):
|
||||
if arg == '--fft':
|
||||
c = argv[i + 1]
|
||||
i += 2
|
||||
elif arg.startswith('--fft='):
|
||||
c = arg[len('--fft='):]
|
||||
i += 1
|
||||
else:
|
||||
raise ValueError('unknown options : ' + arg)
|
||||
|
||||
for a in c.split(','):
|
||||
if a == 'log':
|
||||
o.fft_x_log = True
|
||||
elif a == 'norm':
|
||||
o.fft_y_norm = True
|
||||
elif a.startswith('channel='):
|
||||
o.fft_channel = int(a[len('channel='):])
|
||||
else:
|
||||
raise ValueError('unknown options : --fft-' + a)
|
||||
|
||||
elif arg.startswith('-'):
|
||||
raise ValueError('unknown options : ' + arg)
|
||||
|
||||
else:
|
||||
i += 1
|
||||
try:
|
||||
result = calculate(arg, o)
|
||||
except FileNotFoundError:
|
||||
if o.skip:
|
||||
continue
|
||||
else:
|
||||
raise
|
||||
|
||||
else:
|
||||
print_result(result, o)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main(sys.argv[1:])
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import unittest
|
||||
import random
|
||||
from random import randint
|
||||
from typing import List, Optional
|
||||
|
||||
@@ -182,7 +181,7 @@ class UniRearrangeMuxChannelTest(unittest.TestCase):
|
||||
|
||||
def test_count_channel(self):
|
||||
self.assertEqual(count_channel(to_channel_table(7, 3, 2)), count_channel_without_re(to_channel_table(7, 3, 2)))
|
||||
self.assertEqual(count_channel(to_channel_table(0, 1, 2)), count_channel_without_re(to_channel_table(0, 1, 2)))
|
||||
self.assertEqual(count_channel(to_channel_table(0, 10, 2)), count_channel_without_re(to_channel_table(0, 10, 2)))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -10,5 +10,5 @@
|
||||
<rts value="libc.a"/>
|
||||
<createSlaveProjects value=""/>
|
||||
<connection value="common/targetdb/connections/TIXDS100v3_Dot7_Connection.xml"/>
|
||||
<isTargetManual value="false"/>
|
||||
<isTargetManual value="true"/>
|
||||
</projectOptions>
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
inEditor=false
|
||||
onBuild=false
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configurations XML_version="1.2" id="configurations_0">
|
||||
<configuration XML_version="1.2" id="configuration_0">
|
||||
<instance XML_version="1.2" desc="Texas Instruments XDS100v3 USB Debug Probe" href="connections/TIXDS100v3_Dot7_Connection.xml" id="Texas Instruments XDS100v3 USB Debug Probe" xml="TIXDS100v3_Dot7_Connection.xml" xmlpath="connections"/>
|
||||
<connection XML_version="1.2" id="Texas Instruments XDS100v3 USB Debug Probe">
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cortexM.xml" id="drivers" xml="tixds100v2cortexM.xml" xmlpath="drivers"/>
|
||||
<property Type="choicelist" Value="2" id="The Converter Usage">
|
||||
<choice Name="Generate 1149.7 2-pin advanced modes" value="enable">
|
||||
<property Type="choicelist" Value="1" id="The Converter 1149.7 Frequency">
|
||||
<choice Name="Overclock with user specified value" value="unused">
|
||||
<property Type="choicelist" Value="5" id="-- Choose a value from 1.0MHz to 50.0MHz"/>
|
||||
</choice>
|
||||
</property>
|
||||
<property Type="choicelist" Value="5" id="The Target Scan Format"/>
|
||||
</choice>
|
||||
</property>
|
||||
<platform XML_version="1.2" id="platform_0">
|
||||
<instance XML_version="1.2" desc="CC2640F128" href="devices/cc2640f128.xml" id="CC2640F128" xml="cc2640f128.xml" xmlpath="devices"/>
|
||||
</platform>
|
||||
</connection>
|
||||
</configuration>
|
||||
</configurations>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based
|
||||
on the device and connection settings specified in your project on the Properties > General page.
|
||||
|
||||
Please note that in automatic target-configuration management, changes to the project's device and/or
|
||||
connection settings will either modify an existing or generate a new target-configuration file. Thus,
|
||||
if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively,
|
||||
you may create your own target-configuration file for this project and manage it manually. You can
|
||||
always switch back to automatic target-configuration management by checking the "Manage the project's
|
||||
target-configuration automatically" checkbox on the project's Properties > General page.
|
||||
+1
-1
@@ -10,5 +10,5 @@
|
||||
<rts value="libc.a"/>
|
||||
<createSlaveProjects value=""/>
|
||||
<connection value="common/targetdb/connections/TIXDS100v3_Dot7_Connection.xml"/>
|
||||
<isTargetManual value="false"/>
|
||||
<isTargetManual value="true"/>
|
||||
</projectOptions>
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
inEditor=false
|
||||
onBuild=false
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.cdt.debug.core.toggleBreakpointModel=com.ti.ccstudio.debug.CCSBreakpointMarker
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<configurations XML_version="1.2" id="configurations_0">
|
||||
<configuration XML_version="1.2" id="configuration_0">
|
||||
<instance XML_version="1.2" desc="Texas Instruments XDS100v3 USB Debug Probe" href="connections/TIXDS100v3_Dot7_Connection.xml" id="Texas Instruments XDS100v3 USB Debug Probe" xml="TIXDS100v3_Dot7_Connection.xml" xmlpath="connections"/>
|
||||
<connection XML_version="1.2" id="Texas Instruments XDS100v3 USB Debug Probe">
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2icepick_c.xml" id="drivers" xml="tixds100v2icepick_c.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cs_dap.xml" id="drivers" xml="tixds100v2cs_dap.xml" xmlpath="drivers"/>
|
||||
<instance XML_version="1.2" href="drivers/tixds100v2cortexM.xml" id="drivers" xml="tixds100v2cortexM.xml" xmlpath="drivers"/>
|
||||
<property Type="choicelist" Value="2" id="The Converter Usage">
|
||||
<choice Name="Generate 1149.7 2-pin advanced modes" value="enable">
|
||||
<property Type="choicelist" Value="1" id="The Converter 1149.7 Frequency">
|
||||
<choice Name="Overclock with user specified value" value="unused">
|
||||
<property Type="choicelist" Value="5" id="-- Choose a value from 1.0MHz to 50.0MHz"/>
|
||||
</choice>
|
||||
</property>
|
||||
<property Type="choicelist" Value="5" id="The Target Scan Format"/>
|
||||
</choice>
|
||||
</property>
|
||||
<platform XML_version="1.2" id="platform_0">
|
||||
<instance XML_version="1.2" desc="CC2640F128" href="devices/cc2640f128.xml" id="CC2640F128" xml="cc2640f128.xml" xmlpath="devices"/>
|
||||
</platform>
|
||||
</connection>
|
||||
</configuration>
|
||||
</configurations>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
The 'targetConfigs' folder contains target-configuration (.ccxml) files, automatically generated based
|
||||
on the device and connection settings specified in your project on the Properties > General page.
|
||||
|
||||
Please note that in automatic target-configuration management, changes to the project's device and/or
|
||||
connection settings will either modify an existing or generate a new target-configuration file. Thus,
|
||||
if you manually edit these auto-generated files, you may need to re-apply your changes. Alternatively,
|
||||
you may create your own target-configuration file for this project and manage it manually. You can
|
||||
always switch back to automatic target-configuration management by checking the "Manage the project's
|
||||
target-configuration automatically" checkbox on the project's Properties > General page.
|
||||
@@ -9,6 +9,6 @@
|
||||
<linkerCommandFile value="cc26x0f128.cmd"/>
|
||||
<rts value="libc.a"/>
|
||||
<createSlaveProjects value=""/>
|
||||
<connection value="common/targetdb/connections/TIXDS100v3_Dot7_Connection.xml"/>
|
||||
<isTargetManual value="false"/>
|
||||
<connection value="common/targetdb/connections/TIXDS110_Connection.xml"/>
|
||||
<isTargetManual value="true"/>
|
||||
</projectOptions>
|
||||
|
||||
+2
-2
@@ -9,6 +9,6 @@
|
||||
<linkerCommandFile value="cc26x0f128.cmd"/>
|
||||
<rts value="libc.a"/>
|
||||
<createSlaveProjects value=""/>
|
||||
<connection value="common/targetdb/connections/TIXDS100v3_Dot7_Connection.xml"/>
|
||||
<isTargetManual value="false"/>
|
||||
<connection value="common/targetdb/connections/TIXDS110_Connection.xml"/>
|
||||
<isTargetManual value="true"/>
|
||||
</projectOptions>
|
||||
|
||||
BIN
Binary file not shown.
+1
@@ -0,0 +1 @@
|
||||
C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\.config\xconfig_app_ble\.buildtime
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
#
|
||||
_XDCBUILDCOUNT =
|
||||
ifneq (,$(findstring path,$(_USEXDCENV_)))
|
||||
override XDCPATH = C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/packages;C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/tidrivers_cc13xx_cc26xx_2_21_01_01/packages;C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages;C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/uia_2_01_00_01/packages;C:/ti/ccsv8/ccs_base;C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/app/.config
|
||||
override XDCROOT = C:/ti/xdctools_3_32_02_25_core
|
||||
override XDCBUILDCFG = ./config.bld
|
||||
endif
|
||||
ifneq (,$(findstring args,$(_USEXDCENV_)))
|
||||
override XDCARGS =
|
||||
override XDCTARGETS =
|
||||
endif
|
||||
#
|
||||
ifeq (0,1)
|
||||
PKGPATH = C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/packages;C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/tidrivers_cc13xx_cc26xx_2_21_01_01/packages;C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages;C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/uia_2_01_00_01/packages;C:/ti/ccsv8/ccs_base;C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/app/.config;C:/ti/xdctools_3_32_02_25_core/packages;..
|
||||
HOSTOS = Windows
|
||||
endif
|
||||
+1
@@ -0,0 +1 @@
|
||||
--endian=little -mv7M3 --abi=eabi -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/packages" -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/tidrivers_cc13xx_cc26xx_2_21_01_01/packages" -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages" -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/uia_2_01_00_01/packages" -I"C:/ti/ccsv8/ccs_base" -I"C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/app/.config" -I"C:/ti/xdctools_3_32_02_25_core/packages" -I"C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/app/.config/xconfig_app_ble/.." -IC:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.6.LTS/include -Dxdc_target_types__="ti/targets/arm/elf/std.h" -Dxdc_target_name__=M3 -Dxdc_cfg__xheader__="\"C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/app/.config/xconfig_app_ble/package/cfg/app_ble_pem3.h\""
|
||||
+1
@@ -0,0 +1 @@
|
||||
-I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/packages" -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/tidrivers_cc13xx_cc26xx_2_21_01_01/packages" -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages" -I"C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/uia_2_01_00_01/packages" -I"C:/ti/ccsv8/ccs_base" -I"C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/app/.config" -I"C:/ti/xdctools_3_32_02_25_core/packages" -I"C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/app/.config/xconfig_app_ble/.." -IC:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.6.LTS/include -Dxdc_target_types__="ti/targets/arm/elf/std.h" -Dxdc_target_name__=M3 -Dxdc_cfg__xheader__="\"C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/app/.config/xconfig_app_ble/package/cfg/app_ble_pem3.h\""
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
/* THIS IS A GENERATED FILE -- DO NOT EDIT */
|
||||
|
||||
var target; /* the target used for this build */
|
||||
|
||||
/* configuro was passed the target's name explicitly */
|
||||
try {
|
||||
target = xdc.module('ti.targets.arm.elf.M3');
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error("Can't find the target named '" + 'ti.targets.arm.elf.M3'
|
||||
+ "' along the path '" + environment["xdc.path"]
|
||||
+ "': please check the spelling of the target's name and that it exists along this path.");
|
||||
}
|
||||
if (!(target instanceof xdc.module("xdc.bld.ITarget").Module)) {
|
||||
throw new Error("The module named 'ti.targets.arm.elf.M3' exists but it's not a target: please check the spelling of the target's name");
|
||||
}
|
||||
|
||||
/* configuro was passed compiler options explicitly */
|
||||
target.ccOpts.prefix = unescape("-mv7M3%20--code_state%3D16%20-me%20-O4%20--opt_for_speed%3D0%20--include_path%3D%22C%3A/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.6.LTS/include%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/inc%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/icall/inc%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles/cc26xx%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/dev_info%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile/cc26xx%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/common/cc26xx%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/heapmgr%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/controller/cc26xx/inc%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/target%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/cc26xx%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/sdata%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/saddr%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/icall/src/inc%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/inc%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/rom%22%20--include_path%3D%22C%3A/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272%22%20--define%3DBOARD_DISPLAY_EXCLUDE_UART%20--define%3DPOWER_SAVING%20--define%3DBOOSTXL_CC2650MA%20--define%3DHEADSTAGE_MA_USE_SPI2%20--define%3DHEADSTAGE_MA_USE_ADC%20--define%3DCC26XX%20--define%3DGAPROLE_TASK_STACK_SIZE%3D540%20--define%3DHEAPMGR_SIZE%3D0%20--define%3DICALL_MAX_NUM_ENTITIES%3D6%20--define%3DICALL_MAX_NUM_TASKS%3D3%20--define%3DUSE_ICALL%20--define%3DxBOARD_DISPLAY_EXCLUDE_LCD%20--define%3DxDisplay_DISABLE_ALL%20--define%3Dxdc_runtime_Assert_DISABLE_ALL%20--define%3Dxdc_runtime_Log_DISABLE_ALL%20-g%20--c99%20--gcc%20--diag_suppress%3D48%20--diag_warning%3D225%20--diag_wrap%3Doff%20--display_error_number%20--gen_func_subsections%3Don%20--abi%3Deabi%20%20") + target.ccOpts.prefix;
|
||||
|
||||
/* configuro was passed the target's rootDir explicitly */
|
||||
target.rootDir = 'C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.6.LTS';
|
||||
|
||||
Build.targets = [target];
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
## THIS IS A GENERATED FILE -- DO NOT EDIT
|
||||
.configuro: .libraries,em3 linker.cmd package/cfg/app_ble_pem3.oem3
|
||||
|
||||
# To simplify configuro usage in makefiles:
|
||||
# o create a generic linker command file name
|
||||
# o set modification times of compiler.opt* files to be greater than
|
||||
# or equal to the generated config header
|
||||
#
|
||||
linker.cmd: package/cfg/app_ble_pem3.xdl
|
||||
$(SED) 's"^\"\(package/cfg/app_ble_pem3cfg.cmd\)\"$""\"C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/app/.config/xconfig_app_ble/\1\""' package/cfg/app_ble_pem3.xdl > $@
|
||||
-$(SETDATE) -r:max package/cfg/app_ble_pem3.h compiler.opt compiler.opt.defs
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
/* THIS IS A GENERATED FILE -- DO NOT EDIT */
|
||||
|
||||
var targ = xdc.module('ti.targets.arm.elf.M3');
|
||||
/* configuro was told the platform explicitly */
|
||||
var platform = 'ti.platforms.simplelink:CC2640F128';
|
||||
|
||||
/* decide whether to make an assembly or an executable */
|
||||
var makeAssembly = false;
|
||||
|
||||
|
||||
var Executable = xdc.module('xdc.bld.Executable');
|
||||
|
||||
var exeOpts = new Executable.Attrs({
|
||||
cfgScript: 'C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/config/app_ble.cfg',
|
||||
profile: 'release',
|
||||
cfgHome: 'xconfig_app_ble',
|
||||
});
|
||||
|
||||
exeOpts.cfgArgs = 'null';
|
||||
exeOpts.cfgArgsEncoded = true;
|
||||
|
||||
var exe = Pkg[makeAssembly ? 'addAssembly': 'addExecutable'](
|
||||
'app_ble',
|
||||
targ,
|
||||
platform,
|
||||
exeOpts
|
||||
);
|
||||
|
||||
/*
|
||||
* Generate the compiler.opt file
|
||||
* Do this here instead of during the initial creation of the configuro
|
||||
* package, because the contents of any config.bld script are unknown
|
||||
* at that time. Config.bld can't be executed until the XDC build phase.
|
||||
*/
|
||||
if (makeAssembly) {
|
||||
var suffix = targ.dllExt || '.p' + targ.suffix;
|
||||
}
|
||||
else {
|
||||
var suffix = '.p' + targ.suffix;
|
||||
}
|
||||
|
||||
var thisObj = {
|
||||
cfg: 'C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/config/app_ble.cfg',
|
||||
outputPath: 'C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/app/.config/xconfig_app_ble',
|
||||
exeName: 'app_ble' + suffix,
|
||||
exeIntName: 'app_ble' + suffix.replace('.', '_'),
|
||||
targ: targ,
|
||||
linkerCommandFile: 'linker.cmd',
|
||||
compilerOptFile: 'compiler.opt',
|
||||
compilerDefsFile: 'compiler.opt' + ".defs",
|
||||
makeAssembly: makeAssembly
|
||||
};
|
||||
var tmpl = xdc.loadTemplate('xdc/tools/configuro/template/compiler.opt.xdt');
|
||||
tmpl.genFile('compiler.opt', thisObj, [], false);
|
||||
|
||||
/*
|
||||
* Generate the custom makefile.
|
||||
*/
|
||||
var tmpl = xdc.loadTemplate('xdc/tools/configuro/template/' +
|
||||
(makeAssembly? 'custom.mak.asm.xdt' : 'custom.mak.exe.xdt'));
|
||||
tmpl.genFile('custom.mak', thisObj, [], false);
|
||||
Pkg.makeEpilogue = "include custom.mak";
|
||||
|
||||
/*
|
||||
* Generate the package script.
|
||||
*/
|
||||
var tmpl = xdc.loadTemplate('xdc/tools/configuro/template/package.xs.xdt');
|
||||
tmpl.genFile('package.xs', thisObj, [], false);
|
||||
|
||||
if (makeAssembly) {
|
||||
/*
|
||||
* Generate the linker options into a staging file, so that the presence or
|
||||
* age of the advertised linker command file can be the makefile trigger to
|
||||
* rebuild the package from the user's config script.
|
||||
*/
|
||||
var tmpl = xdc.loadTemplate('xdc/tools/configuro/template/linker.cmd.asm.xdt');
|
||||
tmpl.genFile('linker.cmd.cp', thisObj, [], false);
|
||||
}
|
||||
+256
@@ -0,0 +1,256 @@
|
||||
#
|
||||
# Do not edit this file. This file is generated from
|
||||
# package.bld. Any modifications to this file will be
|
||||
# overwritten whenever makefiles are re-generated.
|
||||
#
|
||||
|
||||
unexport MAKEFILE_LIST
|
||||
MK_NOGENDEPS := $(filter clean,$(MAKECMDGOALS))
|
||||
override PKGDIR = xconfig_app_ble
|
||||
XDCINCS = -I. -I$(strip $(subst ;, -I,$(subst $(space),\$(space),$(XPKGPATH))))
|
||||
XDCCFGDIR = package/cfg/
|
||||
|
||||
#
|
||||
# The following dependencies ensure package.mak is rebuilt
|
||||
# in the event that some included BOM script changes.
|
||||
#
|
||||
ifneq (clean,$(MAKECMDGOALS))
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/utils.js:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/utils.js
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/xdc.tci:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/xdc.tci
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/template.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/template.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/om2.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/om2.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/xmlgen.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/xmlgen.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/xmlgen2.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/xmlgen2.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/Warnings.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/Warnings.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/IPackage.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/IPackage.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/package.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/package.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/global/Clock.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/global/Clock.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/global/Trace.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/global/Trace.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/bld.js:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/bld.js
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/BuildEnvironment.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/BuildEnvironment.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/PackageContents.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/PackageContents.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/_gen.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/_gen.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/Library.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/Library.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/Executable.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/Executable.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/Repository.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/Repository.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/Configuration.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/Configuration.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/Script.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/Script.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/Manifest.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/Manifest.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/Utils.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/Utils.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/ITarget.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/ITarget.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/ITarget2.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/ITarget2.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/ITarget3.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/ITarget3.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/ITargetFilter.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/ITargetFilter.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/package.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/bld/package.xs
|
||||
package.mak: config.bld
|
||||
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/ITarget.xs:
|
||||
package.mak: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/ITarget.xs
|
||||
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/C28_large.xs:
|
||||
package.mak: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/C28_large.xs
|
||||
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/C28_float.xs:
|
||||
package.mak: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/C28_float.xs
|
||||
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/package.xs:
|
||||
package.mak: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/package.xs
|
||||
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/IArm.xs:
|
||||
package.mak: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/IArm.xs
|
||||
C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/package.xs:
|
||||
package.mak: C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/package.xs
|
||||
package.mak: package.bld
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/tools/configuro/template/compiler.opt.xdt:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/tools/configuro/template/compiler.opt.xdt
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/io/File.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/io/File.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/io/package.xs:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/io/package.xs
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/tools/configuro/template/compiler.defs.xdt:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/tools/configuro/template/compiler.defs.xdt
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/tools/configuro/template/custom.mak.exe.xdt:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/tools/configuro/template/custom.mak.exe.xdt
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/tools/configuro/template/package.xs.xdt:
|
||||
package.mak: C:/ti/xdctools_3_32_02_25_core/packages/xdc/tools/configuro/template/package.xs.xdt
|
||||
endif
|
||||
|
||||
ti.targets.arm.elf.M3.rootDir ?= C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.6.LTS
|
||||
ti.targets.arm.elf.packageBase ?= C:/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/packages/ti/targets/arm/elf/
|
||||
.PRECIOUS: $(XDCCFGDIR)/%.oem3
|
||||
.PHONY: all,em3 .dlls,em3 .executables,em3 test,em3
|
||||
all,em3: .executables,em3
|
||||
.executables,em3: .libraries,em3
|
||||
.executables,em3: .dlls,em3
|
||||
.dlls,em3: .libraries,em3
|
||||
.libraries,em3: .interfaces
|
||||
@$(RM) $@
|
||||
@$(TOUCH) "$@"
|
||||
|
||||
.help::
|
||||
@$(ECHO) xdc test,em3
|
||||
@$(ECHO) xdc .executables,em3
|
||||
@$(ECHO) xdc .libraries,em3
|
||||
@$(ECHO) xdc .dlls,em3
|
||||
|
||||
|
||||
all: .executables
|
||||
.executables: .libraries .dlls
|
||||
.libraries: .interfaces
|
||||
|
||||
PKGCFGS := $(wildcard package.xs) package/build.cfg
|
||||
.interfaces: package/package.xdc.inc package/package.defs.h package.xdc $(PKGCFGS)
|
||||
|
||||
-include package/package.xdc.dep
|
||||
package/%.xdc.inc package/%_xconfig_app_ble.c package/%.defs.h: %.xdc $(PKGCFGS)
|
||||
@$(MSG) generating interfaces for package xconfig_app_ble" (because $@ is older than $(firstword $?))" ...
|
||||
$(XSRUN) -f xdc/services/intern/cmd/build.xs $(MK_IDLOPTS) -m package/package.xdc.dep -i package/package.xdc.inc package.xdc
|
||||
|
||||
.dlls,em3 .dlls: app_ble.pem3
|
||||
|
||||
-include package/cfg/app_ble_pem3.mak
|
||||
-include package/cfg/app_ble_pem3.cfg.mak
|
||||
ifeq (,$(MK_NOGENDEPS))
|
||||
-include package/cfg/app_ble_pem3.dep
|
||||
endif
|
||||
app_ble.pem3: package/cfg/app_ble_pem3.xdl
|
||||
@
|
||||
|
||||
|
||||
ifeq (,$(wildcard .libraries,em3))
|
||||
app_ble.pem3 package/cfg/app_ble_pem3.c: .libraries,em3
|
||||
endif
|
||||
|
||||
package/cfg/app_ble_pem3.c package/cfg/app_ble_pem3.h package/cfg/app_ble_pem3.xdl: override _PROG_NAME := app_ble.xem3
|
||||
package/cfg/app_ble_pem3.c: package/cfg/app_ble_pem3.cfg
|
||||
package/cfg/app_ble_pem3.xdc.inc: package/cfg/app_ble_pem3.xdl
|
||||
package/cfg/app_ble_pem3.xdl package/cfg/app_ble_pem3.c: .interfaces
|
||||
|
||||
clean:: clean,em3
|
||||
-$(RM) package/cfg/app_ble_pem3.cfg
|
||||
-$(RM) package/cfg/app_ble_pem3.dep
|
||||
-$(RM) package/cfg/app_ble_pem3.c
|
||||
-$(RM) package/cfg/app_ble_pem3.xdc.inc
|
||||
|
||||
clean,em3::
|
||||
-$(RM) app_ble.pem3
|
||||
.executables,em3 .executables: app_ble.xem3
|
||||
|
||||
app_ble.xem3: |app_ble.pem3
|
||||
|
||||
-include package/cfg/app_ble.xem3.mak
|
||||
app_ble.xem3: package/cfg/app_ble_pem3.oem3
|
||||
$(RM) $@
|
||||
@$(MSG) lnkem3 $@ ...
|
||||
$(RM) $(XDCCFGDIR)/$@.map
|
||||
$(ti.targets.arm.elf.M3.rootDir)/bin/armcl -fs $(XDCCFGDIR)$(dir $@). -q -u _c_int00 --silicon_version=7M3 -z --strict_compatibility=on -o $@ package/cfg/app_ble_pem3.oem3 package/cfg/app_ble_pem3.xdl -w -c -m $(XDCCFGDIR)/$@.map -l $(ti.targets.arm.elf.M3.rootDir)/lib/libc.a
|
||||
|
||||
app_ble.xem3: export C_DIR=
|
||||
app_ble.xem3: PATH:=$(ti.targets.arm.elf.M3.rootDir)/bin/;$(PATH)
|
||||
app_ble.xem3: Path:=$(ti.targets.arm.elf.M3.rootDir)/bin/;$(PATH)
|
||||
|
||||
app_ble.test test,em3 test: app_ble.xem3.test
|
||||
|
||||
app_ble.xem3.test:: app_ble.xem3
|
||||
ifeq (,$(_TESTLEVEL))
|
||||
@$(MAKE) -R -r --no-print-directory -f $(XDCROOT)/packages/xdc/bld/xdc.mak _TESTLEVEL=1 app_ble.xem3.test
|
||||
else
|
||||
@$(MSG) running $< ...
|
||||
$(call EXEC.app_ble.xem3, )
|
||||
endif
|
||||
|
||||
clean,em3::
|
||||
-$(RM) $(wildcard .tmp,app_ble.xem3,*)
|
||||
|
||||
|
||||
clean:: clean,em3
|
||||
|
||||
clean,em3::
|
||||
-$(RM) app_ble.xem3
|
||||
%,copy:
|
||||
@$(if $<,,$(MSG) don\'t know how to build $*; exit 1)
|
||||
@$(MSG) cp $< $@
|
||||
$(RM) $@
|
||||
$(CP) $< $@
|
||||
app_ble_pem3.oem3,copy : package/cfg/app_ble_pem3.oem3
|
||||
app_ble_pem3.sem3,copy : package/cfg/app_ble_pem3.sem3
|
||||
|
||||
$(XDCCFGDIR)%.c $(XDCCFGDIR)%.h $(XDCCFGDIR)%.xdl: $(XDCCFGDIR)%.cfg $(XDCROOT)/packages/xdc/cfg/Main.xs | .interfaces
|
||||
@$(MSG) "configuring $(_PROG_NAME) from $< ..."
|
||||
$(CONFIG) $(_PROG_XSOPTS) xdc.cfg $(_PROG_NAME) $(XDCCFGDIR)$*.cfg $(XDCCFGDIR)$*
|
||||
|
||||
.PHONY: release,xconfig_app_ble
|
||||
ifeq (,$(MK_NOGENDEPS))
|
||||
-include package/rel/xconfig_app_ble.tar.dep
|
||||
endif
|
||||
package/rel/xconfig_app_ble/xconfig_app_ble/package/package.rel.xml: package/package.bld.xml
|
||||
package/rel/xconfig_app_ble/xconfig_app_ble/package/package.rel.xml: package/build.cfg
|
||||
package/rel/xconfig_app_ble/xconfig_app_ble/package/package.rel.xml: package/package.xdc.inc
|
||||
package/rel/xconfig_app_ble/xconfig_app_ble/package/package.rel.xml: .force
|
||||
@$(MSG) generating external release references $@ ...
|
||||
$(XS) $(JSENV) -f $(XDCROOT)/packages/xdc/bld/rel.js $(MK_RELOPTS) . $@
|
||||
|
||||
xconfig_app_ble.tar: package/rel/xconfig_app_ble.xdc.inc package/rel/xconfig_app_ble/xconfig_app_ble/package/package.rel.xml
|
||||
@$(MSG) making release file $@ "(because of $(firstword $?))" ...
|
||||
-$(RM) $@
|
||||
$(call MKRELTAR,package/rel/xconfig_app_ble.xdc.inc,package/rel/xconfig_app_ble.tar.dep)
|
||||
|
||||
|
||||
release release,xconfig_app_ble: all xconfig_app_ble.tar
|
||||
clean:: .clean
|
||||
-$(RM) xconfig_app_ble.tar
|
||||
-$(RM) package/rel/xconfig_app_ble.xdc.inc
|
||||
-$(RM) package/rel/xconfig_app_ble.tar.dep
|
||||
|
||||
clean:: .clean
|
||||
-$(RM) .libraries $(wildcard .libraries,*)
|
||||
clean::
|
||||
-$(RM) .dlls $(wildcard .dlls,*)
|
||||
#
|
||||
# The following clean rule removes user specified
|
||||
# generated files or directories.
|
||||
#
|
||||
|
||||
ifneq (clean,$(MAKECMDGOALS))
|
||||
ifeq (,$(wildcard package))
|
||||
$(shell $(MKDIR) package)
|
||||
endif
|
||||
ifeq (,$(wildcard package/cfg))
|
||||
$(shell $(MKDIR) package/cfg)
|
||||
endif
|
||||
ifeq (,$(wildcard package/lib))
|
||||
$(shell $(MKDIR) package/lib)
|
||||
endif
|
||||
ifeq (,$(wildcard package/rel))
|
||||
$(shell $(MKDIR) package/rel)
|
||||
endif
|
||||
ifeq (,$(wildcard package/internal))
|
||||
$(shell $(MKDIR) package/internal)
|
||||
endif
|
||||
endif
|
||||
clean::
|
||||
-$(RMDIR) package
|
||||
|
||||
include custom.mak
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* Package generated by xdc.tools.configuro
|
||||
*
|
||||
* @_nodoc
|
||||
*/
|
||||
package xconfig_app_ble {
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/* THIS IS A GENERATED FILE -- DO NOT EDIT */
|
||||
|
||||
/* return the names of the generated config objects */
|
||||
function getLibs(prog) {
|
||||
/* for programs, push the generated config object file into the
|
||||
* generated linker command file.
|
||||
*/
|
||||
/* replace the last period in the name by an underscore */
|
||||
var name = "package/cfg/" + prog.name.replace(/\.([^.]*)$/, "_$1");
|
||||
/* base is a hack until we add cfgName to Program */
|
||||
var base = "package/cfg/" + prog.name.replace(/\.([^.]*)$/, "");
|
||||
var suffix = prog.build.target.suffix;
|
||||
|
||||
var libs = [
|
||||
// name + '.o' + suffix,
|
||||
base + '_p' + suffix + '.o' + suffix
|
||||
];
|
||||
|
||||
return libs.join(';');
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
if (pkg.$vers.length >= 3) {
|
||||
pkg.$vers.push(Packages.xdc.services.global.Vers.getDate(xdc.csd() + '/..'));
|
||||
}
|
||||
|
||||
pkg.build.libraries = [
|
||||
];
|
||||
|
||||
pkg.build.libDesc = [
|
||||
];
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Do not edit this file. This file is generated from
|
||||
# package.bld. Any modifications to this file will be
|
||||
# overwritten whenever makefiles are re-generated.
|
||||
#
|
||||
# target compatibility key = ti.targets.arm.elf.M3{1,0,18.1,6
|
||||
#
|
||||
app_ble.xem3: package/cfg/app_ble.xem3.mak
|
||||
|
||||
clean::
|
||||
-$(RM) package/cfg/app_ble.xem3.mak
|
||||
+264
@@ -0,0 +1,264 @@
|
||||
/*
|
||||
* ======== package/cfg/app_ble_pem3.cfg ========
|
||||
* This generated configuration script runs the user's configuration script
|
||||
* the context of a specific target and platform in order to generate
|
||||
* all the files necessary to create an executable; e.g., linker command
|
||||
* files, static C/C++ data structures, etc.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ======== _applyChanges ========
|
||||
* Changes that bring the build target to the state at the end of the build
|
||||
* model
|
||||
*/
|
||||
function _applyChanges(obj, chgObj) {
|
||||
var wasSealed = false;
|
||||
if (obj.$sealed) {
|
||||
wasSealed = true;
|
||||
obj.$unseal();
|
||||
}
|
||||
for (var prop in chgObj) {
|
||||
if (typeof obj[prop] == 'object' && obj[prop] != undefined) {
|
||||
if ("$category" in obj[prop] && obj[prop].$category == "Vector") {
|
||||
obj[prop].length = chgObj[prop].length;
|
||||
for (var i = 0; i < chgObj[prop].length; i++) {
|
||||
if (obj[prop].length < i + 1) {
|
||||
obj[prop].length++;
|
||||
}
|
||||
obj[prop][i] = chgObj[prop][i];
|
||||
}
|
||||
}
|
||||
else {
|
||||
_applyChanges(obj[prop], chgObj[prop]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
obj[prop] = chgObj[prop];
|
||||
}
|
||||
}
|
||||
if (wasSealed) {
|
||||
obj.$seal();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ======== _runescape ========
|
||||
* Recursive unescape to decode serialized strings
|
||||
*/
|
||||
function _runescape(obj) {
|
||||
for (var i in obj) {
|
||||
if (obj[i] != null) {
|
||||
if (typeof obj[i] == 'string') {
|
||||
obj[i] = unescape(obj[i]);
|
||||
}
|
||||
else if (typeof obj[i] == 'object') {
|
||||
_runescape(obj[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ======== _getPlatCfg ========
|
||||
*/
|
||||
function _getPlatCfg() {
|
||||
var tmp = {};
|
||||
_runescape(tmp);
|
||||
return (tmp);
|
||||
}
|
||||
/*
|
||||
* ======== _cfginit ========
|
||||
*/
|
||||
function _cfginit() {
|
||||
xdc.loadPackage('xdc.services.intern.cmd');
|
||||
var prog = xdc.om['xdc.cfg.Program'];
|
||||
|
||||
/* initialize prog attrs from build model */
|
||||
var build = {
|
||||
profile: "release",
|
||||
cfgScript: "C%3A/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/config/app_ble.cfg",
|
||||
cfgHome: "xconfig_app_ble",
|
||||
cfgArgs: "null",
|
||||
cfgArgsEncoded: true,
|
||||
releases: {
|
||||
0: {
|
||||
name: "xconfig_app_ble",
|
||||
attrs: {
|
||||
prefix: "",
|
||||
label: "default"
|
||||
},
|
||||
otherFiles: {},
|
||||
excludeDirs: {}
|
||||
}
|
||||
},
|
||||
prelink: false
|
||||
};
|
||||
_runescape(build);
|
||||
build.cfgArgs = null;
|
||||
build.target = xdc.module("ti.targets.arm.elf.M3");
|
||||
var targChange = {
|
||||
platforms: [
|
||||
"ti.platforms.simCM3"
|
||||
],
|
||||
version: "ti.targets.arm.elf.M3%7B1%2C0%2C18.1%2C6",
|
||||
extensions: {
|
||||
".sem3e": {
|
||||
suf: ".sem3e",
|
||||
typ: "asm"
|
||||
},
|
||||
".sem3": {
|
||||
suf: ".sem3",
|
||||
typ: "asm"
|
||||
},
|
||||
".sv7M": {
|
||||
suf: ".sv7M",
|
||||
typ: "asm"
|
||||
}
|
||||
},
|
||||
rootDir: "C%3A/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.6.LTS",
|
||||
ccOpts: {
|
||||
prefix: "-mv7M3%20--code_state%3D16%20-me%20-O4%20--opt_for_speed%3D0%20--include_path%3D%22C%3A/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.6.LTS/include%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app/headstage%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/examples/simple_peripheral/cc26xx/app%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/inc%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/icall/inc%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles/cc26xx%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/roles%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/dev_info%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile/cc26xx%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/profiles/simple_profile%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/common/cc26xx%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/heapmgr%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/controller/cc26xx/inc%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/target%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/target/_common/cc26xx%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/hal/src/inc%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/osal/src/inc%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/sdata%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/services/src/saddr%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/components/icall/src/inc%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/inc%22%20--include_path%3D%22C%3A/ti/simplelink/ble_sdk_2_02_02_25/src/rom%22%20--include_path%3D%22C%3A/ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/cc26xxware_2_24_03_17272%22%20--define%3DBOARD_DISPLAY_EXCLUDE_UART%20--define%3DPOWER_SAVING%20--define%3DBOOSTXL_CC2650MA%20--define%3DHEADSTAGE_MA_USE_SPI2%20--define%3DHEADSTAGE_MA_USE_ADC%20--define%3DCC26XX%20--define%3DGAPROLE_TASK_STACK_SIZE%3D540%20--define%3DHEAPMGR_SIZE%3D0%20--define%3DICALL_MAX_NUM_ENTITIES%3D6%20--define%3DICALL_MAX_NUM_TASKS%3D3%20--define%3DUSE_ICALL%20--define%3DxBOARD_DISPLAY_EXCLUDE_LCD%20--define%3DxDisplay_DISABLE_ALL%20--define%3Dxdc_runtime_Assert_DISABLE_ALL%20--define%3Dxdc_runtime_Log_DISABLE_ALL%20-g%20--c99%20--gcc%20--diag_suppress%3D48%20--diag_warning%3D225%20--diag_wrap%3Doff%20--display_error_number%20--gen_func_subsections%3Don%20--abi%3Deabi%20%20-qq%20-pdsw225"
|
||||
},
|
||||
rawVersion: "18.1.6"
|
||||
};
|
||||
_runescape(targChange);
|
||||
_applyChanges(build.target, targChange);
|
||||
|
||||
prog.build = build;
|
||||
|
||||
prog.name = "app_ble.xem3";
|
||||
prog.cfgBase = "package/cfg/app_ble_pem3";
|
||||
|
||||
prog.endian = prog.build.target.model.endian;
|
||||
prog.codeModel = prog.build.target.model.codeModel;
|
||||
|
||||
/* use the platform package's Platform module */
|
||||
var Platform = xdc.useModule("ti.platforms.simplelink.Platform");
|
||||
var platParams = _getPlatCfg();
|
||||
var invalidParams = [];
|
||||
for (var prop in platParams) {
|
||||
if (!(prop in Platform.PARAMS)) {
|
||||
delete platParams[prop];
|
||||
invalidParams.push(prop);
|
||||
}
|
||||
}
|
||||
prog.platformName = "ti.platforms.simplelink:CC2640F128";
|
||||
prog.platform = Platform.create("CC2640F128", platParams);
|
||||
for (var i = 0; i < invalidParams.length; i++) {
|
||||
Platform.$logWarning("The parameter '" + invalidParams[i] + "' is " +
|
||||
"passed to this platform instance through Build.platformTable, " +
|
||||
"but the instance does not have a configuration parameter with " +
|
||||
"that name.", prog.platform, "CC2640F128");
|
||||
}
|
||||
|
||||
/* record the executable's package name */
|
||||
prog.buildPackage = "xconfig_app_ble";
|
||||
|
||||
/* record build-model information required during config generation */
|
||||
prog.$$bind("$$isasm", 0);
|
||||
prog.$$bind("$$isrom", 0);
|
||||
prog.$$bind("$$gentab", [
|
||||
]);
|
||||
|
||||
/* bind prog to an appropriate execution context */
|
||||
prog.cpu = prog.platform.getExeContext(prog);
|
||||
|
||||
/* import the target's run-time support pkg */
|
||||
xdc.loadPackage("ti.targets.arm.rtsarm");
|
||||
}
|
||||
|
||||
/* function to import the cfg script's package */
|
||||
function _userscript(script) {
|
||||
var home;
|
||||
var spath;
|
||||
home = xdc.loadPackage("xconfig_app_ble");
|
||||
|
||||
xdc.om.$$bind('$homepkg', home);
|
||||
|
||||
var cfgScript = "C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/config/app_ble.cfg";
|
||||
if (!script) {
|
||||
utils.loadCapsule(cfgScript, false, spath);
|
||||
}
|
||||
else {
|
||||
/* set up the same environment that loadCapsule would */
|
||||
var $saveCsd = utils.csd;
|
||||
var $cfgFile = utils.findFile(cfgScript, spath);
|
||||
var cname = cfgScript;
|
||||
if ($cfgFile) {
|
||||
$cfgFile = java.io.File($cfgFile);
|
||||
utils.csd = $cfgFile.getParentFile().getCanonicalPath();
|
||||
cname = "" + $cfgFile.getCanonicalPath();
|
||||
}
|
||||
|
||||
/* create the capsule object */
|
||||
var cap = {
|
||||
prototype: utils.global,
|
||||
$path: cname,
|
||||
$private: {path: cname},
|
||||
$capsule: undefined, /* set to cap below */
|
||||
};
|
||||
|
||||
/* 'this.$capsule' is always cap object */
|
||||
cap.$capsule = cap;
|
||||
|
||||
/* save the capsule object */
|
||||
utils.$$capmap[cname] = cap;
|
||||
|
||||
try {
|
||||
var cx =
|
||||
Packages.org.mozilla.javascript.Context.getCurrentContext();
|
||||
var rdr = new
|
||||
java.io.BufferedReader(new java.io.StringReader(script));
|
||||
Packages.config.Shell.evaluateLoad(cx, cap, rdr, cname, 1);
|
||||
}
|
||||
finally {
|
||||
rdr.close();
|
||||
utils.csd = $saveCsd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _postinit() {
|
||||
var cout = null;
|
||||
|
||||
var Program = xdc.om['xdc.cfg.Program'];
|
||||
/* get the exec command for this executable */
|
||||
if (Program.execCmd == null) {
|
||||
Program.execCmd = Program.platform.getExecCmd(Program,
|
||||
xdc.om["ti.platforms.simplelink"].packageBase);
|
||||
}
|
||||
cout = "define EXEC." + Program.name + '\n\n';
|
||||
cout += Program.execCmd;
|
||||
cout += "\nendef\n\n";
|
||||
|
||||
/* if SourceDir generates a makefile, we need to run it */
|
||||
_genSourceDirMak("package/cfg/app_ble_pem3", "app_ble.pem3");
|
||||
|
||||
utils.genDep("package/cfg/app_ble_pem3", "xconfig_app_ble", utils.loadedFiles, cout, null);
|
||||
}
|
||||
|
||||
function _genSourceDirMak(cfgBase, cfgName)
|
||||
{
|
||||
var SourceDir = xdc.om['xdc.cfg.SourceDir'];
|
||||
|
||||
if (SourceDir && SourceDir.$instances.length > 0) {
|
||||
/* construct rule to run SourceDir generated makefile */
|
||||
var make = "\t$(MAKE) -f "
|
||||
+ SourceDir.outputDir + "/" + SourceDir.makefileName;
|
||||
|
||||
/* this file is included by package.mak (if it exists) */
|
||||
var file = new java.io.File(cfgBase + ".cfg.mak");
|
||||
file["delete"]();
|
||||
var out = new java.io.BufferedWriter(new java.io.FileWriter(file));
|
||||
|
||||
/* add rules to run SourceDir generated makefile */
|
||||
out.write("# invoke SourceDir generated makefile for " + cfgName
|
||||
+ "\n" + cfgName + ": .libraries," + cfgName
|
||||
+ "\n.libraries," + cfgName + ": " + cfgBase + ".xdl\n"
|
||||
+ make + "\n\n"
|
||||
+ "clean::\n" + make + " clean\n\n"
|
||||
);
|
||||
out.close();
|
||||
out = null;
|
||||
}
|
||||
}
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# Do not edit this file. This file is generated from
|
||||
# package.bld. Any modifications to this file will be
|
||||
# overwritten whenever makefiles are re-generated.
|
||||
#
|
||||
# target compatibility key = ti.targets.arm.elf.M3{1,0,18.1,6
|
||||
#
|
||||
ifeq (,$(MK_NOGENDEPS))
|
||||
-include package/cfg/app_ble_pem3.oem3.dep
|
||||
package/cfg/app_ble_pem3.oem3.dep: ;
|
||||
endif
|
||||
|
||||
package/cfg/app_ble_pem3.oem3: | .interfaces
|
||||
package/cfg/app_ble_pem3.oem3: package/cfg/app_ble_pem3.c package/cfg/app_ble_pem3.mak
|
||||
@$(RM) $@.dep
|
||||
$(RM) $@
|
||||
@$(MSG) clem3 $< ...
|
||||
$(ti.targets.arm.elf.M3.rootDir)/bin/armcl -c -mv7M3 --code_state=16 -me -O4 --opt_for_speed=0 --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.6.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" --define=BOARD_DISPLAY_EXCLUDE_UART --define=POWER_SAVING --define=BOOSTXL_CC2650MA --define=HEADSTAGE_MA_USE_SPI2 --define=HEADSTAGE_MA_USE_ADC --define=CC26XX --define=GAPROLE_TASK_STACK_SIZE=540 --define=HEAPMGR_SIZE=0 --define=ICALL_MAX_NUM_ENTITIES=6 --define=ICALL_MAX_NUM_TASKS=3 --define=USE_ICALL --define=xBOARD_DISPLAY_EXCLUDE_LCD --define=xDisplay_DISABLE_ALL --define=xdc_runtime_Assert_DISABLE_ALL --define=xdc_runtime_Log_DISABLE_ALL -g --c99 --gcc --diag_suppress=48 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -qq -pdsw225 -ms --fp_mode=strict --endian=little -mv7M3 --abi=eabi -eo.oem3 -ea.sem3 -Dxdc_cfg__xheader__='"xconfig_app_ble/package/cfg/app_ble_pem3.h"' -Dxdc_target_name__=M3 -Dxdc_target_types__=ti/targets/arm/elf/std.h -Dxdc_bld__profile_release -Dxdc_bld__vers_1_0_18_1_6 -O2 $(XDCINCS) -I$(ti.targets.arm.elf.M3.rootDir)/include -fs=./package/cfg -fr=./package/cfg -fc $<
|
||||
$(MKDEP) -a $@.dep -p package/cfg -s oem3 $< -C -mv7M3 --code_state=16 -me -O4 --opt_for_speed=0 --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.6.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" --define=BOARD_DISPLAY_EXCLUDE_UART --define=POWER_SAVING --define=BOOSTXL_CC2650MA --define=HEADSTAGE_MA_USE_SPI2 --define=HEADSTAGE_MA_USE_ADC --define=CC26XX --define=GAPROLE_TASK_STACK_SIZE=540 --define=HEAPMGR_SIZE=0 --define=ICALL_MAX_NUM_ENTITIES=6 --define=ICALL_MAX_NUM_TASKS=3 --define=USE_ICALL --define=xBOARD_DISPLAY_EXCLUDE_LCD --define=xDisplay_DISABLE_ALL --define=xdc_runtime_Assert_DISABLE_ALL --define=xdc_runtime_Log_DISABLE_ALL -g --c99 --gcc --diag_suppress=48 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -qq -pdsw225 -ms --fp_mode=strict --endian=little -mv7M3 --abi=eabi -eo.oem3 -ea.sem3 -Dxdc_cfg__xheader__='"xconfig_app_ble/package/cfg/app_ble_pem3.h"' -Dxdc_target_name__=M3 -Dxdc_target_types__=ti/targets/arm/elf/std.h -Dxdc_bld__profile_release -Dxdc_bld__vers_1_0_18_1_6 -O2 $(XDCINCS) -I$(ti.targets.arm.elf.M3.rootDir)/include -fs=./package/cfg -fr=./package/cfg
|
||||
-@$(FIXDEP) $@.dep $@.dep
|
||||
|
||||
package/cfg/app_ble_pem3.oem3: export C_DIR=
|
||||
package/cfg/app_ble_pem3.oem3: PATH:=$(ti.targets.arm.elf.M3.rootDir)/bin/;$(PATH)
|
||||
package/cfg/app_ble_pem3.oem3: Path:=$(ti.targets.arm.elf.M3.rootDir)/bin/;$(PATH)
|
||||
|
||||
package/cfg/app_ble_pem3.sem3: | .interfaces
|
||||
package/cfg/app_ble_pem3.sem3: package/cfg/app_ble_pem3.c package/cfg/app_ble_pem3.mak
|
||||
@$(RM) $@.dep
|
||||
$(RM) $@
|
||||
@$(MSG) clem3 -n $< ...
|
||||
$(ti.targets.arm.elf.M3.rootDir)/bin/armcl -c -n -s --symdebug:none -mv7M3 --code_state=16 -me -O4 --opt_for_speed=0 --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.6.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" --define=BOARD_DISPLAY_EXCLUDE_UART --define=POWER_SAVING --define=BOOSTXL_CC2650MA --define=HEADSTAGE_MA_USE_SPI2 --define=HEADSTAGE_MA_USE_ADC --define=CC26XX --define=GAPROLE_TASK_STACK_SIZE=540 --define=HEAPMGR_SIZE=0 --define=ICALL_MAX_NUM_ENTITIES=6 --define=ICALL_MAX_NUM_TASKS=3 --define=USE_ICALL --define=xBOARD_DISPLAY_EXCLUDE_LCD --define=xDisplay_DISABLE_ALL --define=xdc_runtime_Assert_DISABLE_ALL --define=xdc_runtime_Log_DISABLE_ALL -g --c99 --gcc --diag_suppress=48 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -qq -pdsw225 --endian=little -mv7M3 --abi=eabi -eo.oem3 -ea.sem3 -Dxdc_cfg__xheader__='"xconfig_app_ble/package/cfg/app_ble_pem3.h"' -Dxdc_target_name__=M3 -Dxdc_target_types__=ti/targets/arm/elf/std.h -Dxdc_bld__profile_release -Dxdc_bld__vers_1_0_18_1_6 -O2 $(XDCINCS) -I$(ti.targets.arm.elf.M3.rootDir)/include -fs=./package/cfg -fr=./package/cfg -fc $<
|
||||
$(MKDEP) -a $@.dep -p package/cfg -s oem3 $< -C -n -s --symdebug:none -mv7M3 --code_state=16 -me -O4 --opt_for_speed=0 --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.6.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" --define=BOARD_DISPLAY_EXCLUDE_UART --define=POWER_SAVING --define=BOOSTXL_CC2650MA --define=HEADSTAGE_MA_USE_SPI2 --define=HEADSTAGE_MA_USE_ADC --define=CC26XX --define=GAPROLE_TASK_STACK_SIZE=540 --define=HEAPMGR_SIZE=0 --define=ICALL_MAX_NUM_ENTITIES=6 --define=ICALL_MAX_NUM_TASKS=3 --define=USE_ICALL --define=xBOARD_DISPLAY_EXCLUDE_LCD --define=xDisplay_DISABLE_ALL --define=xdc_runtime_Assert_DISABLE_ALL --define=xdc_runtime_Log_DISABLE_ALL -g --c99 --gcc --diag_suppress=48 --diag_warning=225 --diag_wrap=off --display_error_number --gen_func_subsections=on --abi=eabi -qq -pdsw225 --endian=little -mv7M3 --abi=eabi -eo.oem3 -ea.sem3 -Dxdc_cfg__xheader__='"xconfig_app_ble/package/cfg/app_ble_pem3.h"' -Dxdc_target_name__=M3 -Dxdc_target_types__=ti/targets/arm/elf/std.h -Dxdc_bld__profile_release -Dxdc_bld__vers_1_0_18_1_6 -O2 $(XDCINCS) -I$(ti.targets.arm.elf.M3.rootDir)/include -fs=./package/cfg -fr=./package/cfg
|
||||
-@$(FIXDEP) $@.dep $@.dep
|
||||
|
||||
package/cfg/app_ble_pem3.sem3: export C_DIR=
|
||||
package/cfg/app_ble_pem3.sem3: PATH:=$(ti.targets.arm.elf.M3.rootDir)/bin/;$(PATH)
|
||||
package/cfg/app_ble_pem3.sem3: Path:=$(ti.targets.arm.elf.M3.rootDir)/bin/;$(PATH)
|
||||
|
||||
clean,em3 ::
|
||||
-$(RM) package/cfg/app_ble_pem3.oem3
|
||||
-$(RM) package/cfg/app_ble_pem3.sem3
|
||||
|
||||
app_ble.pem3: package/cfg/app_ble_pem3.oem3 package/cfg/app_ble_pem3.mak
|
||||
|
||||
clean::
|
||||
-$(RM) package/cfg/app_ble_pem3.mak
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
<?xml version="1.0" encoding="x-windows-950"?>
|
||||
<!-- This file conforms to the DTD xdc/bld/build.dtd -->
|
||||
<package name="xconfig_app_ble" version="" producerId="undefined">
|
||||
<units>
|
||||
</units>
|
||||
<sources>
|
||||
<srcFile name="package/cfg/app_ble_pem3.c"/>
|
||||
</sources>
|
||||
<configscripts>
|
||||
<srcFile name="C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/config/app_ble.cfg"/>
|
||||
</configscripts>
|
||||
<makefiles>
|
||||
<srcFile name="package.mak" src="package.bld"/>
|
||||
<srcFile name="package/package.xdc.dep" src="package.xdc"/>
|
||||
<srcFile name="package/cfg/app_ble_pem3.mak" src="package.bld"/>
|
||||
<srcFile name="package/cfg/app_ble_pem3.oem3.dep" src="package/cfg/app_ble_pem3.c"/>
|
||||
<srcFile name="package/cfg/app_ble_pem3.dep" src="package/cfg/app_ble_pem3.cfg"/>
|
||||
<srcFile name="package/cfg/app_ble.xem3.mak" src="package.bld"/>
|
||||
<srcFile name="package/rel/xconfig_app_ble.tar.dep" src="package/rel/xconfig_app_ble.xdc.inc"/>
|
||||
</makefiles>
|
||||
<targets>
|
||||
<target name="ti.targets.arm.elf.M3"
|
||||
version="ti.targets.arm.elf.M3{1,0,18.1,6"
|
||||
rawVersion="18.1.6"
|
||||
platform="ti.platforms.simCM3"
|
||||
isa="v7M"
|
||||
suffix="em3"
|
||||
rootDir="C:/ti/ccsv8/tools/compiler/ti-cgt-arm_18.1.6.LTS"
|
||||
os="undefined"
|
||||
rts="ti.targets.arm.rtsarm">
|
||||
<model endian="little"
|
||||
codeModel="thumb2"
|
||||
dataModel="undefined"/>
|
||||
</target>
|
||||
</targets>
|
||||
<libraries>
|
||||
</libraries>
|
||||
<configurations>
|
||||
<configuration name="app_ble"
|
||||
pname="app_ble.pem3"
|
||||
target="ti.targets.arm.elf.M3"
|
||||
platform="ti.platforms.simplelink:CC2640F128"
|
||||
profile="release"
|
||||
isPartial="false"
|
||||
xCfgScript="package/cfg/app_ble_pem3.cfg"
|
||||
xCfgPrefix="package/cfg/app_ble_pem3"
|
||||
cfgScript="C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/config/app_ble.cfg"
|
||||
cfgArgs="null"
|
||||
/>
|
||||
</configurations>
|
||||
<executables>
|
||||
<executable name="app_ble"
|
||||
pname="app_ble.xem3"
|
||||
target="ti.targets.arm.elf.M3"
|
||||
platform="ti.platforms.simplelink:CC2640F128"
|
||||
profile="release"
|
||||
xCfgScript="package/cfg/app_ble_pem3.cfg"
|
||||
xCfgPrefix="package/cfg/app_ble_pem3"
|
||||
cfgScript="C:/ti/simplelink/ble_sdk_2_02_02_25/examples/cc2650em/simple_peripheral/ccs/config/app_ble.cfg"
|
||||
cfgArgs="null"
|
||||
/>
|
||||
</executables>
|
||||
<tests>
|
||||
<test exeName="app_ble.xem3"
|
||||
args=""
|
||||
groupName="app_ble.xem3"
|
||||
refOutput="undefined"
|
||||
refExitCode="0"
|
||||
execArgs=""
|
||||
/>
|
||||
</tests>
|
||||
<releases relDir="package/rel/">
|
||||
<release name="xconfig_app_ble"
|
||||
pname="xconfig_app_ble.tar"
|
||||
label="default"
|
||||
>
|
||||
<file name="package/package.bld.xml"/>
|
||||
<file name="package/build.cfg"/>
|
||||
<file name="package/package.xdc.inc"/>
|
||||
</release>
|
||||
</releases>
|
||||
<repositories>
|
||||
</repositories>
|
||||
</package>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Do not modify this file; it is automatically
|
||||
* generated and any modifications will be overwritten.
|
||||
*
|
||||
* @(#) xdc-B24
|
||||
*/
|
||||
|
||||
#ifndef xconfig_app_ble__
|
||||
#define xconfig_app_ble__
|
||||
|
||||
|
||||
|
||||
#endif /* xconfig_app_ble__ */
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
clean::
|
||||
$(RM) package/xconfig_app_ble.sch
|
||||
$(RM) package/.vers_g180
|
||||
$(RM) package/.vers_r170
|
||||
$(RM) package/.vers_b160
|
||||
$(RM) package/.xdc-B24
|
||||
$(RM) package/xconfig_app_ble.java
|
||||
$(RM) package/xconfig_app_ble.class
|
||||
$(RM) package/package_xconfig_app_ble.c
|
||||
$(RM) package/package.defs.h
|
||||
$(RM) package/xconfig_app_ble.ccs
|
||||
|
||||
.interfaces: package/xconfig_app_ble.sch package/.vers_g180 package/.vers_r170 package/.vers_b160 package/.xdc-B24 package/xconfig_app_ble.java package/package_xconfig_app_ble.c package/package.defs.h package/xconfig_app_ble.ccs
|
||||
package/package.xdc.inc: package/.vers_g180
|
||||
package/.vers_g180:
|
||||
package/package.xdc.inc: package/.vers_r170
|
||||
package/.vers_r170:
|
||||
package/package.xdc.inc: package/.vers_b160
|
||||
package/.vers_b160:
|
||||
|
||||
.interfaces:
|
||||
|
||||
# schema include file dependencies
|
||||
package.xs:
|
||||
package/package.xdc.inc: package.xs
|
||||
|
||||
# schema update dependencies
|
||||
package/package.xdc.inc: xdc/IPackage.xdc
|
||||
xdc/IPackage.xdc:
|
||||
vpath xdc/IPackage.xdc $(XPKGVPATH)
|
||||
|
||||
ifneq (clean,$(MAKECMDGOALS))
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/global/java/package.jar:
|
||||
package/package.xdc.inc: C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/global/java/package.jar
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/shelf/java/tar.jar:
|
||||
package/package.xdc.inc: C:/ti/xdctools_3_32_02_25_core/packages/xdc/shelf/java/tar.jar
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/intern/cmd/java/package.jar:
|
||||
package/package.xdc.inc: C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/intern/cmd/java/package.jar
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/intern/gen/java/package.jar:
|
||||
package/package.xdc.inc: C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/intern/gen/java/package.jar
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/intern/xsr/java/package.jar:
|
||||
package/package.xdc.inc: C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/intern/xsr/java/package.jar
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/shelf/java/ecj.jar:
|
||||
package/package.xdc.inc: C:/ti/xdctools_3_32_02_25_core/packages/xdc/shelf/java/ecj.jar
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/shelf/java/antlr.jar:
|
||||
package/package.xdc.inc: C:/ti/xdctools_3_32_02_25_core/packages/xdc/shelf/java/antlr.jar
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/shelf/java/js.jar:
|
||||
package/package.xdc.inc: C:/ti/xdctools_3_32_02_25_core/packages/xdc/shelf/java/js.jar
|
||||
C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/spec/java/package.jar:
|
||||
package/package.xdc.inc: C:/ti/xdctools_3_32_02_25_core/packages/xdc/services/spec/java/package.jar
|
||||
endif
|
||||
# goals for files generated during schema generation but unspecified by schema's pattern rule
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package.xdc
|
||||
package.xs
|
||||
package/xconfig_app_ble.sch
|
||||
package/.vers_g180
|
||||
package/.vers_r170
|
||||
package/.vers_b160
|
||||
package/.xdc-B24
|
||||
package/xconfig_app_ble.java
|
||||
package/xconfig_app_ble.class
|
||||
package/package_xconfig_app_ble.c
|
||||
package/package.defs.h
|
||||
package/xconfig_app_ble.ccs
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Do not modify this file; it is automatically
|
||||
* generated and any modifications will be overwritten.
|
||||
*
|
||||
* @(#) xdc-B24
|
||||
*/
|
||||
|
||||
#include <xdc/std.h>
|
||||
|
||||
__FAR__ char xconfig_app_ble__dummy__;
|
||||
|
||||
#define __xdc_PKGVERS null
|
||||
#define __xdc_PKGNAME xconfig_app_ble
|
||||
#define __xdc_PKGPREFIX xconfig_app_ble_
|
||||
|
||||
#ifdef __xdc_bld_pkg_c__
|
||||
#define __stringify(a) #a
|
||||
#define __local_include(a) __stringify(a)
|
||||
#include __local_include(__xdc_bld_pkg_c__)
|
||||
#endif
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package/package.bld.xml
|
||||
package/build.cfg
|
||||
package/package.xdc.inc
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+143
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Do not modify this file; it is automatically
|
||||
* generated and any modifications will be overwritten.
|
||||
*
|
||||
* @(#) xdc-B24
|
||||
*/
|
||||
import java.util.*;
|
||||
import org.mozilla.javascript.*;
|
||||
import xdc.services.intern.xsr.*;
|
||||
import xdc.services.spec.Session;
|
||||
|
||||
public class xconfig_app_ble
|
||||
{
|
||||
static final String VERS = "@(#) xdc-B24\n";
|
||||
|
||||
static final Proto.Elm $$T_Bool = Proto.Elm.newBool();
|
||||
static final Proto.Elm $$T_Num = Proto.Elm.newNum();
|
||||
static final Proto.Elm $$T_Str = Proto.Elm.newStr();
|
||||
static final Proto.Elm $$T_Obj = Proto.Elm.newObj();
|
||||
|
||||
static final Proto.Fxn $$T_Met = new Proto.Fxn(null, null, 0, -1, false);
|
||||
static final Proto.Map $$T_Map = new Proto.Map($$T_Obj);
|
||||
static final Proto.Arr $$T_Vec = new Proto.Arr($$T_Obj);
|
||||
|
||||
static final XScriptO $$DEFAULT = Value.DEFAULT;
|
||||
static final Object $$UNDEF = Undefined.instance;
|
||||
|
||||
static final Proto.Obj $$Package = (Proto.Obj)Global.get("$$Package");
|
||||
static final Proto.Obj $$Module = (Proto.Obj)Global.get("$$Module");
|
||||
static final Proto.Obj $$Instance = (Proto.Obj)Global.get("$$Instance");
|
||||
static final Proto.Obj $$Params = (Proto.Obj)Global.get("$$Params");
|
||||
|
||||
static final Object $$objFldGet = Global.get("$$objFldGet");
|
||||
static final Object $$objFldSet = Global.get("$$objFldSet");
|
||||
static final Object $$proxyGet = Global.get("$$proxyGet");
|
||||
static final Object $$proxySet = Global.get("$$proxySet");
|
||||
static final Object $$delegGet = Global.get("$$delegGet");
|
||||
static final Object $$delegSet = Global.get("$$delegSet");
|
||||
|
||||
Scriptable xdcO;
|
||||
Session ses;
|
||||
Value.Obj om;
|
||||
|
||||
boolean isROV;
|
||||
boolean isCFG;
|
||||
|
||||
Proto.Obj pkgP;
|
||||
Value.Obj pkgV;
|
||||
|
||||
ArrayList<Object> imports = new ArrayList<Object>();
|
||||
ArrayList<Object> loggables = new ArrayList<Object>();
|
||||
ArrayList<Object> mcfgs = new ArrayList<Object>();
|
||||
ArrayList<Object> icfgs = new ArrayList<Object>();
|
||||
ArrayList<String> inherits = new ArrayList<String>();
|
||||
ArrayList<Object> proxies = new ArrayList<Object>();
|
||||
ArrayList<Object> sizes = new ArrayList<Object>();
|
||||
ArrayList<Object> tdefs = new ArrayList<Object>();
|
||||
|
||||
void $$IMPORTS()
|
||||
{
|
||||
Global.callFxn("loadPackage", xdcO, "xdc");
|
||||
Global.callFxn("loadPackage", xdcO, "xdc.corevers");
|
||||
}
|
||||
|
||||
void $$OBJECTS()
|
||||
{
|
||||
pkgP = (Proto.Obj)om.bind("xconfig_app_ble.Package", new Proto.Obj());
|
||||
pkgV = (Value.Obj)om.bind("xconfig_app_ble", new Value.Obj("xconfig_app_ble", pkgP));
|
||||
}
|
||||
|
||||
void $$SINGLETONS()
|
||||
{
|
||||
pkgP.init("xconfig_app_ble.Package", (Proto.Obj)om.findStrict("xdc.IPackage.Module", "xconfig_app_ble"));
|
||||
Scriptable cap = (Scriptable)Global.callFxn("loadCapsule", xdcO, "xconfig_app_ble/package.xs");
|
||||
om.bind("xdc.IPackage$$capsule", cap);
|
||||
Object fxn;
|
||||
fxn = Global.get(cap, "init");
|
||||
if (fxn != null) pkgP.addFxn("init", (Proto.Fxn)om.findStrict("xdc.IPackage$$init", "xconfig_app_ble"), fxn);
|
||||
fxn = Global.get(cap, "close");
|
||||
if (fxn != null) pkgP.addFxn("close", (Proto.Fxn)om.findStrict("xdc.IPackage$$close", "xconfig_app_ble"), fxn);
|
||||
fxn = Global.get(cap, "validate");
|
||||
if (fxn != null) pkgP.addFxn("validate", (Proto.Fxn)om.findStrict("xdc.IPackage$$validate", "xconfig_app_ble"), fxn);
|
||||
fxn = Global.get(cap, "exit");
|
||||
if (fxn != null) pkgP.addFxn("exit", (Proto.Fxn)om.findStrict("xdc.IPackage$$exit", "xconfig_app_ble"), fxn);
|
||||
fxn = Global.get(cap, "getLibs");
|
||||
if (fxn != null) pkgP.addFxn("getLibs", (Proto.Fxn)om.findStrict("xdc.IPackage$$getLibs", "xconfig_app_ble"), fxn);
|
||||
fxn = Global.get(cap, "getSects");
|
||||
if (fxn != null) pkgP.addFxn("getSects", (Proto.Fxn)om.findStrict("xdc.IPackage$$getSects", "xconfig_app_ble"), fxn);
|
||||
pkgP.bind("$capsule", cap);
|
||||
pkgV.init2(pkgP, "xconfig_app_ble", Value.DEFAULT, false);
|
||||
pkgV.bind("$name", "xconfig_app_ble");
|
||||
pkgV.bind("$category", "Package");
|
||||
pkgV.bind("$$qn", "xconfig_app_ble.");
|
||||
pkgV.bind("$vers", Global.newArray());
|
||||
Value.Map atmap = (Value.Map)pkgV.getv("$attr");
|
||||
atmap.seal("length");
|
||||
imports.clear();
|
||||
pkgV.bind("$imports", imports);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("var pkg = xdc.om['xconfig_app_ble'];\n");
|
||||
sb.append("if (pkg.$vers.length >= 3) {\n");
|
||||
sb.append("pkg.$vers.push(Packages.xdc.services.global.Vers.getDate(xdc.csd() + '/..'));\n");
|
||||
sb.append("}\n");
|
||||
sb.append("if ('xconfig_app_ble$$stat$base' in xdc.om) {\n");
|
||||
sb.append("pkg.packageBase = xdc.om['xconfig_app_ble$$stat$base'];\n");
|
||||
sb.append("pkg.packageRepository = xdc.om['xconfig_app_ble$$stat$root'];\n");
|
||||
sb.append("}\n");
|
||||
sb.append("pkg.build.libraries = [\n");
|
||||
sb.append("];\n");
|
||||
sb.append("pkg.build.libDesc = [\n");
|
||||
sb.append("];\n");
|
||||
Global.eval(sb.toString());
|
||||
}
|
||||
|
||||
void $$INITIALIZATION()
|
||||
{
|
||||
Value.Obj vo;
|
||||
|
||||
if (isCFG) {
|
||||
}//isCFG
|
||||
Global.callFxn("init", pkgV);
|
||||
((Value.Arr)om.findStrict("$packages", "xconfig_app_ble")).add(pkgV);
|
||||
}
|
||||
|
||||
public void exec( Scriptable xdcO, Session ses )
|
||||
{
|
||||
this.xdcO = xdcO;
|
||||
this.ses = ses;
|
||||
om = (Value.Obj)xdcO.get("om", null);
|
||||
|
||||
Object o = om.geto("$name");
|
||||
String s = o instanceof String ? (String)o : null;
|
||||
isCFG = s != null && s.equals("cfg");
|
||||
isROV = s != null && s.equals("rov");
|
||||
|
||||
$$IMPORTS();
|
||||
$$OBJECTS();
|
||||
if (isROV) {
|
||||
}//isROV
|
||||
$$SINGLETONS();
|
||||
$$INITIALIZATION();
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
@@ -233,7 +233,7 @@ const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[BOOSTXL_CC2650MA_SPICOUNT] = {
|
||||
.mosiPin = Board_SPI0_MOSI,
|
||||
.misoPin = Board_SPI0_MISO,
|
||||
.clkPin = Board_SPI0_CLK,
|
||||
.csnPin = Board_SPI0_CS
|
||||
.csnPin = Board_SPI0_CSN
|
||||
//
|
||||
},
|
||||
#ifdef HEADSTAGE_MA_USE_SPI2
|
||||
@@ -250,7 +250,7 @@ const SPICC26XXDMA_HWAttrsV1 spiCC26XXDMAHWAttrs[BOOSTXL_CC2650MA_SPICOUNT] = {
|
||||
.mosiPin = Board_SPI1_MOSI,
|
||||
.misoPin = Board_SPI1_MISO,
|
||||
.clkPin = Board_SPI1_CLK,
|
||||
.csnPin = Board_SPI1_CS //
|
||||
.csnPin = Board_SPI1_CSN //
|
||||
},
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -51,6 +51,11 @@ extern "C" {
|
||||
#include <ti/drivers/PIN.h>
|
||||
#include <driverlib/ioc.h>
|
||||
|
||||
#ifdef HEADSTAGE_UNI_2_0
|
||||
#include "neu/headstage_pin.h"
|
||||
#else
|
||||
#include "uni/headstage_pin.h"
|
||||
#endif
|
||||
/** ============================================================================
|
||||
* Externs
|
||||
* ==========================================================================*/
|
||||
@@ -144,36 +149,36 @@ extern const PIN_Config BoardGpioInitTable[];
|
||||
#define Board_UART_TX Board_BP_UART_Rx /* RXD */
|
||||
#define Board_UART_RX Board_BP_UART_Tx /* TXD */
|
||||
|
||||
/*
|
||||
* SPI0 is LSK interface
|
||||
*/
|
||||
#define Board_SPI0_MISO PIN_UNASSIGNED
|
||||
#define Board_SPI0_MOSI IOID_0
|
||||
#define Board_SPI0_CLK IOID_1
|
||||
#define Board_SPI0_CS IOID_3
|
||||
|
||||
/*
|
||||
* SPI1 is ASK interface
|
||||
*/
|
||||
|
||||
#define Board_SPI1_MISO PIN_UNASSIGNED
|
||||
#define Board_SPI1_MOSI IOID_13
|
||||
#define Board_SPI1_CLK PIN_UNASSIGNED
|
||||
#define Board_SPI1_CS IOID_4
|
||||
|
||||
/* Power Management Board */
|
||||
#define Board_SRDY Board_BP_Pin_J2_19
|
||||
#define Board_MRDY Board_BP_Pin_J1_2
|
||||
|
||||
/* PWM outputs */
|
||||
#define Board_PWMPIN0 IOID_6
|
||||
#define Board_PWMPIN1 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN2 IOID_8
|
||||
#define Board_PWMPIN3 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN4 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN5 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN6 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN7 PIN_UNASSIGNED
|
||||
///*
|
||||
// * SPI0 interface with DBS chip 2.0
|
||||
// */
|
||||
//#define Board_SPI0_MISO PIN_UNASSIGNED
|
||||
//#define Board_SPI0_MOSI PIN_UNASSIGNED
|
||||
//#define Board_SPI0_CLK PIN_UNASSIGNED
|
||||
//#define Board_SPI0_CS PIN_UNASSIGNED
|
||||
//
|
||||
///*
|
||||
// * SPI1 interface work with LED
|
||||
// */
|
||||
//
|
||||
//#define Board_SPI1_MISO PIN_UNASSIGNED
|
||||
//#define Board_SPI1_MOSI PIN_UNASSIGNED
|
||||
//#define Board_SPI1_CLK PIN_UNASSIGNED
|
||||
//#define Board_SPI1_CS PIN_UNASSIGNED
|
||||
//
|
||||
///* Power Management Board */
|
||||
//#define Board_SRDY Board_BP_Pin_J2_19
|
||||
//#define Board_MRDY Board_BP_Pin_J1_2
|
||||
//
|
||||
///* PWM outputs */
|
||||
//#define Board_PWMPIN0 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN1 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN2 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN3 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN4 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN5 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN6 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN7 PIN_UNASSIGNED
|
||||
|
||||
|
||||
/** ============================================================================
|
||||
|
||||
@@ -51,6 +51,8 @@ extern "C" {
|
||||
#include <ti/drivers/PIN.h>
|
||||
#include <driverlib/ioc.h>
|
||||
|
||||
#include "neu/headstage_pin.h"
|
||||
|
||||
/** ============================================================================
|
||||
* Externs
|
||||
* ==========================================================================*/
|
||||
@@ -68,34 +70,34 @@ extern const PIN_Config BoardGpioInitTable[];
|
||||
*/
|
||||
|
||||
/* Discrete outputs */
|
||||
#define Board_RLED IOID_6
|
||||
#define Board_GLED IOID_7
|
||||
#define Board_RLED PIN_UNASSIGNED
|
||||
#define Board_GLED PIN_UNASSIGNED
|
||||
#define Board_LED_ON 1
|
||||
#define Board_LED_OFF 0
|
||||
|
||||
/* Discrete inputs */
|
||||
#define Board_BTN1 IOID_13
|
||||
#define Board_BTN2 IOID_14
|
||||
#define Board_BTN1 PIN_UNASSIGNED
|
||||
#define Board_BTN2 PIN_UNASSIGNED
|
||||
|
||||
/* UART Board */
|
||||
#define Board_UART_RX IOID_1 /* RXD */
|
||||
#define Board_UART_TX IOID_2 /* TXD */
|
||||
#define Board_UART_RX PIN_UNASSIGNED /* RXD */
|
||||
#define Board_UART_TX PIN_UNASSIGNED /* TXD */
|
||||
#define Board_UART_CTS PIN_UNASSIGNED /* CTS */
|
||||
#define Board_UART_RTS PIN_UNASSIGNED /* RTS */
|
||||
|
||||
/* SPI Board */
|
||||
#define Board_SPI0_MISO PIN_UNASSIGNED /* RF1.20 */
|
||||
#define Board_SPI0_MOSI IOID_12 /* RF1.18 */
|
||||
#define Board_SPI0_CLK PIN_UNASSIGNED /* RF1.16 */
|
||||
#define Board_SPI0_CSN IOID_4
|
||||
#define Board_SPI1_MISO PIN_UNASSIGNED
|
||||
#define Board_SPI1_MOSI IOID_10
|
||||
#define Board_SPI1_CLK IOID_9
|
||||
#define Board_SPI1_CSN IOID_3
|
||||
//#define Board_SPI0_MISO PIN_UNASSIGNED /* RF1.20 */
|
||||
//#define Board_SPI0_MOSI PIN_UNASSIGNED /* RF1.18 */
|
||||
//#define Board_SPI0_CLK PIN_UNASSIGNED /* RF1.16 */
|
||||
//#define Board_SPI0_CSN PIN_UNASSIGNED
|
||||
//#define Board_SPI1_MISO PIN_UNASSIGNED
|
||||
//#define Board_SPI1_MOSI PIN_UNASSIGNED
|
||||
//#define Board_SPI1_CLK PIN_UNASSIGNED
|
||||
//#define Board_SPI1_CSN PIN_UNASSIGNED
|
||||
|
||||
/* I2C */
|
||||
#define Board_I2C0_SCL0 IOID_4
|
||||
#define Board_I2C0_SDA0 IOID_5
|
||||
#define Board_I2C0_SCL0 PIN_UNASSIGNED
|
||||
#define Board_I2C0_SDA0 PIN_UNASSIGNED
|
||||
|
||||
/* SPI */
|
||||
#define Board_SPI_FLASH_CS IOID_20
|
||||
@@ -123,21 +125,21 @@ extern const PIN_Config BoardGpioInitTable[];
|
||||
|
||||
/* Booster pack LCD (430BOOST - Sharp96 Rev 1.1) */
|
||||
#define Board_LCD_CS IOID_24 // SPI chip select
|
||||
#define Board_LCD_EXTCOMIN IOID_12 // External COM inversion
|
||||
#define Board_LCD_EXTCOMIN PIN_UNASSIGNED // External COM inversion
|
||||
#define Board_LCD_ENABLE IOID_22 // LCD enable
|
||||
#define Board_LCD_POWER IOID_23 // LCD power control
|
||||
#define Board_LCD_CS_ON 1
|
||||
#define Board_LCD_CS_OFF 0
|
||||
|
||||
/* PWM outputs */
|
||||
#define Board_PWMPIN0 Board_RLED
|
||||
#define Board_PWMPIN1 Board_GLED
|
||||
#define Board_PWMPIN2 IOID_5
|
||||
#define Board_PWMPIN3 IOID_11
|
||||
#define Board_PWMPIN4 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN5 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN6 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN7 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN0 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN1 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN2 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN3 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN4 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN5 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN6 PIN_UNASSIGNED
|
||||
//#define Board_PWMPIN7 PIN_UNASSIGNED
|
||||
|
||||
/** ============================================================================
|
||||
* Instance identifiers
|
||||
|
||||
@@ -100,6 +100,7 @@ if (typeof NO_ROM == 'undefined' || (typeof NO_ROM != 'undefined' && NO_ROM == 0
|
||||
|
||||
/* ================ Clock configuration ================ */
|
||||
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
|
||||
var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
|
||||
/*
|
||||
* When using Power and calibrateRCOSC is set to true, this should be set to 10.
|
||||
* The timer used by the Clock module supports TickMode_DYNAMIC. This enables us
|
||||
@@ -112,6 +113,7 @@ var Clock = xdc.useModule('ti.sysbios.knl.Clock');
|
||||
Clock.tickPeriod = 10;
|
||||
Clock.swiPriority = 5;
|
||||
|
||||
Timestamp.SupportProxy = xdc.useModule('ti.sysbios.family.arm.cc26xx.TimestampProvider');
|
||||
|
||||
/* ================ Types configuration ================ */
|
||||
var Types = xdc.useModule('xdc.runtime.Types');
|
||||
@@ -203,6 +205,7 @@ Error.maxDepth = 2;
|
||||
/* ================ Hwi configuration ================ */
|
||||
var halHwi = xdc.useModule('ti.sysbios.hal.Hwi');
|
||||
var m3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
|
||||
|
||||
/*
|
||||
* Checks for Hwi (system) stack overruns while in the Idle loop.
|
||||
*
|
||||
@@ -216,6 +219,7 @@ var m3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
|
||||
*/
|
||||
//halHwi.checkStackFlag = true;
|
||||
halHwi.checkStackFlag = false;
|
||||
//C:\ti\simplelink\ble_sdk_2_02_02_25\examples\cc2650em\simple_peripheral\ccs\app\.config\xconfig_app_ble
|
||||
|
||||
/*
|
||||
* The following options alter the system's behavior when a hardware exception
|
||||
|
||||
@@ -368,6 +368,9 @@ static void HostTestApp_processAttEvent(gattMsgEvent_t *message) {
|
||||
} else if (method == ATT_HANDLE_VALUE_NOTI) {
|
||||
attHandleValueNoti_t *att_notify = (attHandleValueNoti_t *)(&message->msg);
|
||||
master_handle_notify(att_notify->len, att_notify->pValue);
|
||||
} else if (method == ATT_HANDLE_VALUE_IND) {
|
||||
attHandleValueInd_t *att_indicate = (attHandleValueInd_t *)(&message->msg);
|
||||
master_handle_notify(att_indicate->len, att_indicate->pValue);
|
||||
}
|
||||
|
||||
// Free message. Needed only for ATT Protocol messages
|
||||
|
||||
+2567
File diff suppressed because it is too large
Load Diff
+28
@@ -0,0 +1,28 @@
|
||||
@startuml
|
||||
|
||||
|
||||
start
|
||||
|
||||
while (negedge chip select)
|
||||
if (rxbuf is wrong) then (yes)
|
||||
:modify data until it is correct;
|
||||
else
|
||||
:pass;
|
||||
endif
|
||||
partition headstage_notify_append_data {
|
||||
if (buf offset == INIT) then (yes)
|
||||
:reset timestamp;
|
||||
endif
|
||||
if (buf offset == BUFF_SIZE)
|
||||
:set time delta;
|
||||
endif
|
||||
:append data & return index;
|
||||
}
|
||||
if (buf offset == BUFF_SIZE)
|
||||
:headstage_notify_send(0.676ms);
|
||||
endif
|
||||
:headstage_spi_lsk_transaction (0.528ms);
|
||||
endwhile
|
||||
stop
|
||||
|
||||
@enduml
|
||||
+10
-42
@@ -243,7 +243,6 @@ extern ICall_Semaphore semaphore;
|
||||
* count with cpu tick.
|
||||
*/
|
||||
#define headstage_cpu_delay_ms(ms) CPUdelay(ms * 16000)
|
||||
|
||||
/**
|
||||
* make task sleep in certain [us].
|
||||
* count with cpu tick.
|
||||
@@ -288,6 +287,11 @@ static uint8_t CHIP_ID = 0;
|
||||
*/
|
||||
static uint16_t CONNECT_HANDLE = 0;
|
||||
|
||||
/**
|
||||
* command instruction buffer
|
||||
*/
|
||||
static uint8_t cdr_buf[BLE_CDR_BUFF_SIZE] = {0};
|
||||
|
||||
/*====================
|
||||
==== event table ====
|
||||
====================*/
|
||||
@@ -330,6 +334,9 @@ static EventTableEntry EVENT_TABLE[] = { //
|
||||
#endif
|
||||
#ifdef HEADSTAGE_STI_H
|
||||
{EVT_ALL, &headstage_sti_event},
|
||||
#endif
|
||||
#ifdef HEADSTAGE_NEU_H
|
||||
{EVT_ALL, &headstage_neu_event},
|
||||
#endif
|
||||
// terminated
|
||||
{0, NULL}};
|
||||
@@ -353,8 +360,6 @@ static void headstage_event_handle() {
|
||||
* system handle for instruction input.
|
||||
*/
|
||||
static void headstage_update_instruction(uint8_t *instruction) {
|
||||
static uint8_t cdr_buf[BLE_CDR_BUFF_SIZE] = {0};
|
||||
|
||||
uint8_t ins_type = instruction[0] & 0xF0;
|
||||
CHIP_ID = instruction[0] & 0x0F;
|
||||
uint8_t ins_oper = instruction[1] & 0xF0;
|
||||
@@ -370,45 +375,8 @@ static void headstage_update_instruction(uint8_t *instruction) {
|
||||
break;
|
||||
}
|
||||
case INS_TYPE_CIS: {
|
||||
switch (ins_oper) {
|
||||
case CIS_NOP: {
|
||||
// nothing
|
||||
cdr_buf[0] = _B_4b4b(CIS_NOP, CHIP_ID);
|
||||
cdr_buf[1] = _B_4b4b(CDR_SUCCESS, 0);
|
||||
|
||||
SimpleProfile_SetParameter(BLE_CDR_BUFF_CHAR, 2, cdr_buf);
|
||||
break;
|
||||
}
|
||||
#ifdef HEADSTAGE_CIS_VOLT_H
|
||||
case CIS_VOLT: {
|
||||
uint8_t status = headstage_update_vis_volt(ins_len, instruction + 2, cdr_buf + 2);
|
||||
|
||||
cdr_buf[0] = _B_4b4b(CIS_VOLT, CHIP_ID);
|
||||
cdr_buf[1] = status;
|
||||
|
||||
SimpleProfile_SetParameter(BLE_CDR_BUFF_CHAR, BLE_CDR_BUFF_SIZE, cdr_buf);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#ifdef HEADSTAGE_CIS_LED_H
|
||||
case CIS_LED: {
|
||||
uint8_t status = headstage_update_vis_led(ins_len, instruction + 2, cdr_buf + 2);
|
||||
|
||||
cdr_buf[0] = _B_4b4b(CIS_LED, CHIP_ID);
|
||||
cdr_buf[1] = status;
|
||||
|
||||
SimpleProfile_SetParameter(BLE_CDR_BUFF_CHAR, BLE_CDR_BUFF_SIZE, cdr_buf);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default: {
|
||||
cdr_buf[0] = _B_4b4b(ins_oper, CHIP_ID);
|
||||
cdr_buf[1] = _B_4b4b(CDR_FAILURE, 0);
|
||||
|
||||
SimpleProfile_SetParameter(BLE_CDR_BUFF_CHAR, BLE_CDR_BUFF_SIZE, cdr_buf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
headstage_update_cis_instruction(ins_oper);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,9 +3,9 @@
|
||||
#ifndef HEADSTAGE_ARM_H
|
||||
#define HEADSTAGE_ARM_H
|
||||
|
||||
static uint16_t headstage_ramp_data_counter = 0;
|
||||
|
||||
static void headstage_arm_append_ramp_data(uint8_t *buff) {
|
||||
static uint16_t headstage_ramp_data_counter = 0;
|
||||
|
||||
uint16_t v = headstage_ramp_data_counter++;
|
||||
|
||||
|
||||
+2
-2
@@ -25,8 +25,8 @@ static void headstage_cis_led_enable(uint8_t enable);
|
||||
static uint8_t headstage_cis_led_set_pattern(uint8_t pattern);
|
||||
|
||||
/**
|
||||
* @para pattern: pattern number
|
||||
* @para parameter: led parameter, NULL to unset
|
||||
* @param pattern: pattern number
|
||||
* @param parameter: led parameter, NULL to unset
|
||||
* @return: CDR_SUCCESS
|
||||
*/
|
||||
static uint8_t headstage_cis_led_set_value(uint8_t pattern, //
|
||||
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
/* Copyright (c) 2019. BioPro. Scientific.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
Headstage indicate utility
|
||||
==========================
|
||||
|
||||
reference code :
|
||||
root:
|
||||
glucose.c
|
||||
glucserive.c
|
||||
|
||||
code need modifying:
|
||||
headstage_indicate.h
|
||||
simple_gatt_profile.c : WriteAtterCB -> add case "indication" to support indicate
|
||||
|
||||
sipmle_peripheral.c : find another service callback
|
||||
|
||||
use this website to construct software structure : http://plantuml.com/zh/
|
||||
|
||||
reference document:
|
||||
bluetooth Core5.1 Vol 3, Part F, Section 3.4.6
|
||||
The Prepare Write Request is used to request the server to prepare to write the
|
||||
value of an attribute. The server will respond to this request with a Prepare Write
|
||||
Response, so that the client can verify that the value was received correctly.
|
||||
|
||||
host-test can ask simple-peripheral to prepare the queue to write attribute
|
||||
|
||||
5.3.4.3 Queued Writes
|
||||
Prepare Write commands allows a GATT server to send more payload data by queuing up multiple write
|
||||
requests. The default queue size is 5. With a default MTU of 23 and payload of 18 bytes, up to 90 bytes of
|
||||
payload can be sent. Refer to Core_v4.2 specification (Vol 3, Part F, Section 3.4.6) for more information
|
||||
on queued writes.
|
||||
Adjust the Prepare Write queue with GATTServApp_SetParameter with parameter
|
||||
GATT_PARAM_NUM_PREPARE_WRITES. There is no specified limit, but it is bounded by the available
|
||||
HEAPMGR space. Refer to the API definition in gattservapp.h.
|
||||
|
||||
GATT_PARAM_NUM_PREPARE_WRITES
|
||||
|
||||
*/
|
||||
|
||||
#ifndef HEADSTAGE_INDICATE_H
|
||||
#define HEADSTAGE_INDICATE_H
|
||||
|
||||
#include <xdc/runtime/Timestamp.h>
|
||||
|
||||
#define headstage_time_stamp() Timestamp_get32()
|
||||
|
||||
/*==========================
|
||||
==== indicate function ====
|
||||
=========================*/
|
||||
|
||||
/*
|
||||
* send indicate
|
||||
* connHandle -> where to assign this parameter
|
||||
*/
|
||||
|
||||
static bStatus_t headstage_indicate() {
|
||||
uint16_t buffer_size = BLE_NOT_BUFF_SIZE;
|
||||
uint8_t *value = (uint8_t *)GATT_bm_alloc(CONNECT_HANDLE, ATT_HANDLE_VALUE_IND, GATT_MAX_MTU,&buffer_size);
|
||||
|
||||
if (value != NULL) {
|
||||
memcpy(value, headstage_notify_buffer, buffer_size);
|
||||
}
|
||||
|
||||
attHandleValueInd_t indicate = {
|
||||
// clang-format off
|
||||
.handle = 0x1E,
|
||||
.len = buffer_size,
|
||||
.pValue = value
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
if (GATT_Indication(CONNECT_HANDLE, &indicate, 0, ICall_getEntityId()) != SUCCESS) {
|
||||
GATT_bm_free((gattMsg_t *)&indicate, ATT_HANDLE_VALUE_IND);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
+12
-14
@@ -192,38 +192,36 @@ static void headstage_led_color(uint8_t color) {
|
||||
==== LED implement (GPIO) ====
|
||||
============================*/
|
||||
|
||||
#ifdef BOOSTXL_CC2650MA
|
||||
#ifdef HEADSTAGE_UNI_H
|
||||
#define HEADSTAGE_LED_USE_GPIO
|
||||
#endif
|
||||
|
||||
#ifdef HEADSTAGE_LED_USE_GPIO
|
||||
#include "headstage_pin.h"
|
||||
#include "headstage_pin.h"
|
||||
/*
|
||||
every 400us to transmit spi data
|
||||
*/
|
||||
|
||||
static void headstage_led_spi_transmit (){
|
||||
for(int8_t i = 0; i < 8; i++) {
|
||||
static void headstage_led_spi_transmit() {
|
||||
for (int8_t i = 0; i < 8; i++) {
|
||||
uint16_t d = headstage_spi_led_txbuf[i];
|
||||
for(int8_t j = 15; j >= 0; j--){
|
||||
int16_t v = (d & (1 << j)); // why check > 0 or not
|
||||
bool SET_LED = (v > 0) ? 1 : 0;
|
||||
headstage_pin_output(PIN_LED_CLK,1);
|
||||
CPUdelay( 16*400 );// 2500hz
|
||||
headstage_pin_output(PIN_LED_OUT, SET_LED);
|
||||
for (int8_t j = 15; j >= 0; j--) {
|
||||
int16_t v = (d & (1 << j)); // why check > 0 or not
|
||||
bool SET_LED = (v > 0) ? 1 : 0;
|
||||
headstage_pin_output(PIN_LED_CLK, 0);
|
||||
CPUdelay( 16*400 );// 2500hz
|
||||
CPUdelay(16 * 400); // 2500hz
|
||||
headstage_pin_output(PIN_LED_OUT, SET_LED);
|
||||
headstage_pin_output(PIN_LED_CLK, 1);
|
||||
CPUdelay(16 * 400); // 2500hz
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void headstage_led_spi_color (uint8_t color){
|
||||
static void headstage_led_spi_color(uint8_t color) {
|
||||
headstage_led_set_color(headstage_spi_led_txbuf, SPI_LED_REPEAT, color);
|
||||
headstage_led_spi_transmit();
|
||||
}
|
||||
|
||||
|
||||
#endif // HEADSTAGE_LED_USE_GPIO
|
||||
|
||||
#endif // HEADSTAGE_LED_H
|
||||
|
||||
|
||||
+1003
File diff suppressed because it is too large
Load Diff
+2
-4
@@ -31,8 +31,7 @@ optional implement
|
||||
|
||||
#include <xdc/runtime/Timestamp.h>
|
||||
|
||||
#define headstage_time_stamp_us() (32 * Timestamp_get32())
|
||||
#define headstage_time_stamp_ms() (Timestamp_get32() / 32)
|
||||
#define headstage_time_stamp_us() (Timestamp_get32() / 2)
|
||||
|
||||
/*========================
|
||||
==== notify function ====
|
||||
@@ -52,7 +51,7 @@ static void headstage_notify_send() {
|
||||
if (value != NULL) {
|
||||
memcpy(value, headstage_notify_buffer, buffer_size);
|
||||
|
||||
attHandleValueNoti_t notify =
|
||||
attHandleValueNoti_t notify = {
|
||||
// clang-format off
|
||||
.handle = 0x1E,
|
||||
.len = buffer_size,
|
||||
@@ -67,7 +66,6 @@ static void headstage_notify_send() {
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
SimpleProfile_SetParameter(BLE_NOT_BUFF_CHAR, BLE_NOT_BUFF_SIZE, headstage_notify_buffer);
|
||||
|
||||
#endif
|
||||
|
||||
+2
@@ -14,6 +14,8 @@
|
||||
#include "zm/headstage_pin.h"
|
||||
#elif defined(HEADSTAGE_STI_H)
|
||||
#include "sti/headstage_pin.h"
|
||||
#elif defined(HEADSTAGE_NEU_H)
|
||||
#include "neu/headstage_pin.h"
|
||||
#else
|
||||
|
||||
#error "headstage_pin headstage_pin_configuration not defined"
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/* Copyright (c) 2019. BioPro. Scientific.
|
||||
*/
|
||||
|
||||
/**
|
||||
\file headstage_swi.h
|
||||
In order to enable interrupt, hookset function need declaring.
|
||||
reference:ti/tirtos_cc13xx_cc26xx_2_21_01_08/products/bios_6_46_01_38/docs/Bios_User_Guide.pdf
|
||||
*/
|
||||
|
||||
#ifndef HEADSTAGE_SWI_H
|
||||
#define HEADSTAGE_SWI_H
|
||||
|
||||
#include <ti/sysbios/knl/Swi.h>
|
||||
#include <xdc/runtime/Error.h>
|
||||
|
||||
/*
|
||||
software interrupt
|
||||
*/
|
||||
Swi_Handle headstage_swi;
|
||||
|
||||
typedef void (*headstage_swiFxn)(UArg arg0, UArg arg1);
|
||||
|
||||
void headstage_swi_init(headstage_swiFxn callback) {
|
||||
Error_Block eb;
|
||||
Error_init(&eb);
|
||||
headstage_swiFxn my_swi = callback;
|
||||
headstage_swi = Swi_create(my_swi, NULL, &eb);
|
||||
}
|
||||
|
||||
#endif
|
||||
+419
-310
File diff suppressed because it is too large
Load Diff
+5
@@ -0,0 +1,5 @@
|
||||
/* Copyright (c) 2019. BioPro. Scientific.
|
||||
*/
|
||||
#ifndef HEADSTAGE_ADC_H
|
||||
#define HEADSTAGE_ADC_H
|
||||
#endif
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/* Copyright (c) 2019. BioPro. Scientific.
|
||||
*/
|
||||
#ifndef NEULIVE_2P0
|
||||
#define NEULIVE_2P0
|
||||
|
||||
/*============================
|
||||
==== product information ====
|
||||
===========================*/
|
||||
|
||||
#define DEVICE_NAME "Neulive-v2.0"
|
||||
#define MAJOR_PRODUCT_NUMBER 1
|
||||
#define MINOR_PRODUCT_NUMBER 1
|
||||
#define MAJOR_VERSION_NUMBER 2
|
||||
#define MINOR_VERSION_NUMBER 0
|
||||
|
||||
#endif
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
/* Copyright (c) 2019. BioPro. Scientific.
|
||||
*/
|
||||
|
||||
#ifndef HEADSTAGE_NOTIFY_TDC4VC_H
|
||||
#define HEADSTAGE_NOTIFY_TDC4VC_H
|
||||
|
||||
#ifndef HEADSTAGE_NOTIFY_H
|
||||
#error "headstage/headstage_notify.h not included"
|
||||
#endif
|
||||
|
||||
#define NOT_BUF_OFFSET_INIT 8
|
||||
|
||||
static uint32_t not_buf_offset = NOT_BUF_OFFSET_INIT;
|
||||
static uint32_t not_time_stamp = 0;
|
||||
|
||||
static void headstage_notify_set_timestamp() {
|
||||
not_time_stamp = headstage_time_stamp_us();
|
||||
|
||||
headstage_notify_buffer[2] = not_time_stamp & 0xFF;
|
||||
headstage_notify_buffer[3] = (not_time_stamp >> 8) & 0xFF;
|
||||
headstage_notify_buffer[4] = (not_time_stamp >> 16) & 0xFF;
|
||||
headstage_notify_buffer[5] = (not_time_stamp >> 24) & 0xFF;
|
||||
}
|
||||
|
||||
static void headstage_notify_flip_buffer() {
|
||||
uint8_t data_count = (not_buf_offset - NOT_BUF_OFFSET_INIT) / 2;
|
||||
|
||||
headstage_notify_buffer[0] = CHIP_ID;
|
||||
headstage_notify_buffer[1] = data_count;
|
||||
|
||||
not_buf_offset = NOT_BUF_OFFSET_INIT;
|
||||
}
|
||||
|
||||
static uint8_t headstage_notify_append_data(uint8_t *data_value) {
|
||||
if (not_buf_offset <= NOT_BUF_OFFSET_INIT) {
|
||||
headstage_notify_set_timestamp();
|
||||
not_buf_offset = NOT_BUF_OFFSET_INIT;
|
||||
}
|
||||
|
||||
if (data_value == NULL) {
|
||||
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];
|
||||
}
|
||||
|
||||
if (not_buf_offset == BLE_NOT_BUFF_SIZE) {
|
||||
uint32_t current = headstage_time_stamp_us();
|
||||
uint32_t time_delta = ((current - not_time_stamp)) & 0xFFFF;
|
||||
|
||||
headstage_notify_buffer[6] = time_delta & 0xFF;
|
||||
headstage_notify_buffer[7] = (time_delta >> 8) & 0xFF;
|
||||
}
|
||||
|
||||
uint8_t ret = not_buf_offset;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif // HEADSTAGE_NOTIFY_TDC4VAF2_H
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
/* Copyright (c) 2019. BioPro. Scientific.
|
||||
*/
|
||||
#ifndef HEADSTAGE_PIN_NEU_H
|
||||
#define HEADSTAGE_PIN_NEU_H
|
||||
|
||||
#if defined(CC2650_LAUNCHXL)
|
||||
|
||||
// clang-format off
|
||||
#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_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
|
||||
|
||||
#elif defined(BOOSTXL_CC2650MA)
|
||||
|
||||
// clang-format off
|
||||
|
||||
#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_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
|
||||
/*
|
||||
* SPI0 interface with DBS chip 2.0
|
||||
*/
|
||||
#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
|
||||
|
||||
/*
|
||||
* SPI1 interface work with LED
|
||||
*/
|
||||
|
||||
#define Board_SPI1_MISO PIN_UNASSIGNED
|
||||
#define Board_SPI1_MOSI PIN_LED_SDI
|
||||
#define Board_SPI1_CLK PIN_LED_CLK
|
||||
#define Board_SPI1_CSN PIN_UNASSIGNED
|
||||
|
||||
/* Power Management Board */
|
||||
#define Board_SRDY Board_BP_Pin_J2_19
|
||||
#define Board_MRDY Board_BP_Pin_J1_2
|
||||
|
||||
/* PWM outputs */
|
||||
#define Board_PWMPIN0 PIN_AMP_VCK
|
||||
#define Board_PWMPIN1 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN2 PIN_SYS_CLK
|
||||
#define Board_PWMPIN3 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN4 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN5 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN6 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN7 PIN_UNASSIGNED
|
||||
|
||||
static PIN_Config headstage_pin_configuration[] = { //
|
||||
PIN_RESET | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
PIN_EN_ADC_SPI_CLK | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
PIN_DC_DC | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
PIN_BATT_HALF | PIN_INPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
PIN_STI_CLK | PIN_INPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL,
|
||||
//
|
||||
PIN_TERMINATE};
|
||||
|
||||
#endif // HEADSTAGE_PIN_UNI_H
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
/* Copyright (c) 2019. BioPro. Scientific.
|
||||
*/
|
||||
#ifndef HEADSTAGE_PWM_H
|
||||
#define HEADSTAGE_PWM_H
|
||||
|
||||
#include <Board.h>
|
||||
#include <ti/drivers/PWM.h>
|
||||
|
||||
static PWM_Handle headstage_system_pwm_handle = NULL;
|
||||
static PWM_Handle headstage_poly_r_pwm_handle = NULL; // poly-R adjustment clock
|
||||
|
||||
#define headstage_pwm_open() \
|
||||
do { \
|
||||
PWM_init(); \
|
||||
PWM_Params headstage_system_pwm_params; \
|
||||
PWM_Params_init(&headstage_system_pwm_params); \
|
||||
headstage_system_pwm_params.idleLevel = PWM_IDLE_LOW; \
|
||||
headstage_system_pwm_params.periodUnits = PWM_PERIOD_HZ; \
|
||||
headstage_system_pwm_params.periodValue = NEU_SYS_CLK; \
|
||||
headstage_system_pwm_params.dutyUnits = PWM_DUTY_FRACTION; \
|
||||
headstage_system_pwm_params.dutyValue = PWM_DUTY_FRACTION_MAX / 2; \
|
||||
headstage_system_pwm_handle = PWM_open(Board_PWM2, &headstage_system_pwm_params); \
|
||||
PWM_Params headstage_poly_r_pwm_params; \
|
||||
PWM_Params_init(&headstage_poly_r_pwm_params); \
|
||||
headstage_poly_r_pwm_params.idleLevel = PWM_IDLE_LOW; \
|
||||
headstage_poly_r_pwm_params.periodUnits = PWM_PERIOD_HZ; \
|
||||
headstage_poly_r_pwm_params.periodValue = NEU_POLY_R_CLK; \
|
||||
headstage_poly_r_pwm_params.dutyUnits = PWM_DUTY_FRACTION; \
|
||||
headstage_poly_r_pwm_params.dutyValue = PWM_DUTY_FRACTION_MAX / 2; \
|
||||
headstage_poly_r_pwm_handle = PWM_open(Board_PWM0, &headstage_poly_r_pwm_params); \
|
||||
} while (0)
|
||||
|
||||
#define headstage_pwm_start(handle) PWM_start(handle)
|
||||
#define headstage_pwm_stop(handle) PWM_stop(handle)
|
||||
#define headstage_pwm_close(handle) PWM_close(handle)
|
||||
|
||||
#endif // HEADSTAGE_PWM_H
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
/* Copyright (c) 2019. BioPro. Scientific.
|
||||
*/
|
||||
#ifndef HEADSTAGE_SPI_H
|
||||
#define HEADSTAGE_SPI_H
|
||||
|
||||
#if defined(BOOSTXL_CC2650MA) && !defined(HEADSTAGE_MA_USE_SPI2)
|
||||
#error "put HEADSTAGE_MA_USE_SPI2 in predefined"
|
||||
#endif
|
||||
|
||||
#include <Board.h>
|
||||
#include <ti/drivers/SPI.h>
|
||||
#include <ti/drivers/dma/UDMACC26XX.h>
|
||||
#include <ti/drivers/spi/SPICC26XXDMA.h>
|
||||
|
||||
#define SPI_BUFFER_SIZE 20
|
||||
|
||||
static uint8_t spi_txbuf[SPI_BUFFER_SIZE] = {0};
|
||||
static uint8_t spi_rxbuf[SPI_BUFFER_SIZE] = {0};
|
||||
|
||||
static SPI_Handle headstage_spi_handle = NULL;
|
||||
|
||||
static SPI_Transaction headstage_spi_transaction;
|
||||
|
||||
static void headstage_spi_callback(SPI_Handle handle, SPI_Transaction* transaction);
|
||||
|
||||
// SPI parameters initialize
|
||||
#define headstage_spi_open() \
|
||||
do { \
|
||||
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); \
|
||||
} 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(length) \
|
||||
({ \
|
||||
headstage_spi_transaction.count = (length); \
|
||||
headstage_spi_transaction.txBuf = (spi_txbuf); \
|
||||
headstage_spi_transaction.rxBuf = (spi_rxbuf); \
|
||||
SPI_transfer(headstage_spi_handle, &headstage_spi_transaction); \
|
||||
})
|
||||
|
||||
#define headstage_spi_close(spi_handle) \
|
||||
do { \
|
||||
if (spi_handle != NULL) { \
|
||||
SPI_close(spi_handle); \
|
||||
spi_handle = NULL; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define headstage_spi_transaction_cancel(spi_handle) \
|
||||
do { \
|
||||
if (spi_handle != NULL) { \
|
||||
SPI_transferCancel(spi_handle); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
+305
@@ -0,0 +1,305 @@
|
||||
{
|
||||
"name": "Neulive",
|
||||
"version": "2.0",
|
||||
"match_rule": {
|
||||
"local_name_pattern": "Neulive.*",
|
||||
"major_product_number": 1,
|
||||
"minor_product_number": 1,
|
||||
"major_version_number": 2,
|
||||
"minor_version_number": 0
|
||||
},
|
||||
"constant": {
|
||||
"REC_CHANNEL_COUNT": 16,
|
||||
"STI_VOLT_CHANNEL_COUNT": 16,
|
||||
"STI_AMP_CHANNEL_COUNT": 8
|
||||
},
|
||||
"parameters": {
|
||||
"CHANNEL": {
|
||||
"description": "record channels",
|
||||
"record_meta": true,
|
||||
"domain": {
|
||||
"set": [
|
||||
"REC_CHANNEL_COUNT"
|
||||
]
|
||||
}
|
||||
},
|
||||
"STI_VOLT_PCHANNEL": {
|
||||
"description": "stimulation voltage mode channels",
|
||||
"record_meta": true,
|
||||
"domain": {
|
||||
"set": [
|
||||
"STI_VOLT_CHANNEL_COUNT"
|
||||
]
|
||||
},
|
||||
"guard": "STI_VOLT_PCHANNEL != STI_VOLT_NCHANNEL"
|
||||
},
|
||||
"STI_VOLT_NCHANNEL": {
|
||||
"description": "stimulation voltage mode channels",
|
||||
"record_meta": true,
|
||||
"domain": {
|
||||
"set": [
|
||||
"STI_VOLT_CHANNEL_COUNT"
|
||||
]
|
||||
},
|
||||
"guard": "STI_VOLT_PCHANNEL != STI_VOLT_NCHANNEL"
|
||||
},
|
||||
"STI_AMP_PCHANNEL": {
|
||||
"description": "stimulation ampere mode p channel",
|
||||
"record_meta": true,
|
||||
"domain": {
|
||||
"set": [
|
||||
"STI_AMP_CHANNEL_COUNT"
|
||||
]
|
||||
},
|
||||
"guard": "STI_AMP_PCHANNEL != STI_AMP_NCHANNEL"
|
||||
},
|
||||
"STI_AMP_NCHANNEL": {
|
||||
"description": "stimulation ampere mode n channel",
|
||||
"record_meta": true,
|
||||
"domain": {
|
||||
"set": [
|
||||
"STI_AMP_CHANNEL_COUNT"
|
||||
]
|
||||
},
|
||||
"guard": "STI_AMP_PCHANNEL != STI_AMP_NCHANNEL"
|
||||
},
|
||||
"STI_TIME_DURATION_ONE": {
|
||||
"description": "stimulation pattern",
|
||||
"record_meta": false,
|
||||
"domain": [
|
||||
1024
|
||||
],
|
||||
"guard": "STI_TIME_DURATION_ONE < 1"
|
||||
},
|
||||
"STI_TIME_DURATION_TWO": {
|
||||
"description": "stimulation pattern",
|
||||
"record_meta": false,
|
||||
"domain": [
|
||||
1024
|
||||
]
|
||||
},
|
||||
"STI_TIME_DURATION_THREE": {
|
||||
"description": "stimulation pattern",
|
||||
"record_meta": false,
|
||||
"domain": [
|
||||
1024
|
||||
]
|
||||
},
|
||||
"STI_TIME_DURATION_FOUR": {
|
||||
"description": "stimulation pattern",
|
||||
"record_meta": false,
|
||||
"domain": [
|
||||
65536
|
||||
]
|
||||
},
|
||||
"STI_TIME_DURATION_FIVE": {
|
||||
"description": "stimulation pattern",
|
||||
"record_meta": false,
|
||||
"domain": [
|
||||
2048
|
||||
]
|
||||
},
|
||||
"AMP_GAIN": {
|
||||
"description": "amplifier gain setting",
|
||||
"record_meta": true,
|
||||
"value": [
|
||||
25,
|
||||
100,
|
||||
400,
|
||||
800
|
||||
]
|
||||
},
|
||||
"STI_MODE": {
|
||||
"description": "how to execute stimulus",
|
||||
"value": [
|
||||
"DISABLE",
|
||||
"LIMITED",
|
||||
"CONTINUOUS"
|
||||
]
|
||||
},
|
||||
"STI_AMPERE_HIGH_SIDE": {
|
||||
"description": "stimulation ampere for pmos, unit: uA ",
|
||||
"type": "int",
|
||||
"domain": [
|
||||
1024
|
||||
],
|
||||
"value": "VALUE * 4"
|
||||
},
|
||||
"STI_AMPERE_LOW_SIDE": {
|
||||
"description": "stimulation ampere for nmos, unit: uA",
|
||||
"type": "int",
|
||||
"domain": [
|
||||
1024
|
||||
],
|
||||
"value": "VALUE * 4"
|
||||
},
|
||||
"STI_VOLTAGE_AMPLITUDE": {
|
||||
"description": "stimulation voltage mode, unit: Volt ",
|
||||
"type": "float",
|
||||
"domain": [
|
||||
32
|
||||
],
|
||||
"value": " 2 + VALUE / 31"
|
||||
},
|
||||
"STI_TIMES": {
|
||||
"description": "how many times will be executed",
|
||||
"domain": [
|
||||
256
|
||||
]
|
||||
},
|
||||
"SYSTEM_CLOCK_RATIO": {
|
||||
"description": "frequency of system clock, unit: khz",
|
||||
"type": "float",
|
||||
"domain": [
|
||||
65536
|
||||
],
|
||||
"value": " 8000 / VALUE",
|
||||
"guard": "SYSTEM_CLOCK_RATIO < 2"
|
||||
},
|
||||
"ADC_CLOCK_RATIO": {
|
||||
"description": "adc sampling rate, unit: khz",
|
||||
"type": "float",
|
||||
"domain": [
|
||||
65536
|
||||
],
|
||||
"value": " SYSTEM_CLOCK_RATIO / VALUE ",
|
||||
"guard": "ADC_CLOCK_RATIO < 28"
|
||||
},
|
||||
"STI_CLOCK_RATIO": {
|
||||
"description": "stimulation rate",
|
||||
"type": "float",
|
||||
"domain": [
|
||||
65536
|
||||
],
|
||||
"value": "SYSTEM_CLOCK_RATIO / VALUE",
|
||||
"guard": "STI_CLOCK_RATIO < 2"
|
||||
},
|
||||
"ARBITRARY_EN": {
|
||||
"description": "arbitrary stimulation enable",
|
||||
"domain": "bool"
|
||||
},
|
||||
"ARBITRARY_CH": {
|
||||
"description": "arbitrary stimulation enable channels",
|
||||
"domain": "int",
|
||||
"value": " ( 1 << STI_AMP_PCHANNEL ) if (ARBITRARY_EN) else 0 "
|
||||
},
|
||||
"ARBITRARY_INDEX": {
|
||||
"description": "define the last point of arbitrary data, from zero to arbitrary_index. ",
|
||||
"domain": "INT",
|
||||
"guard": "VALUE > 499"
|
||||
},
|
||||
"H_BRIDGE": {
|
||||
"description": "whether to contruct a h bridge execute a stimulation",
|
||||
"domain": "bool"
|
||||
},
|
||||
"STI_REF": {
|
||||
"description": "bipolar or monopolar",
|
||||
"domain": "bool"
|
||||
},
|
||||
"FAST_SETTLE": {
|
||||
"description": "protect amplifier input when stimulation is executed",
|
||||
"domain": "bool"
|
||||
},
|
||||
"UMC_TEST": {
|
||||
"description": "start umc test mode",
|
||||
"domain": "action",
|
||||
"on_change": "umc_default"
|
||||
},
|
||||
"UMC_RESET": {
|
||||
"description": "reset headstage to perform another setting",
|
||||
"domain": "action",
|
||||
"on_change": "reset"
|
||||
},
|
||||
"UMC_TRIGGER": {
|
||||
"description": "trigger stimulation when device is in trigger mode",
|
||||
"domain": "action",
|
||||
"on_change": "STIMULUS"
|
||||
}
|
||||
},
|
||||
"instruction": {
|
||||
"start": [
|
||||
{
|
||||
"expression": "len(CHANNEL) > 0",
|
||||
"raise": "no recording channel"
|
||||
},
|
||||
"data_format",
|
||||
"_notify(True)",
|
||||
"start_recording",
|
||||
"umc_parameter",
|
||||
"_sync(True)",
|
||||
"VIS_STI"
|
||||
],
|
||||
"trigger stimulation": [
|
||||
"umc_sti_trigger0"
|
||||
],
|
||||
"umc_reset": [
|
||||
"VIS_RST"
|
||||
],
|
||||
"data_format": [
|
||||
"_data_format('TDC4VAF2')"
|
||||
],
|
||||
"start_recording": {
|
||||
"type": "RIS",
|
||||
"data": [
|
||||
"3b101#direct header;2b0#don't care;3b>LOW_FREQ_BAND",
|
||||
"2b0#don't care;1bCHOPPER;1bFAST_SETTLE;3b>STI_WAVEFORM",
|
||||
"5b>STI_AMPERE;4b>STI_PMOS",
|
||||
"4b>STI_NMOS;4b>SAMPLE_RATE"
|
||||
]
|
||||
},
|
||||
"umc_parameter": {
|
||||
"type": "RIS",
|
||||
"foreach-parameter": {
|
||||
"parameter": "CHANNEL",
|
||||
"variable": [
|
||||
"a",
|
||||
"b",
|
||||
"c",
|
||||
"d"
|
||||
]
|
||||
},
|
||||
"data": [
|
||||
"3b001#umc parameter header;3b>AMP_GAIN",
|
||||
"4b>PULSE_WIDTH;6b>STI_TIMES",
|
||||
"2b>STI_MODE;6b>STI_FREQ",
|
||||
"1ba?;1bb?;1bc?;1bd?",
|
||||
"4b>a?:0;4b>b?:0",
|
||||
"4b>c?:0;4b>d?:0"
|
||||
]
|
||||
},
|
||||
"umc_default": [
|
||||
"_set('CHANNEL', 0)",
|
||||
"_set('SAMPLE_RATE', 0)",
|
||||
"_set('AMP_GAIN', 5)",
|
||||
"_set('STI_WAVEFORM', 1)",
|
||||
"_set('STI_MODE', 1)",
|
||||
"_set('STI_NMOS', 0)",
|
||||
"_set('STI_PMOS', 1)",
|
||||
"_set('STI_AMPERE', 0)",
|
||||
"_set('STI_FREQ', 0)",
|
||||
"_set('STI_TIMES', 0)",
|
||||
"_set('PULSE_WIDTH', 0)",
|
||||
"_set('FAST_SETTLE', 1)",
|
||||
"_set('CHOPPER', 0)",
|
||||
"data_format",
|
||||
"_notify(True)",
|
||||
"umc_default0",
|
||||
"_sync(True)",
|
||||
"VIS_STI"
|
||||
],
|
||||
"umc_default0": {
|
||||
"type": "RIS",
|
||||
"data": [
|
||||
"1B0#load umc default parameter into uni"
|
||||
]
|
||||
},
|
||||
"umc_sti_trigger0": {
|
||||
"type": "RIS",
|
||||
"description": "this function is perform only in trigger mode",
|
||||
"data": [
|
||||
"1BC0# trigger stimulation when recording is performed"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
@startuml
|
||||
start
|
||||
:stimulation select;
|
||||
if (continuous) then (yes)
|
||||
if(current mode / voltage mode) then (current mode)
|
||||
:sti parameter setup;
|
||||
else (voltage mode)
|
||||
:sti parameter setup;
|
||||
endif
|
||||
else if (limited)
|
||||
if(current mode / voltage mode) then (current mode)
|
||||
:sti parameter setup;
|
||||
else (voltage mode)
|
||||
:sti parameter setup;
|
||||
endif
|
||||
else (disable)
|
||||
endif
|
||||
stop
|
||||
@enduml
|
||||
+8
-17
@@ -14,7 +14,7 @@ static uint32_t not_buf_offset = NOT_BUF_OFFSET_INIT;
|
||||
static uint32_t not_time_stamp = 0;
|
||||
|
||||
static void headstage_notify_set_timestamp() {
|
||||
not_time_stamp = headstage_time_stamp_us() ;
|
||||
not_time_stamp = headstage_time_stamp_us();
|
||||
|
||||
headstage_notify_buffer[2] = not_time_stamp & 0xFF;
|
||||
headstage_notify_buffer[3] = (not_time_stamp >> 8) & 0xFF;
|
||||
@@ -34,22 +34,9 @@ static void headstage_notify_flip_buffer() {
|
||||
static uint8_t headstage_notify_append_data(uint8_t channel, uint8_t *data_value) {
|
||||
if (not_buf_offset <= NOT_BUF_OFFSET_INIT) {
|
||||
headstage_notify_set_timestamp();
|
||||
|
||||
not_buf_offset = NOT_BUF_OFFSET_INIT;
|
||||
}
|
||||
|
||||
if (not_buf_offset == NOT_BUF_OFFSET_INIT + 2) {
|
||||
uint32_t current = headstage_time_stamp_us();
|
||||
uint32_t time_delta = ((current - not_time_stamp) >> 1) & 0xFFFF;
|
||||
|
||||
headstage_notify_buffer[6] = time_delta & 0xFF;
|
||||
headstage_notify_buffer[7] = (time_delta >> 8) & 0xFF;
|
||||
}
|
||||
|
||||
if (not_buf_offset >= BLE_NOT_BUFF_SIZE) {
|
||||
return not_buf_offset;
|
||||
}
|
||||
|
||||
if (data_value == NULL) {
|
||||
headstage_notify_buffer[not_buf_offset++] = ((channel & 0x0F) << 4);
|
||||
headstage_notify_buffer[not_buf_offset++] = 0x03;
|
||||
@@ -58,12 +45,16 @@ static uint8_t headstage_notify_append_data(uint8_t channel, uint8_t *data_value
|
||||
headstage_notify_buffer[not_buf_offset++] = data_value[2] & 0xFC;
|
||||
}
|
||||
|
||||
uint8_t ret = not_buf_offset;
|
||||
if (not_buf_offset == BLE_NOT_BUFF_SIZE) {
|
||||
uint32_t current = headstage_time_stamp_us();
|
||||
uint32_t time_delta = ((current - not_time_stamp)) & 0xFFFF;
|
||||
|
||||
if (not_buf_offset >= BLE_NOT_BUFF_SIZE) {
|
||||
headstage_notify_flip_buffer();
|
||||
headstage_notify_buffer[6] = time_delta & 0xFF;
|
||||
headstage_notify_buffer[7] = (time_delta >> 8) & 0xFF;
|
||||
}
|
||||
|
||||
uint8_t ret = not_buf_offset;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -2,4 +2,4 @@
|
||||
*/
|
||||
#ifndef HEADSTAGE_ADC_H
|
||||
#define HEADSTAGE_ADC_H
|
||||
#endif // HEADSTAGE_ADC_H
|
||||
#endif // HEADSTAGE_ADC_H
|
||||
|
||||
+32
@@ -42,6 +42,38 @@
|
||||
|
||||
// clang-format on
|
||||
|
||||
/*
|
||||
* SPI0 interface with DBS chip 2.0
|
||||
*/
|
||||
#define Board_SPI0_MISO PIN_UNASSIGNED
|
||||
#define Board_SPI0_MOSI PIN_LSK_MOSI
|
||||
#define Board_SPI0_CLK PIN_LSK_CLK
|
||||
#define Board_SPI0_CSN PIN_LSK_CS
|
||||
|
||||
/*
|
||||
* SPI1 interface work with LED
|
||||
*/
|
||||
|
||||
#define Board_SPI1_MISO PIN_UNASSIGNED
|
||||
#define Board_SPI1_MOSI PIN_ASK_MOSI
|
||||
#define Board_SPI1_CLK PIN_UNASSIGNED
|
||||
#define Board_SPI1_CSN PIN_ASK_CS
|
||||
|
||||
/* Power Management Board */
|
||||
#define Board_SRDY Board_BP_Pin_J2_19
|
||||
#define Board_MRDY Board_BP_Pin_J1_2
|
||||
|
||||
/* PWM outputs */
|
||||
#define Board_PWMPIN0 PIN_AMP_VCK
|
||||
#define Board_PWMPIN1 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN2 PIN_CLOCK_8M
|
||||
#define Board_PWMPIN3 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN4 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN5 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN6 PIN_UNASSIGNED
|
||||
#define Board_PWMPIN7 PIN_UNASSIGNED
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
static PIN_Config headstage_pin_configuration[] = { //
|
||||
|
||||
+83
-66
@@ -5,60 +5,60 @@
|
||||
"local_name_pattern": "Neulive.*",
|
||||
"major_product_number": 1,
|
||||
"minor_product_number": 1,
|
||||
"major_version_number": 0,
|
||||
"major_version_number": 1,
|
||||
"minor_version_number": 2
|
||||
},
|
||||
"constant": {
|
||||
"REC_CHANNEL_COUNT": 13,
|
||||
"STI_CHANNEL_COUNT": 4,
|
||||
"ADC_SAMPLE_RATE_LIST": [
|
||||
10000,
|
||||
19000,
|
||||
38000,
|
||||
76000,
|
||||
152000
|
||||
2000,
|
||||
3800,
|
||||
7600,
|
||||
15200,
|
||||
30400
|
||||
],
|
||||
"STI_FREQ_LIST": [
|
||||
6,
|
||||
8,
|
||||
10,
|
||||
12,
|
||||
14,
|
||||
16,
|
||||
18,
|
||||
20,
|
||||
22,
|
||||
24,
|
||||
26,
|
||||
28,
|
||||
30,
|
||||
32,
|
||||
34,
|
||||
36,
|
||||
38,
|
||||
40,
|
||||
50,
|
||||
60,
|
||||
70,
|
||||
80,
|
||||
90,
|
||||
100,
|
||||
110,
|
||||
120,
|
||||
130,
|
||||
140,
|
||||
150,
|
||||
160,
|
||||
170,
|
||||
180,
|
||||
190,
|
||||
200,
|
||||
400,
|
||||
600,
|
||||
800,
|
||||
1000,
|
||||
2000,
|
||||
3000,
|
||||
4000,
|
||||
5000,
|
||||
6000,
|
||||
7000,
|
||||
8000,
|
||||
9000,
|
||||
10000
|
||||
1200,
|
||||
1400,
|
||||
1600,
|
||||
1800,
|
||||
2000
|
||||
],
|
||||
"STI_PULSE_WIDTH": [
|
||||
40,
|
||||
90,
|
||||
140,
|
||||
190,
|
||||
240,
|
||||
290,
|
||||
340,
|
||||
390,
|
||||
440,
|
||||
490
|
||||
80,
|
||||
180,
|
||||
280,
|
||||
380,
|
||||
480,
|
||||
580,
|
||||
680,
|
||||
780,
|
||||
880,
|
||||
980
|
||||
]
|
||||
},
|
||||
"parameters": {
|
||||
@@ -84,12 +84,12 @@
|
||||
"description": "amp gain",
|
||||
"record_meta": true,
|
||||
"value": [
|
||||
2,
|
||||
5,
|
||||
10,
|
||||
200,
|
||||
500,
|
||||
1000
|
||||
3,
|
||||
40,
|
||||
70,
|
||||
30,
|
||||
400,
|
||||
700
|
||||
]
|
||||
},
|
||||
"LOW_FREQ_BAND": {
|
||||
@@ -99,7 +99,7 @@
|
||||
8
|
||||
]
|
||||
},
|
||||
"STI_BEHAVIOR": {
|
||||
"STI_MODE": {
|
||||
"description": "how to execute stimulus",
|
||||
"value": [
|
||||
"DISABLE",
|
||||
@@ -108,8 +108,8 @@
|
||||
"CONTINUOUS"
|
||||
]
|
||||
},
|
||||
"STI_MODE": {
|
||||
"description": "stimulation mode",
|
||||
"STI_WAVEFORM": {
|
||||
"description": "describe the waveform of stimulation",
|
||||
"value": [
|
||||
"Positive Pulse",
|
||||
"Negative Pulse",
|
||||
@@ -119,12 +119,12 @@
|
||||
]
|
||||
},
|
||||
"STI_VOLT": {
|
||||
"description": "stimulation voltage",
|
||||
"description": "stimulation volt, unit: V ",
|
||||
"type": "float",
|
||||
"domain": [
|
||||
32
|
||||
],
|
||||
"value": "2 + 3 * VALUE / 31"
|
||||
"value": " 2 + 3 * VALUE / 31"
|
||||
},
|
||||
"STI_TIMES": {
|
||||
"description": "how many times will be executed",
|
||||
@@ -162,17 +162,27 @@
|
||||
"value": "STI_PULSE_WIDTH[VALUE]"
|
||||
},
|
||||
"CHOPPER": {
|
||||
"description": "",
|
||||
"description": "default_disable",
|
||||
"domain": "bool"
|
||||
},
|
||||
"FAST_SETTLE": {
|
||||
"description": "",
|
||||
"description": "protect amplifier input when stimulation is executed",
|
||||
"domain": "bool"
|
||||
},
|
||||
"UMC_TEST": {
|
||||
"description": "start umc test mode",
|
||||
"domain": "action",
|
||||
"on_change": "umc_default"
|
||||
},
|
||||
"UMC_RESET": {
|
||||
"description": "reset headstage to perform another setting",
|
||||
"domain": "action",
|
||||
"on_change": "reset"
|
||||
},
|
||||
"UMC_TRIGGER": {
|
||||
"description": "trigger stimulation when device is in trigger mode",
|
||||
"domain": "action",
|
||||
"on_change": "STIMULUS"
|
||||
}
|
||||
},
|
||||
"instruction": {
|
||||
@@ -188,10 +198,10 @@
|
||||
"_sync(True)",
|
||||
"VIS_STI"
|
||||
],
|
||||
"stop": [
|
||||
"VIS_INT"
|
||||
"trigger stimulation": [
|
||||
"umc_sti_trigger0"
|
||||
],
|
||||
"restart": [
|
||||
"umc_reset": [
|
||||
"VIS_RST"
|
||||
],
|
||||
"data_format": [
|
||||
@@ -201,7 +211,7 @@
|
||||
"type": "RIS",
|
||||
"data": [
|
||||
"3b101#direct header;2b0#don't care;3b>LOW_FREQ_BAND",
|
||||
"2b0#don't care;1bCHOPPER;1bFAST_SETTLE;3b>STI_MODE",
|
||||
"2b0#don't care;1bCHOPPER;1bFAST_SETTLE;3b>STI_WAVEFORM",
|
||||
"5b>STI_VOLT;4b>STI_PMOS",
|
||||
"4b>STI_NMOS;4b>SAMPLE_RATE"
|
||||
]
|
||||
@@ -220,27 +230,26 @@
|
||||
"data": [
|
||||
"3b001#umc parameter header;3b>AMP_GAIN",
|
||||
"4b>PULSE_WIDTH;6b>STI_TIMES",
|
||||
"2b>STI_BEHAVIOR;6b>STI_FREQ",
|
||||
"2b>STI_MODE;6b>STI_FREQ",
|
||||
"1ba?;1bb?;1bc?;1bd?",
|
||||
"4b>a?:0;4b>b?:0",
|
||||
"4b>c?:0;4b>d?:0"
|
||||
]
|
||||
},
|
||||
"umc_default": [
|
||||
"_set('CHANNEL', 1)",
|
||||
"_set('CHANNEL', 0)",
|
||||
"_set('SAMPLE_RATE', 0)",
|
||||
"_set('AMP_GAIN', 5)",
|
||||
"_set('STI_BEHAVIOR', 1)",
|
||||
"_set('STI_MODE', 0)",
|
||||
"_set('STI_NMOS', STI_PMOS + 1)",
|
||||
"_set('STI_PMOS', 0)",
|
||||
"_set('STI_NMOS', 1)",
|
||||
"_set('STI_WAVEFORM', 1)",
|
||||
"_set('STI_MODE', 1)",
|
||||
"_set('STI_NMOS', 0)",
|
||||
"_set('STI_PMOS', 1)",
|
||||
"_set('STI_VOLT', 0)",
|
||||
"_set('STI_FREQ', 0)",
|
||||
"_set('STI_TIMES', 0)",
|
||||
"_set('PULSE_WIDTH', 0)",
|
||||
"_set('FAST_SETTLE', 0)",
|
||||
"_set('CHOPPER', 1)",
|
||||
"_set('FAST_SETTLE', 1)",
|
||||
"_set('CHOPPER', 0)",
|
||||
"data_format",
|
||||
"_notify(True)",
|
||||
"umc_default0",
|
||||
@@ -252,6 +261,14 @@
|
||||
"data": [
|
||||
"1B0#load umc default parameter into uni"
|
||||
]
|
||||
},
|
||||
"umc_sti_trigger0": {
|
||||
"type": "RIS",
|
||||
"description": "this function is perform only in trigger mode",
|
||||
"data": [
|
||||
"1BC0# trigger stimulation when recording is performed"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+110
-80
@@ -1,64 +1,64 @@
|
||||
{
|
||||
"name": "Neulive",
|
||||
"version": "0.2",
|
||||
"version": "1.3",
|
||||
"match_rule": {
|
||||
"local_name_pattern": "Neulive.*",
|
||||
"major_product_number": 1,
|
||||
"minor_product_number": 1,
|
||||
"major_version_number": 0,
|
||||
"minor_version_number": 2
|
||||
"major_version_number": 1,
|
||||
"minor_version_number": 3
|
||||
},
|
||||
"constant": {
|
||||
"REC_CHANNEL_COUNT": 13,
|
||||
"REC_CHANNEL_COUNT": 12,
|
||||
"STI_CHANNEL_COUNT": 4,
|
||||
"ADC_SAMPLE_RATE_LIST": [
|
||||
10000,
|
||||
19000,
|
||||
38000,
|
||||
76000,
|
||||
152000
|
||||
2000,
|
||||
3800,
|
||||
7600,
|
||||
15200,
|
||||
30400
|
||||
],
|
||||
"STI_FREQ_LIST": [
|
||||
6,
|
||||
8,
|
||||
10,
|
||||
12,
|
||||
14,
|
||||
16,
|
||||
18,
|
||||
20,
|
||||
22,
|
||||
24,
|
||||
26,
|
||||
28,
|
||||
30,
|
||||
32,
|
||||
34,
|
||||
36,
|
||||
38,
|
||||
40,
|
||||
50,
|
||||
60,
|
||||
70,
|
||||
80,
|
||||
90,
|
||||
100,
|
||||
110,
|
||||
120,
|
||||
130,
|
||||
140,
|
||||
150,
|
||||
160,
|
||||
170,
|
||||
180,
|
||||
190,
|
||||
200,
|
||||
400,
|
||||
600,
|
||||
800,
|
||||
1000,
|
||||
2000,
|
||||
3000,
|
||||
4000,
|
||||
5000,
|
||||
6000,
|
||||
7000,
|
||||
8000,
|
||||
9000,
|
||||
10000
|
||||
1200,
|
||||
1400,
|
||||
1600,
|
||||
1800,
|
||||
2000
|
||||
],
|
||||
"STI_PULSE_WIDTH": [
|
||||
40,
|
||||
90,
|
||||
140,
|
||||
190,
|
||||
240,
|
||||
290,
|
||||
340,
|
||||
390,
|
||||
440,
|
||||
490
|
||||
80,
|
||||
180,
|
||||
280,
|
||||
380,
|
||||
480,
|
||||
580,
|
||||
680,
|
||||
780,
|
||||
880,
|
||||
980
|
||||
]
|
||||
},
|
||||
"parameters": {
|
||||
@@ -84,22 +84,22 @@
|
||||
"description": "amp gain",
|
||||
"record_meta": true,
|
||||
"value": [
|
||||
2,
|
||||
5,
|
||||
10,
|
||||
200,
|
||||
500,
|
||||
1000
|
||||
3,
|
||||
14,
|
||||
27,
|
||||
60,
|
||||
280,
|
||||
540
|
||||
]
|
||||
},
|
||||
"LOW_FREQ_BAND": {
|
||||
"description": "",
|
||||
"description": "low pass filter",
|
||||
"record_meta": true,
|
||||
"domain": [
|
||||
8
|
||||
]
|
||||
},
|
||||
"STI_BEHAVIOR": {
|
||||
"STI_MODE": {
|
||||
"description": "how to execute stimulus",
|
||||
"value": [
|
||||
"DISABLE",
|
||||
@@ -108,8 +108,8 @@
|
||||
"CONTINUOUS"
|
||||
]
|
||||
},
|
||||
"STI_MODE": {
|
||||
"description": "stimulation mode",
|
||||
"STI_WAVEFORM": {
|
||||
"description": "describe the waveform of stimulation",
|
||||
"value": [
|
||||
"Positive Pulse",
|
||||
"Negative Pulse",
|
||||
@@ -118,13 +118,13 @@
|
||||
"Arbitrary Waveform"
|
||||
]
|
||||
},
|
||||
"STI_VOLT": {
|
||||
"description": "stimulation voltage",
|
||||
"STI_AMPERE": {
|
||||
"description": "stimulation ampere, unit: uA ",
|
||||
"type": "float",
|
||||
"domain": [
|
||||
32
|
||||
],
|
||||
"value": "2 + 3 * VALUE / 31"
|
||||
"value": " 31 * VALUE "
|
||||
},
|
||||
"STI_TIMES": {
|
||||
"description": "how many times will be executed",
|
||||
@@ -162,17 +162,27 @@
|
||||
"value": "STI_PULSE_WIDTH[VALUE]"
|
||||
},
|
||||
"CHOPPER": {
|
||||
"description": "",
|
||||
"description": "default_disable",
|
||||
"domain": "bool"
|
||||
},
|
||||
"FAST_SETTLE": {
|
||||
"description": "",
|
||||
"description": "protect amplifier input when stimulation is executed",
|
||||
"domain": "bool"
|
||||
},
|
||||
"UMC_TEST": {
|
||||
"description": "start umc test mode",
|
||||
"domain": "action",
|
||||
"on_change": "umc_default"
|
||||
},
|
||||
"UMC_RESET": {
|
||||
"description": "reset headstage to perform another setting",
|
||||
"domain": "action",
|
||||
"on_change": "reset"
|
||||
},
|
||||
"UMC_TRIGGER": {
|
||||
"description": "trigger stimulation when device is in trigger mode",
|
||||
"domain": "action",
|
||||
"on_change": "STIMULUS"
|
||||
}
|
||||
},
|
||||
"instruction": {
|
||||
@@ -181,12 +191,19 @@
|
||||
"expression": "len(CHANNEL) > 0",
|
||||
"raise": "no recording channel"
|
||||
},
|
||||
"data_format",
|
||||
"_notify(True)",
|
||||
"start_recording",
|
||||
"umc_parameter",
|
||||
"_sync(True)",
|
||||
"VIS_STI"
|
||||
],
|
||||
"trigger stimulation": [
|
||||
"umc_sti_trigger0"
|
||||
],
|
||||
"umc_reset": [
|
||||
"VIS_RST"
|
||||
],
|
||||
"data_format": [
|
||||
"_data_format('TDC4VAF2')"
|
||||
],
|
||||
@@ -194,40 +211,45 @@
|
||||
"type": "RIS",
|
||||
"data": [
|
||||
"3b101#direct header;2b0#don't care;3b>LOW_FREQ_BAND",
|
||||
"4b0#don't care;1bCHOPPER;1bFAST_SETTLE",
|
||||
"5b>STI_VOLT;4b>STI_PMOS",
|
||||
"2b0#don't care;1bCHOPPER;1bFAST_SETTLE;3b>STI_WAVEFORM",
|
||||
"5b>STI_AMPERE;4b>STI_PMOS",
|
||||
"4b>STI_NMOS;4b>SAMPLE_RATE"
|
||||
]
|
||||
},
|
||||
"umc_parameter": {
|
||||
"type": "RIS",
|
||||
"foreach-parameter": {
|
||||
"parameter": "CHANNEL",
|
||||
"variable": [
|
||||
"a",
|
||||
"b",
|
||||
"c",
|
||||
"d"
|
||||
]
|
||||
},
|
||||
"data": [
|
||||
"3b001#umc parameter header",
|
||||
"3b>AMP_GAIN;4b>PULSE_WIDTH",
|
||||
"6b>STI_TIMES;2b>STI_BEHAVIOR",
|
||||
"6b>STI_FREQ"
|
||||
"3b001#umc parameter header;3b>AMP_GAIN",
|
||||
"4b>PULSE_WIDTH;6b>STI_TIMES",
|
||||
"2b>STI_MODE;6b>STI_FREQ",
|
||||
"1ba?;1bb?;1bc?;1bd?",
|
||||
"4b>a?:0;4b>b?:0",
|
||||
"4b>c?:0;4b>d?:0"
|
||||
]
|
||||
},
|
||||
"umc_default": [
|
||||
"_set('CHANNEL', 3)",
|
||||
"_set('CHANNEL', 4)",
|
||||
"_set('CHANNEL', 5)",
|
||||
"_set('CHANNEL', 6)",
|
||||
"_set('CHANNEL', 7)",
|
||||
"_set('CHANNEL', 8)",
|
||||
"_set('SAMPLE_RATE', 9)",
|
||||
"_set('AMP_GAIN', 3)",
|
||||
"_set('STI_BEHAVIOR', 1)",
|
||||
"_set('STI_MODE', 0)",
|
||||
"_set('STI_NMOS', STI_PMOS + 1)",
|
||||
"_set('STI_PMOS', 0)",
|
||||
"_set('STI_NMOS', 1)",
|
||||
"_set('STI_VOLT', 0)",
|
||||
"_set('CHANNEL', 0)",
|
||||
"_set('SAMPLE_RATE', 0)",
|
||||
"_set('AMP_GAIN', 5)",
|
||||
"_set('STI_WAVEFORM', 1)",
|
||||
"_set('STI_MODE', 1)",
|
||||
"_set('STI_NMOS', 0)",
|
||||
"_set('STI_PMOS', 1)",
|
||||
"_set('STI_AMPERE', 0)",
|
||||
"_set('STI_FREQ', 0)",
|
||||
"_set('STI_TIMES', 0)",
|
||||
"_set('PULSE_WIDTH', 0)",
|
||||
"_set('FAST_SETTLE', 0)",
|
||||
"_set('CHOPPER', 1)",
|
||||
"_set('FAST_SETTLE', 1)",
|
||||
"_set('CHOPPER', 0)",
|
||||
"data_format",
|
||||
"_notify(True)",
|
||||
"umc_default0",
|
||||
@@ -239,6 +261,14 @@
|
||||
"data": [
|
||||
"1B0#load umc default parameter into uni"
|
||||
]
|
||||
},
|
||||
"umc_sti_trigger0": {
|
||||
"type": "RIS",
|
||||
"description": "this function is perform only in trigger mode",
|
||||
"data": [
|
||||
"1BC0# trigger stimulation when recording is performed"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
/* Copyright (c) 2019. BioPro. Scientific.
|
||||
*/
|
||||
#ifndef NEULIVE_1P2
|
||||
#define NEULIVE_1P2
|
||||
|
||||
/*============================
|
||||
==== product information ====
|
||||
===========================*/
|
||||
|
||||
#define DEVICE_NAME "Neulive-v1.2"
|
||||
#define MAJOR_PRODUCT_NUMBER 1
|
||||
#define MINOR_PRODUCT_NUMBER 1
|
||||
#define MAJOR_VERSION_NUMBER 1 // need to modify
|
||||
#define MINOR_VERSION_NUMBER 2
|
||||
|
||||
static uint16_t sti_channel_table[4] = {
|
||||
{0b000001}, // 2
|
||||
{0b000111}, // 8
|
||||
{0b001011}, // 12
|
||||
{0b001111} // 16
|
||||
};
|
||||
|
||||
static uint16_t reverse_channel[16] = {{0x0A}, // 1
|
||||
{0x0B},
|
||||
{0x00},
|
||||
{0x01},
|
||||
{0x02},
|
||||
{0x07},
|
||||
{0x06},
|
||||
{0x03},
|
||||
{0x05},
|
||||
{0x04},
|
||||
{0x08},
|
||||
{0xff},
|
||||
{0x0c},
|
||||
{0x09},
|
||||
{0xff},
|
||||
{0xff}};
|
||||
|
||||
static uint16_t amp_channel_table[13] = { //
|
||||
{0x03},
|
||||
{0x04},
|
||||
{0x05},
|
||||
{0x08},
|
||||
{0x0A},
|
||||
{0x09},
|
||||
{0x07},
|
||||
{0x06},
|
||||
{0x0B},
|
||||
{0x0E},
|
||||
{0x01},
|
||||
{0x02},
|
||||
{0x0D}};
|
||||
|
||||
static uint16_t amp_gain_table[] = {
|
||||
0b100011, // 3
|
||||
0b000011, // 30
|
||||
0b101100, // 40
|
||||
0b101001, // 70
|
||||
0b001100, // 400
|
||||
0b001001, // 700
|
||||
};
|
||||
|
||||
#endif
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/* Copyright (c) 2019. BioPro. Scientific.
|
||||
*/
|
||||
#ifndef NEULIVE_1P3
|
||||
#define NEULIVE_1P3
|
||||
|
||||
/*============================
|
||||
==== product information ====
|
||||
===========================*/
|
||||
|
||||
#define DEVICE_NAME "Neulive-v1.3"
|
||||
#define MAJOR_PRODUCT_NUMBER 1
|
||||
#define MINOR_PRODUCT_NUMBER 1
|
||||
#define MAJOR_VERSION_NUMBER 1
|
||||
#define MINOR_VERSION_NUMBER 3
|
||||
|
||||
static uint16_t sti_channel_table[4] = {
|
||||
{0b000010}, // 3
|
||||
{0b000011}, // 4
|
||||
{0b000100}, // 5
|
||||
{0b000101} // 6
|
||||
};
|
||||
|
||||
static uint16_t reverse_channel[16] = {{0x0A}, // 1
|
||||
{0x00},
|
||||
{0x01},
|
||||
{0x02},
|
||||
{0x03},
|
||||
{0x08},
|
||||
{0x07},
|
||||
{0x06},
|
||||
{0x05},
|
||||
{0x04},
|
||||
{0x09},
|
||||
{0x0B},
|
||||
{0xFF},
|
||||
{0xFF},
|
||||
{0xff},
|
||||
{0xff}};
|
||||
|
||||
static uint16_t amp_channel_table[12] = { //
|
||||
{0x02},
|
||||
{0x03},
|
||||
{0x04},
|
||||
{0x05},
|
||||
{0x0A},
|
||||
{0x09},
|
||||
{0x08},
|
||||
{0x07},
|
||||
{0x06},
|
||||
{0x0b},
|
||||
{0x01},
|
||||
{0x0C}};
|
||||
|
||||
static uint16_t amp_gain_table[] = {
|
||||
0b100011, // 3
|
||||
0b101100, // 14
|
||||
0b101001, // 27
|
||||
0b000011, // 60
|
||||
0b001100, // 280
|
||||
0b001001, // 540
|
||||
};
|
||||
|
||||
#endif
|
||||
+139
-159
@@ -184,7 +184,7 @@ typedef struct {
|
||||
static ICall_EntityID self;
|
||||
|
||||
// Semaphore globally used to post events to the application thread
|
||||
static ICall_Semaphore semaphore;
|
||||
ICall_Semaphore semaphore;
|
||||
|
||||
// Queue object used for app messages
|
||||
static Queue_Struct application_message;
|
||||
@@ -221,7 +221,6 @@ static void SimpleBLEPeripheral_sendAttRsp(void);
|
||||
static void SimpleBLEPeripheral_freeAttRsp(uint8_t status);
|
||||
static void SimpleBLEPeripheral_stateChangeCB(gaprole_States_t newState);
|
||||
static void SimpleBLEPeripheral_enqueueMsg(uint8_t event, uint8_t state);
|
||||
static void headstage_data_length_extension();
|
||||
|
||||
#ifndef FEATURE_OAD_ONCHIP
|
||||
static void SimpleBLEPeripheral_charValueChangeCB(uint8_t paramID);
|
||||
@@ -410,7 +409,10 @@ static void SimpleBLEPeripheral_init(void) {
|
||||
|
||||
HCI_LE_ReadMaxDataLenCmd();
|
||||
|
||||
HCI_LE_WriteSuggestedDefaultDataLenCmd(251 , 2120); // this is used for data length extension
|
||||
HCI_LE_WriteSuggestedDefaultDataLenCmd(251, 2120); // this is used for data length extension
|
||||
|
||||
uint8_t prepare_write_req = 6;
|
||||
GATTServApp_SetParameter(GATT_PARAM_NUM_PREPARE_WRITES, 1, &prepare_write_req);
|
||||
}
|
||||
|
||||
#ifndef DEVICE_NAME
|
||||
@@ -444,75 +446,74 @@ static void SimpleBLEPeripheral_init(void) {
|
||||
#endif
|
||||
|
||||
static char *date = __DATE__;
|
||||
static void headstage_init_device_info() {
|
||||
|
||||
static void headstage_init_device_info() {
|
||||
uint8_t year = 10 * (date[9] - '0') + (date[10] - '0');
|
||||
uint8_t month = 0;
|
||||
|
||||
switch (date[0]) {
|
||||
case 'J':
|
||||
// Jan, January
|
||||
// Jun, June
|
||||
// Jul, July
|
||||
if (date[1] == 'a') {
|
||||
month = 1;
|
||||
} else if (date[2] == 'n') {
|
||||
month = 6;
|
||||
} else {
|
||||
month = 7;
|
||||
}
|
||||
break;
|
||||
case 'F':
|
||||
// Feb, February
|
||||
month = 2;
|
||||
break;
|
||||
case 'M':
|
||||
// Mar, March
|
||||
// May, May
|
||||
if (date[2] == 'r') {
|
||||
month = 3;
|
||||
} else {
|
||||
month = 5;
|
||||
}
|
||||
break;
|
||||
case 'A':
|
||||
// Apr, April
|
||||
// Ang, August
|
||||
if (date[1] == 'p') {
|
||||
month = 4;
|
||||
} else {
|
||||
month = 8;
|
||||
}
|
||||
break;
|
||||
case 'S':
|
||||
// Sep, September
|
||||
month = 9;
|
||||
break;
|
||||
case 'O':
|
||||
// Oct, October
|
||||
month = 10;
|
||||
break;
|
||||
case 'N':
|
||||
// Nov, November
|
||||
month = 11;
|
||||
break;
|
||||
case 'D':
|
||||
// Dec, December
|
||||
month = 12;
|
||||
break;
|
||||
case 'J':
|
||||
// Jan, January
|
||||
// Jun, June
|
||||
// Jul, July
|
||||
if (date[1] == 'a') {
|
||||
month = 1;
|
||||
} else if (date[2] == 'n') {
|
||||
month = 6;
|
||||
} else {
|
||||
month = 7;
|
||||
}
|
||||
break;
|
||||
case 'F':
|
||||
// Feb, February
|
||||
month = 2;
|
||||
break;
|
||||
case 'M':
|
||||
// Mar, March
|
||||
// May, May
|
||||
if (date[2] == 'r') {
|
||||
month = 3;
|
||||
} else {
|
||||
month = 5;
|
||||
}
|
||||
break;
|
||||
case 'A':
|
||||
// Apr, April
|
||||
// Ang, August
|
||||
if (date[1] == 'p') {
|
||||
month = 4;
|
||||
} else {
|
||||
month = 8;
|
||||
}
|
||||
break;
|
||||
case 'S':
|
||||
// Sep, September
|
||||
month = 9;
|
||||
break;
|
||||
case 'O':
|
||||
// Oct, October
|
||||
month = 10;
|
||||
break;
|
||||
case 'N':
|
||||
// Nov, November
|
||||
month = 11;
|
||||
break;
|
||||
case 'D':
|
||||
// Dec, December
|
||||
month = 12;
|
||||
break;
|
||||
}
|
||||
|
||||
uint8_t scanRspData[64];
|
||||
uint8_t *p = scanRspData;
|
||||
*p++ = sizeof(DEVICE_NAME);
|
||||
*p++ = GAP_ADTYPE_LOCAL_NAME_COMPLETE;
|
||||
// unsafe_memcpy(p, DEVICE_NAME, sizeof(DEVICE_NAME));
|
||||
for (unsigned int i = 0; i < sizeof(DEVICE_NAME) - 1; i++){
|
||||
// unsafe_memcpy(p, DEVICE_NAME, sizeof(DEVICE_NAME));
|
||||
for (unsigned int i = 0; i < sizeof(DEVICE_NAME) - 1; i++) {
|
||||
*p++ = DEVICE_NAME[i];
|
||||
}
|
||||
*p++ = 11;
|
||||
*p++ = GAP_ADTYPE_MANUFACTURER_SPECIFIC;
|
||||
// unsafe_memcpy(p, "BPHS", 4);
|
||||
// unsafe_memcpy(p, "BPHS", 4);
|
||||
*p++ = 'B';
|
||||
*p++ = 'P';
|
||||
*p++ = 'H';
|
||||
@@ -553,7 +554,7 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
|
||||
// message is queued to the message receive queue of the thread or when
|
||||
// ICall_signal() function is called onto the semaphore.
|
||||
ICall_Errno errno = ICall_wait(ICALL_TIMEOUT_FOREVER);
|
||||
// headstage_watchdog_clear();
|
||||
// headstage_watchdog_clear();
|
||||
if (errno == ICALL_ERRNO_SUCCESS) {
|
||||
ICall_EntityID dest;
|
||||
ICall_ServiceEnum src;
|
||||
@@ -629,22 +630,21 @@ static void SimpleBLEPeripheral_taskFxn(UArg a0, UArg a1) {
|
||||
*/
|
||||
static uint8_t SimpleBLEPeripheral_processStackMsg(ICall_Hdr *message) {
|
||||
switch (message->event) {
|
||||
case GATT_MSG_EVENT:
|
||||
// Process GATT message
|
||||
return SimpleBLEPeripheral_processGATTMsg((gattMsgEvent_t *)message);
|
||||
case GATT_MSG_EVENT:
|
||||
// Process GATT message
|
||||
return SimpleBLEPeripheral_processGATTMsg((gattMsgEvent_t *)message);
|
||||
|
||||
case HCI_GAP_EVENT_EVENT:{ // GAP event
|
||||
switch(message->event)
|
||||
{
|
||||
case HCI_GAP_EVENT_EVENT: { // GAP event
|
||||
switch (message->event) {
|
||||
case HCI_EXT_SET_MAX_DATA_LENGTH_EVENT: {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
default:
|
||||
return TRUE;
|
||||
default:
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -677,9 +677,10 @@ static uint8_t SimpleBLEPeripheral_processGATTMsg(gattMsgEvent_t *message) {
|
||||
|
||||
} else if (message->method == ATT_MTU_UPDATED_EVENT) {
|
||||
// MTU size updated
|
||||
headstage_debug_buffer[10] = 0x0f;
|
||||
headstage_debug_buffer[10] = 0xff;
|
||||
headstage_set_debug_information();
|
||||
// headstage_data_length_extension();
|
||||
} else if (message->method == ATT_HANDLE_VALUE_CFM) {
|
||||
// quick pass
|
||||
}
|
||||
|
||||
// Free message payload. Needed only for ATT Protocol messages
|
||||
@@ -759,13 +760,13 @@ static void SimpleBLEPeripheral_freeAttRsp(uint8_t status) {
|
||||
*/
|
||||
static void SimpleBLEPeripheral_processAppMsg(sbpEvt_t *message) {
|
||||
switch (message->hdr.event) {
|
||||
case SBP_STATE_CHANGE_EVT:
|
||||
SimpleBLEPeripheral_processStateChangeEvt((gaprole_States_t)message->hdr.state);
|
||||
break;
|
||||
case SBP_STATE_CHANGE_EVT:
|
||||
SimpleBLEPeripheral_processStateChangeEvt((gaprole_States_t)message->hdr.state);
|
||||
break;
|
||||
|
||||
case SBP_CHAR_CHANGE_EVT:
|
||||
headstage_characteristic_updated(message->hdr.state);
|
||||
break;
|
||||
case SBP_CHAR_CHANGE_EVT:
|
||||
headstage_characteristic_updated(message->hdr.state);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -793,77 +794,77 @@ static void SimpleBLEPeripheral_stateChangeCB(gaprole_States_t newState) {
|
||||
*/
|
||||
static void SimpleBLEPeripheral_processStateChangeEvt(gaprole_States_t newState) {
|
||||
switch (newState) {
|
||||
case GAPROLE_STARTED: { // Started but not advertising
|
||||
uint8_t ownAddress[B_ADDR_LEN];
|
||||
uint8_t systemId[DEVINFO_SYSTEM_ID_LEN];
|
||||
case GAPROLE_STARTED: { // Started but not advertising
|
||||
uint8_t ownAddress[B_ADDR_LEN];
|
||||
uint8_t systemId[DEVINFO_SYSTEM_ID_LEN];
|
||||
|
||||
GAPRole_GetParameter(GAPROLE_BD_ADDR, ownAddress);
|
||||
GAPRole_GetParameter(GAPROLE_BD_ADDR, ownAddress);
|
||||
|
||||
// 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];
|
||||
// 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];
|
||||
|
||||
// set middle bytes to zero
|
||||
systemId[4] = 0x00;
|
||||
systemId[3] = 0x00;
|
||||
// set middle bytes to zero
|
||||
systemId[4] = 0x00;
|
||||
systemId[3] = 0x00;
|
||||
|
||||
// shift three bytes up
|
||||
systemId[7] = ownAddress[5];
|
||||
systemId[6] = ownAddress[4];
|
||||
systemId[5] = ownAddress[3];
|
||||
// shift three bytes up
|
||||
systemId[7] = ownAddress[5];
|
||||
systemId[6] = ownAddress[4];
|
||||
systemId[5] = ownAddress[3];
|
||||
|
||||
DevInfo_SetParameter(DEVINFO_SYSTEM_ID, DEVINFO_SYSTEM_ID_LEN, systemId);
|
||||
DevInfo_SetParameter(DEVINFO_SYSTEM_ID, DEVINFO_SYSTEM_ID_LEN, systemId);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case GAPROLE_CONNECTED: { // In a connection
|
||||
linkDBInfo_t linkInfo;
|
||||
uint8_t numActive = 0;
|
||||
numActive = linkDB_NumActive();
|
||||
|
||||
headstage_led_spi_color(COLOR_GREEN);
|
||||
|
||||
uint16_t cxnHandle;
|
||||
uint16_t requestedPDUSize = 251;
|
||||
uint16_t requestTxTime = 2120;
|
||||
GAPRole_GetParameter(GAPROLE_CONNHANDLE, &cxnHandle);
|
||||
|
||||
if(SUCCESS != HCI_LE_SetDataLenCmd(cxnHandle, requestedPDUSize, requestTxTime)) {
|
||||
break;
|
||||
}
|
||||
// Use numActive to determine the connection handle of the last
|
||||
// connection
|
||||
if (linkDB_GetInfo(numActive - 1, &linkInfo) == SUCCESS) {
|
||||
} else {
|
||||
uint8_t peerAddress[B_ADDR_LEN];
|
||||
GAPRole_GetParameter(GAPROLE_CONN_BD_ADDR, peerAddress);
|
||||
|
||||
case GAPROLE_CONNECTED: { // In a connection
|
||||
linkDBInfo_t linkInfo;
|
||||
uint8_t numActive = 0;
|
||||
numActive = linkDB_NumActive();
|
||||
|
||||
headstage_led_spi_color(COLOR_CYAN);
|
||||
|
||||
uint16_t cxnHandle;
|
||||
uint16_t requestedPDUSize = 251;
|
||||
uint16_t requestTxTime = 2120;
|
||||
GAPRole_GetParameter(GAPROLE_CONNHANDLE, &cxnHandle);
|
||||
|
||||
if (SUCCESS != HCI_LE_SetDataLenCmd(cxnHandle, requestedPDUSize, requestTxTime)) {
|
||||
}
|
||||
// Use numActive to determine the connection handle of the last
|
||||
// connection
|
||||
if (linkDB_GetInfo(numActive - 1, &linkInfo) == SUCCESS) {
|
||||
} else {
|
||||
uint8_t peerAddress[B_ADDR_LEN];
|
||||
GAPRole_GetParameter(GAPROLE_CONN_BD_ADDR, peerAddress);
|
||||
}
|
||||
flag_notify(EVT_CONNECTED);
|
||||
break;
|
||||
}
|
||||
flag_notify(EVT_CONNECTED);
|
||||
break;
|
||||
}
|
||||
|
||||
case GAPROLE_WAITING:
|
||||
// Device is started but not advertising, is in waiting period before advertising again
|
||||
SimpleBLEPeripheral_freeAttRsp(bleNotConnected);
|
||||
break;
|
||||
case GAPROLE_WAITING:
|
||||
// Device is started but not advertising, is in waiting period before advertising again
|
||||
SimpleBLEPeripheral_freeAttRsp(bleNotConnected);
|
||||
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);
|
||||
headstage_led_spi_color(COLOR_RED);
|
||||
CONNECT_HANDLE = 0xFFFF;
|
||||
flag_notify(EVT_DISCONNECTED);
|
||||
break;
|
||||
case GAPROLE_ERROR: // Error occurred - invalid state
|
||||
headstage_led_spi_color(COLOR_RED);
|
||||
break;
|
||||
case GAPROLE_INIT: // Waiting to be started
|
||||
case GAPROLE_ADVERTISING: // Currently Advertising
|
||||
case GAPROLE_CONNECTED_ADV: // In a connection and advertising
|
||||
default:
|
||||
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);
|
||||
headstage_led_spi_color(COLOR_RED); /** for neulive1.3 call this function ; for neulive2.0 call headstage_led_color */
|
||||
CONNECT_HANDLE = 0xFFFF;
|
||||
flag_notify(EVT_DISCONNECTED);
|
||||
break;
|
||||
case GAPROLE_ERROR: // Error occurred - invalid state
|
||||
headstage_led_spi_color(COLOR_RED);
|
||||
break;
|
||||
case GAPROLE_INIT: // Waiting to be started
|
||||
case GAPROLE_ADVERTISING: // Currently Advertising
|
||||
case GAPROLE_CONNECTED_ADV: // In a connection and advertising
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -939,24 +940,3 @@ static void SimpleBLEPeripheral_enqueueMsg(uint8_t event, uint8_t state) {
|
||||
Util_enqueueMsg(application_message_queue, semaphore, (uint8 *)message);
|
||||
}
|
||||
}
|
||||
|
||||
static void headstage_data_length_extension(){
|
||||
while(1){
|
||||
while (!Queue_empty(application_message_queue))
|
||||
{
|
||||
sbpEvt_t *pMsg = (sbpEvt_t *)Util_dequeueMsg(application_message_queue);
|
||||
if (pMsg)
|
||||
{
|
||||
// Process message.
|
||||
SimpleBLEPeripheral_processAppMsg(pMsg);
|
||||
|
||||
// Free the space from the message.
|
||||
ICall_free(pMsg);
|
||||
}
|
||||
}
|
||||
if (EVENT_MASK > 0) {
|
||||
headstage_event_handle();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+124
-124
@@ -304,57 +304,57 @@ bStatus_t SimpleProfile_RegisterAppCBs(simpleProfileCBs_t *appCallbacks) {
|
||||
*/
|
||||
bStatus_t SimpleProfile_SetParameter(uint8 param, uint8 len, void *value) {
|
||||
switch (param) {
|
||||
case SIMPLEPROFILE_CHAR1:
|
||||
if (len <= SIMPLEPROFILE_CHAR1_LEN) {
|
||||
memcpy(simpleProfileChar1, value, len);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return bleInvalidRange;
|
||||
}
|
||||
case SIMPLEPROFILE_CHAR1:
|
||||
if (len <= SIMPLEPROFILE_CHAR1_LEN) {
|
||||
memcpy(simpleProfileChar1, value, len);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return bleInvalidRange;
|
||||
}
|
||||
|
||||
case SIMPLEPROFILE_CHAR2:
|
||||
if (len <= SIMPLEPROFILE_CHAR2_LEN) {
|
||||
memcpy(simpleProfileChar2, value, len);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return bleInvalidRange;
|
||||
}
|
||||
case SIMPLEPROFILE_CHAR2:
|
||||
if (len <= SIMPLEPROFILE_CHAR2_LEN) {
|
||||
memcpy(simpleProfileChar2, value, len);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return bleInvalidRange;
|
||||
}
|
||||
|
||||
case SIMPLEPROFILE_CHAR3:
|
||||
if (len <= SIMPLEPROFILE_CHAR3_LEN) {
|
||||
memcpy(simpleProfileChar3, value, len);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return bleInvalidRange;
|
||||
}
|
||||
case SIMPLEPROFILE_CHAR3:
|
||||
if (len <= SIMPLEPROFILE_CHAR3_LEN) {
|
||||
memcpy(simpleProfileChar3, value, len);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return bleInvalidRange;
|
||||
}
|
||||
|
||||
case SIMPLEPROFILE_CHAR4:
|
||||
if (len <= SIMPLEPROFILE_CHAR4_LEN) {
|
||||
memcpy(simpleProfileChar4, value, len);
|
||||
case SIMPLEPROFILE_CHAR4:
|
||||
if (len <= SIMPLEPROFILE_CHAR4_LEN) {
|
||||
memcpy(simpleProfileChar4, value, len);
|
||||
|
||||
// See if Notification has been enabled
|
||||
GATTServApp_ProcessCharCfg(simpleProfileChar4Config, //
|
||||
simpleProfileChar4,
|
||||
FALSE,
|
||||
simpleProfileAttrTbl,
|
||||
GATT_NUM_ATTRS(simpleProfileAttrTbl),
|
||||
INVALID_TASK_ID,
|
||||
simpleProfile_ReadAttrCB);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return bleInvalidRange;
|
||||
}
|
||||
// See if Notification has been enabled
|
||||
GATTServApp_ProcessCharCfg(simpleProfileChar4Config, //
|
||||
simpleProfileChar4,
|
||||
FALSE,
|
||||
simpleProfileAttrTbl,
|
||||
GATT_NUM_ATTRS(simpleProfileAttrTbl),
|
||||
INVALID_TASK_ID,
|
||||
simpleProfile_ReadAttrCB);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return bleInvalidRange;
|
||||
}
|
||||
|
||||
case SIMPLEPROFILE_CHAR5:
|
||||
if (len <= SIMPLEPROFILE_CHAR5_LEN) {
|
||||
memcpy(simpleProfileChar5, value, len);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return bleInvalidRange;
|
||||
}
|
||||
case SIMPLEPROFILE_CHAR5:
|
||||
if (len <= SIMPLEPROFILE_CHAR5_LEN) {
|
||||
memcpy(simpleProfileChar5, value, len);
|
||||
return SUCCESS;
|
||||
} else {
|
||||
return bleInvalidRange;
|
||||
}
|
||||
|
||||
default:
|
||||
return INVALIDPARAMETER;
|
||||
default:
|
||||
return INVALIDPARAMETER;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,28 +373,28 @@ bStatus_t SimpleProfile_SetParameter(uint8 param, uint8 len, void *value) {
|
||||
*/
|
||||
bStatus_t SimpleProfile_GetParameter(uint8 param, void *value) {
|
||||
switch (param) {
|
||||
case SIMPLEPROFILE_CHAR1:
|
||||
memcpy(value, simpleProfileChar1, SIMPLEPROFILE_CHAR1_LEN);
|
||||
break;
|
||||
case SIMPLEPROFILE_CHAR1:
|
||||
memcpy(value, simpleProfileChar1, SIMPLEPROFILE_CHAR1_LEN);
|
||||
break;
|
||||
|
||||
case SIMPLEPROFILE_CHAR2:
|
||||
memcpy(value, simpleProfileChar2, SIMPLEPROFILE_CHAR2_LEN);
|
||||
break;
|
||||
case SIMPLEPROFILE_CHAR2:
|
||||
memcpy(value, simpleProfileChar2, SIMPLEPROFILE_CHAR2_LEN);
|
||||
break;
|
||||
|
||||
case SIMPLEPROFILE_CHAR3:
|
||||
memcpy(value, simpleProfileChar3, SIMPLEPROFILE_CHAR3_LEN);
|
||||
break;
|
||||
case SIMPLEPROFILE_CHAR3:
|
||||
memcpy(value, simpleProfileChar3, SIMPLEPROFILE_CHAR3_LEN);
|
||||
break;
|
||||
|
||||
case SIMPLEPROFILE_CHAR4:
|
||||
memcpy(value, simpleProfileChar4, SIMPLEPROFILE_CHAR4_LEN);
|
||||
break;
|
||||
case SIMPLEPROFILE_CHAR4:
|
||||
memcpy(value, simpleProfileChar4, SIMPLEPROFILE_CHAR4_LEN);
|
||||
break;
|
||||
|
||||
case SIMPLEPROFILE_CHAR5:
|
||||
memcpy(value, simpleProfileChar5, SIMPLEPROFILE_CHAR5_LEN);
|
||||
break;
|
||||
case SIMPLEPROFILE_CHAR5:
|
||||
memcpy(value, simpleProfileChar5, SIMPLEPROFILE_CHAR5_LEN);
|
||||
break;
|
||||
|
||||
default:
|
||||
return INVALIDPARAMETER;
|
||||
default:
|
||||
return INVALIDPARAMETER;
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
@@ -433,31 +433,31 @@ static bStatus_t simpleProfile_ReadAttrCB(uint16_t connHandle, //
|
||||
// 16-bit UUID
|
||||
uint16 uuid = BUILD_UINT16(pAttr->type.uuid[0], pAttr->type.uuid[1]);
|
||||
switch (uuid) {
|
||||
case SIMPLEPROFILE_CHAR1_UUID:
|
||||
*pLen = SIMPLEPROFILE_CHAR1_LEN;
|
||||
memcpy(pValue, pAttr->pValue, SIMPLEPROFILE_CHAR1_LEN);
|
||||
break;
|
||||
case SIMPLEPROFILE_CHAR1_UUID:
|
||||
*pLen = SIMPLEPROFILE_CHAR1_LEN;
|
||||
memcpy(pValue, pAttr->pValue, SIMPLEPROFILE_CHAR1_LEN);
|
||||
break;
|
||||
|
||||
case SIMPLEPROFILE_CHAR2_UUID:
|
||||
*pLen = SIMPLEPROFILE_CHAR2_LEN;
|
||||
memcpy(pValue, pAttr->pValue, SIMPLEPROFILE_CHAR2_LEN);
|
||||
break;
|
||||
case SIMPLEPROFILE_CHAR2_UUID:
|
||||
*pLen = SIMPLEPROFILE_CHAR2_LEN;
|
||||
memcpy(pValue, pAttr->pValue, SIMPLEPROFILE_CHAR2_LEN);
|
||||
break;
|
||||
|
||||
case SIMPLEPROFILE_CHAR4_UUID:
|
||||
*pLen = SIMPLEPROFILE_CHAR4_LEN;
|
||||
memcpy(pValue, pAttr->pValue, SIMPLEPROFILE_CHAR4_LEN);
|
||||
break;
|
||||
case SIMPLEPROFILE_CHAR4_UUID:
|
||||
*pLen = SIMPLEPROFILE_CHAR4_LEN;
|
||||
memcpy(pValue, pAttr->pValue, SIMPLEPROFILE_CHAR4_LEN);
|
||||
break;
|
||||
|
||||
case SIMPLEPROFILE_CHAR5_UUID:
|
||||
*pLen = SIMPLEPROFILE_CHAR5_LEN;
|
||||
memcpy(pValue, pAttr->pValue, SIMPLEPROFILE_CHAR5_LEN);
|
||||
break;
|
||||
case SIMPLEPROFILE_CHAR5_UUID:
|
||||
*pLen = SIMPLEPROFILE_CHAR5_LEN;
|
||||
memcpy(pValue, pAttr->pValue, SIMPLEPROFILE_CHAR5_LEN);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Should never get here! (characteristics 3 and 4 do not have read permissions)
|
||||
*pLen = 0;
|
||||
status = ATT_ERR_ATTR_NOT_FOUND;
|
||||
break;
|
||||
default:
|
||||
// Should never get here! (characteristics 3 and 4 do not have read permissions)
|
||||
*pLen = 0;
|
||||
status = ATT_ERR_ATTR_NOT_FOUND;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// 128-bit UUID
|
||||
@@ -496,59 +496,59 @@ static bStatus_t simpleProfile_WriteAttrCB(uint16_t connHandle, //
|
||||
uint16 uuid = BUILD_UINT16(pAttr->type.uuid[0], pAttr->type.uuid[1]);
|
||||
|
||||
switch (uuid) {
|
||||
case SIMPLEPROFILE_CHAR3_UUID:
|
||||
case SIMPLEPROFILE_CHAR3_UUID:
|
||||
|
||||
// Validate the value
|
||||
// Make sure it's not a blob oper
|
||||
if (offset == 0) {
|
||||
if (len >= SIMPLEPROFILE_CHAR3_LEN) {
|
||||
status = ATT_ERR_INVALID_VALUE_SIZE;
|
||||
// Validate the value
|
||||
// Make sure it's not a blob oper
|
||||
if (offset == 0) {
|
||||
if (len >= SIMPLEPROFILE_CHAR3_LEN) {
|
||||
status = ATT_ERR_INVALID_VALUE_SIZE;
|
||||
}
|
||||
} else {
|
||||
status = ATT_ERR_ATTR_NOT_LONG;
|
||||
}
|
||||
} else {
|
||||
status = ATT_ERR_ATTR_NOT_LONG;
|
||||
}
|
||||
|
||||
// Write the value
|
||||
if (status == SUCCESS) {
|
||||
// Copy pValue into the variable we point to from the attribute table.
|
||||
memcpy(pAttr->pValue + offset, pValue, len);
|
||||
memset(pAttr->pValue + len, 0, SIMPLEPROFILE_CHAR3_LEN - len);
|
||||
// Write the value
|
||||
if (status == SUCCESS) {
|
||||
// Copy pValue into the variable we point to from the attribute table.
|
||||
memcpy(pAttr->pValue + offset, pValue, len);
|
||||
memset(pAttr->pValue + len, 0, SIMPLEPROFILE_CHAR3_LEN - len);
|
||||
|
||||
if (pAttr->pValue == simpleProfileChar3) {
|
||||
notifyApp = SIMPLEPROFILE_CHAR3;
|
||||
if (pAttr->pValue == simpleProfileChar3) {
|
||||
notifyApp = SIMPLEPROFILE_CHAR3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case SIMPLEPROFILE_CHAR5_UUID:
|
||||
if (offset == 0) {
|
||||
if (len >= SIMPLEPROFILE_CHAR5_LEN) {
|
||||
status = ATT_ERR_INVALID_VALUE_SIZE;
|
||||
break;
|
||||
case SIMPLEPROFILE_CHAR5_UUID:
|
||||
if (offset == 0) {
|
||||
if (len >= SIMPLEPROFILE_CHAR5_LEN) {
|
||||
status = ATT_ERR_INVALID_VALUE_SIZE;
|
||||
}
|
||||
} else {
|
||||
status = ATT_ERR_ATTR_NOT_LONG;
|
||||
}
|
||||
} else {
|
||||
status = ATT_ERR_ATTR_NOT_LONG;
|
||||
}
|
||||
|
||||
// Write the value
|
||||
if (status == SUCCESS) {
|
||||
// Copy pValue into the variable we point to from the attribute table.
|
||||
memcpy(pAttr->pValue + offset, pValue, len);
|
||||
memset(pAttr->pValue + len, 0, SIMPLEPROFILE_CHAR5_LEN - len);
|
||||
// Write the value
|
||||
if (status == SUCCESS) {
|
||||
// Copy pValue into the variable we point to from the attribute table.
|
||||
memcpy(pAttr->pValue + offset, pValue, len);
|
||||
memset(pAttr->pValue + len, 0, SIMPLEPROFILE_CHAR5_LEN - len);
|
||||
|
||||
if (pAttr->pValue == simpleProfileChar5) {
|
||||
notifyApp = SIMPLEPROFILE_CHAR5;
|
||||
if (pAttr->pValue == simpleProfileChar5) {
|
||||
notifyApp = SIMPLEPROFILE_CHAR5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case GATT_CLIENT_CHAR_CFG_UUID:
|
||||
status = GATTServApp_ProcessCCCWriteReq(connHandle, pAttr, pValue, len, offset, GATT_CLIENT_CFG_NOTIFY);
|
||||
break;
|
||||
break;
|
||||
case GATT_CLIENT_CHAR_CFG_UUID:
|
||||
status = GATTServApp_ProcessCCCWriteReq(connHandle, pAttr, pValue, len, offset, GATT_CLIENT_CFG_NOTIFY);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Should never get here! (characteristics 2 and 4 do not have write permissions)
|
||||
status = ATT_ERR_ATTR_NOT_FOUND;
|
||||
break;
|
||||
default:
|
||||
// Should never get here! (characteristics 2 and 4 do not have write permissions)
|
||||
status = ATT_ERR_ATTR_NOT_FOUND;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// 128-bit UUID
|
||||
|
||||
@@ -84,7 +84,7 @@ extern "C" {
|
||||
#define SIMPLEPROFILE_CHAR1_LEN 2
|
||||
#define SIMPLEPROFILE_CHAR2_LEN 10
|
||||
#define SIMPLEPROFILE_CHAR3_LEN 20
|
||||
#define SIMPLEPROFILE_CHAR4_LEN 20
|
||||
#define SIMPLEPROFILE_CHAR4_LEN 200
|
||||
#define SIMPLEPROFILE_CHAR5_LEN 20
|
||||
|
||||
/*********************************************************************
|
||||
|
||||
Reference in New Issue
Block a user