Skip to content

Commit

Permalink
Merge pull request #2 from dialog-semiconductor/Add_readme
Browse files Browse the repository at this point in the history
Add readme
  • Loading branch information
NiekIlmer authored Jul 14, 2021
2 parents 8a0408c + 6fd0fc4 commit ddef64d
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 28 deletions.
18 changes: 2 additions & 16 deletions HighLevelAnalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@

# 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 = {
"gtl": {
"format": "Message ID: {{data.MSG_ID}}({{data.MSG_ID_decoded}}), Dest ID: {{data.DST_ID}}, Source ID: {{data.SRC_ID}}, Parameter length: {{data.PAR_LEN}}, Data: {{data.data}}"
Expand All @@ -42,11 +36,6 @@ def __init__(self):
print("Dialog Semiconductor GTL interface decoder")

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.
"""
return_packet = False
try:
if (
Expand Down Expand Up @@ -136,9 +125,7 @@ def decode(self, frame: AnalyzerFrame):
sup_to = str(
(self.receiveBuffer[16] << 8 | self.receiveBuffer[15]) * 10
) # Extract the supervision timeout from the message
addr_type = self.receiveBuffer[
18
] # Extract the address type from the message
addr_type = self.receiveBuffer[18] # Extract the address type from the message
if addr_type == 0:
addr_type = "public"
else:
Expand Down Expand Up @@ -167,8 +154,7 @@ def decode(self, frame: AnalyzerFrame):
(self.receiveBuffer[10] << 8 | self.receiveBuffer[9]) * 1.25
) # Extract the min connection interval from the message
con_interval_max = str(
(self.receiveBuffer[12] << 8 | self.receiveBuffer[11])
* 1.25
(self.receiveBuffer[12] << 8 | self.receiveBuffer[11]) * 1.25
) # Extract the max connection interval from the message
con_latency = str(
self.receiveBuffer[14] << 8 | self.receiveBuffer[13]
Expand Down
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@

# GTL decode
# GTL interface decoder

## Getting started

1. Build your extension by updating the Python files for your needs
2. Create a public Github repo and push your code
3. Update this README
4. Open the Logic app and publish your extension
5. Create a Github release
6. Debug your hardware like you've never done before :)
![Screenshot of the decoder working](assets/screenshot.png)

## Installation

Open the extensions tab in Saleae logic 2, 'GTL interface decoder' should be in the list. If it isn't you can click the three dots and check for updates.

You can also clone this repo, click the three dots under extentions, click 'Load existing extention' and select the json file from this repo in the window that pops up.

## Usage

This analyzer can be added like any other analyzer, it only has one input. That should be set to the UART that communicates the GTL commands. As GTL usually has bidirectional communication another analyzer can be added for the second UART line.


Binary file added assets/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions extension.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "GTL decode",
"name": "GTL interface decoder",
"apiVersion": "1.0.0",
"author": "Dialog Semiconductor",
"version": "0.0.1",
"description": "",
"version": "1.0.0",
"description": "Dialog GTL interface decoder",
"extensions": {
"GTL decode": {
"type": "HighLevelAnalyzer",
Expand Down

0 comments on commit ddef64d

Please sign in to comment.