diff --git a/HighLevelAnalyzer.py b/HighLevelAnalyzer.py new file mode 100644 index 0000000..ff4eb3a --- /dev/null +++ b/HighLevelAnalyzer.py @@ -0,0 +1,73 @@ +# 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, StringSetting, NumberSetting, ChoicesSetting + + +# High level analyzers must subclass the HighLevelAnalyzer class. +class Hla(HighLevelAnalyzer): + + # 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': '{{data.result}}' + } + } + + def __init__(self): + ''' + Initialize HLA. + + Settings can be accessed using the same name used above. + ''' + #A byte we will be building up bit by bit. + self.byte_buildup = [] + self.buildup_start_time = None + 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. + ''' + this_frame_size = int(float(frame.end_time - frame.start_time) * 10e3) + frame_label = "" + if 133 150: + self.byte_buildup = [] + self.buildup_start_time = None + return + elif 111