This commit is contained in:
2025-12-22 21:50:18 +01:00
commit 4ecc550b06
3 changed files with 84 additions and 0 deletions

64
HighLevelAnalyzer.py Normal file
View File

@@ -0,0 +1,64 @@
# High Level Analyzer
# For more information and documentation, please go to https://support.saleae.com/extensions/high-level-analyzer-extensions
from saleae.analyzers import HighLevelAnalyzer, AnalyzerFrame, NumberSetting, StringSetting, ChoicesSetting
# High level analyzers must subclass the HighLevelAnalyzer class.
class Hla(HighLevelAnalyzer):
# List of settings that a user can set for this High Level Analyzer.
my_string_setting = StringSetting()
# my_number_setting = NumberSetting(min_value=0, max_value=100)
my_choices_setting = ChoicesSetting(choices=('A', 'B'))
# An optional list of types this analyzer produces, providing a way to customize the way frames are displayed in Logic 2.
result_types = {
'mytype': {
'format': 'Output type: {{type}}, Input type: {{data.input_type}}'
}
}
def __init__(self):
'''
Initialize HLA.
Settings can be accessed using the same name used above.
'''
print("Settings:", self.my_string_setting, self.my_choices_setting)
# self.my_number_setting, self.my_choices_setting)
def decode(self, frame: AnalyzerFrame):
'''
Process a frame from the input analyzer, and optionally return a single `AnalyzerFrame` or a list of `AnalyzerFrame`s.
The type and data values in `frame` will depend on the input analyzer.
'''
if frame.data['data'] >> 24 == 58:
command = "write command"
else:
command = "unknown"
# data = frame.data['data'] >> 24
blue = frame.data['data'] >> 16 & 0xFF
red = frame.data['data'] >> 8 & 0xFF
green = frame.data['data'] & 0xFF
# = frame.data['ledData']
# bytes[1] = frame.data['ledData'] >> 16 & 0xFF
# bytes[2] = frame.data['ledData'] >> 8 & 0xFF
# bytes[3] = frame.data['ledData'] & 0xFF
# print(frame)
# print("Hallo Welt")
# print(frame)
# print(frame)
# print(frame)
# print(frame.data[''])
# Return the data frame itself
return AnalyzerFrame('LED', frame.start_time, frame.end_time, {
'input_type': frame.type,
'command': command,
"blue": blue,
"red": red,
"green": green,
})

7
README.md Normal file
View File

@@ -0,0 +1,7 @@
# TLE59731HLA
High Level Analyzer for TLE59731

13
extension.json Normal file
View File

@@ -0,0 +1,13 @@
{
"name": "TLE59731HLA",
"apiVersion": "1.0.0",
"author": "Johannes Paehr",
"version": "0.0.1",
"description": "",
"extensions": {
"TLE59731HLA": {
"type": "HighLevelAnalyzer",
"entryPoint": "HighLevelAnalyzer.Hla"
}
}
}