]> sigrok.org Git - libsigrokdecode.git/blame - decoders/numbers_and_state/__init__.py
parallel: rephrase word accumulation after reset introduction
[libsigrokdecode.git] / decoders / numbers_and_state / __init__.py
CommitLineData
b094fdfc
GS
1##
2## This file is part of the libsigrokdecode project.
3##
4## Copyright (C) 2019 Comlab AG
5## Copyright (C) 2020 Gerhard Sittig <gerhard.sittig@gmx.net>
6##
7## This program is free software; you can redistribute it and/or modify
8## it under the terms of the GNU General Public License as published by
9## the Free Software Foundation; either version 2 of the License, or
10## (at your option) any later version.
11##
12## This program is distributed in the hope that it will be useful,
13## but WITHOUT ANY WARRANTY; without even the implied warranty of
14## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15## GNU General Public License for more details.
16##
17## You should have received a copy of the GNU General Public License
18## along with this program; if not, see <http://www.gnu.org/licenses/>.
19##
20
21'''
22This protocol decoder takes a set of logic input signals, and interprets
23their bit pattern according to user specifications as different kinds of
24numbers, or an enumeration of e.g. machine states.
25
26Supported formats are: signed and unsigned integers, fixed point numbers,
27IEEE754 floating point numbers, and number to text mapping controlled by
28external data files. (Support for half precision floats depends on the
29Python runtime, and may not universally be available.)
30
31User provided text mapping files can either use the JSON format:
32 {"one": 1, "two": 2, "four": 4}
33or the Python programming language:
34 enumtext = { 1: "one", 2: "two", 3: "three", }
35
36In addition to all enum values on one row (sequential presentation of
37the data), a limited number of enum values also are shown in tabular
38presentation, which can help visualize state machines or task switches.
39'''
40
41from .pd import Decoder