Пример #1
0
]

STAT_REG = [
    {
        'name': 'AM',
        'stbit': 7,
        'nbits': 1
    },
    {
        'name': 'DR',
        'stbit': 5,
        'nbits': 1
    },
]

Ann = SrdIntEnum.from_str('Ann', 'CMD REG_WR REG_RD TX RX RESP WARN')


class Decoder(srd.Decoder):
    api_version = 3
    id = 'nrf905'
    name = 'nRF905'
    longname = 'Nordic Semiconductor nRF905'
    desc = '433/868/933MHz transceiver chip.'
    license = 'mit'
    inputs = ['spi']
    outputs = []
    tags = ['IC', 'Wireless/RF']
    annotations = (
        ('cmd', 'Command sent to the device'),
        ('reg-write', 'Config register written to the device'),
Пример #2
0
## along with this program; if not, see <http://www.gnu.org/licenses/>.
##

# TODO:
#    - EDID < 1.3
#    - add short annotations
#    - Signal level standard field in basic display parameters block
#    - Additional color point descriptors
#    - Additional standard timing descriptors
#    - Extensions

import sigrokdecode as srd
from common.srdhelper import SrdIntEnum
import os

St = SrdIntEnum.from_str('St', 'OFFSET EXTENSIONS HEADER EDID')

EDID_HEADER = [0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00]
OFF_VENDOR = 8
OFF_VERSION = 18
OFF_BASIC = 20
OFF_CHROM = 25
OFF_EST_TIMING = 35
OFF_STD_TIMING = 38
OFF_DET_TIMING = 54
OFF_NUM_EXT = 126
OFF_CHECKSUM = 127

# Pre-EDID established timing modes
est_modes = [
    '720x400@70Hz',
Пример #3
0
    0b11: '8kHz',
}

DS3231_I2C_ADDRESS = 0x68


def regs_and_bits():
    l = [('reg_' + r.lower(), r + ' register') for r in regs]
    l += [('bit_' + re.sub(r'\/| ', '_', b).lower(), b + ' bit') for b in bits]
    return tuple(l)


a = ['REG_' + r.upper() for r in regs] + \
    ['BIT_' + re.sub('\/| ', '_', b).upper() for b in bits] + \
    ['READ_DATE_TIME', 'WRITE_DATE_TIME', 'READ_REG', 'WRITE_REG', 'WARNING']
Ann = SrdIntEnum.from_list('Ann', a)


class DateTime(object):
    days_of_week = (
        'Sunday',
        'Monday',
        'Tuesday',
        'Wednesday',
        'Thursday',
        'Friday',
        'Saturday',
    )

    def __init__(self):
        self.hours = -1
Пример #4
0
token_fields = 'START TRANSMISSION CMD ARG CRC END'.split()
reg_card_status = 'OUT_OF_RANGE ADDRESS_ERROR BLOCK_LEN_ERROR ERASE_SEQ_ERROR \
    ERASE_PARAM WP_VIOLATION CARD_IS_LOCKED LOCK_UNLOCK_FAILED COM_CRC_ERROR \
    ILLEGAL_COMMAND CARD_ECC_FAILED CC_ERROR ERROR RSVD_DEFERRED_RESPONSE \
    CSD_OVERWRITE WP_ERASE_SKIP CARD_ECC_DISABLED ERASE_RESET CURRENT_STATE \
    READY_FOR_DATA RSVD FX_EVENT APP_CMD RSVD_SDIO AKE_SEQ_ERROR RSVD_APP_CMD \
    RSVD_TESTMODE'.split()
reg_cid = 'MID OID PNM PRV PSN RSVD MDT CRC ONE'.split()
reg_csd = 'CSD_STRUCTURE RSVD TAAC NSAC TRAN_SPEED CCC READ_BL_LEN \
    READ_BL_PARTIAL WRITE_BLK_MISALIGN READ_BLK_MISALIGN DSR_IMP C_SIZE \
    VDD_R_CURR_MIN VDD_R_CURR_MAX VDD_W_CURR_MIN VDD_W_CURR_MAX C_SIZE_MULT \
    ERASE_BLK_EN SECTOR_SIZE WP_GRP_SIZE WP_GRP_ENABLE R2W_FACTOR \
    WRITE_BL_LEN WRITE_BL_PARTIAL FILE_FORMAT_GRP COPY PERM_WRITE_PROTECT \
    TMP_WRITE_PROTECT FILE_FORMAT CRC ONE'.split()

Pin = SrdIntEnum.from_str('Pin', 'CMD CLK DAT0 DAT1 DAT2 DAT3')

a = ['CMD%d' % i for i in range(64)] + ['ACMD%d' % i for i in range(64)] + \
    ['RESPONSE_R' + r.upper() for r in responses] + \
    ['R_STATUS_' + r for r in reg_card_status] + \
    ['R_CID_' + r for r in reg_cid] + \
    ['R_CSD_' + r for r in reg_csd] + \
    ['BIT_' + r for r in ('0', '1')] + \
    ['F_' + f for f in token_fields] + \
    ['DECODED_BIT', 'DECODED_F']
Ann = SrdIntEnum.from_list('Ann', a)

s = ['GET_COMMAND_TOKEN', 'HANDLE_CMD999'] + \
    ['HANDLE_CMD%d' % i for i in range(64)] + \
    ['HANDLE_ACMD%d' % i for i in range(64)] + \
    ['GET_RESPONSE_R%s' % r.upper() for r in responses]
Пример #5
0
    def set_value(self, value):
        self.value = value

    def get_bit_annotation(self):
        if self.type == BitType.OTHER:
            annotation = self.values[self.value].copy()
        else:
            annotation = self.type[self.value].copy()

        for index in range(len(annotation)):
            if '%s' in annotation[index]:
                annotation[index] = str(annotation[index] % self.name)
        return annotation


Ann = SrdIntEnum.from_str('Ann', 'READ WRITE MB REG_ADDRESS REG_DATA WARNING')

St = SrdIntEnum.from_str('St', 'IDLE ADDRESS_BYTE DATA')


class Decoder(srd.Decoder):
    api_version = 3
    id = 'adxl345'
    name = 'ADXL345'
    longname = 'Analog Devices ADXL345'
    desc = 'Analog Devices ADXL345 3-axis accelerometer.'
    license = 'gplv2+'
    inputs = ['spi']
    outputs = []
    tags = ['IC', 'Sensor']
    annotations = (
Пример #6
0
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, see <http://www.gnu.org/licenses/>.
##

import sigrokdecode as srd
from common.srdhelper import SrdIntEnum

Pin = SrdIntEnum.from_str('Pin', 'CLK DATA LOAD LDAC')

dacs = {
    0: 'DACA',
    1: 'DACB',
    2: 'DACC',
    3: 'DACD',
}

class Decoder(srd.Decoder):
    api_version = 3
    id = 'tlc5620'
    name = 'TI TLC5620'
    longname = 'Texas Instruments TLC5620'
    desc = 'Texas Instruments TLC5620 8-bit quad DAC.'
    license = 'gplv2+'
Пример #7
0
## v0.2 - 28 April 2020 B.VERNOUX 
### Use ST25R3916 Datasheet DS12484 Rev 2 (December 2019)
## v0.3 - 17 June 2020 B.VERNOUX 
### Use ST25R3916 Datasheet DS12484 Rev 3 (04 June 2020)
## v0.4 - 10 Aug 2021 B.VERNOUX 
### Fix FIFOR/FIFOW issues with Pulseview (with "Tabular Output View") 
### because of FIFO Read/FIFO Write commands, was not returning the 
### annotations short name FIFOR/FIFOW

import sigrokdecode as srd
from collections import namedtuple
from common.srdhelper import SrdIntEnum
from .lists import *

Ann = SrdIntEnum.from_str('Ann', 'BURST_READ BURST_WRITE \
    BURST_READB BURST_WRITEB BURST_READT BURST_WRITET \
    DIRECTCMD FIFO_WRITE FIFO_READ STATUS WARN')

Pos = namedtuple('Pos', ['ss', 'es'])
Data = namedtuple('Data', ['mosi', 'miso'])

class Decoder(srd.Decoder):
    api_version = 3
    id = 'st25r39xx_spi'
    name = 'ST25R39xx (SPI mode)'
    longname = 'STMicroelectronics ST25R39xx'
    desc = 'High performance NFC universal device and EMVCo reader protocol.'
    license = 'gplv2+'
    inputs = ['spi']
    outputs = []
    tags = ['IC', 'Wireless/RF']
Пример #8
0
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, see <http://www.gnu.org/licenses/>.
##

import sigrokdecode as srd
from common.srdhelper import SrdIntEnum

Pin = SrdIntEnum.from_str('Pin', 'SDCKA SDCKB')

ann = [
    ['Size', 'L'],
    ['SrcAP', 'S'],
    ['DstAP', 'D'],
    ['Cmd', 'C'],
    ['Data'],
    ['Cksum', 'K'],
]


class Decoder(srd.Decoder):
    api_version = 3
    id = 'maple_bus'
    name = 'Maple bus'
Пример #9
0
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, see <http://www.gnu.org/licenses/>.
##

import sigrokdecode as srd
from common.srdhelper import SrdIntEnum

Ann = SrdIntEnum.from_str('Ann', 'ROMDATA')
Bin = SrdIntEnum.from_str('Bin', 'ROMDATA')

class ChannelError(Exception):
    pass

class Decoder(srd.Decoder):
    api_version = 3
    id = 'mcs48'
    name = 'MCS-48'
    longname = 'Intel MCS-48'
    desc = 'Intel MCS-48 external memory access protocol.'
    license = 'gplv2+'
    inputs = ['logic']
    outputs = []
    tags = ['Retro computing']
Пример #10
0
# This implementation is incomplete. TODO items:
# - Support the optional RESET# pin, detect cold and warm reset.
# - Split slot values into audio samples of their respective width and
#   frequency (either on user provided parameters, or from inspection of
#   decoded register access).

import sigrokdecode as srd
from common.srdhelper import SrdIntEnum


class ChannelError(Exception):
    pass


Pin = SrdIntEnum.from_str('Pin', 'SYNC BIT_CLK SDATA_OUT SDATA_IN RESET')

slots = 'TAG ADDR DATA 03 04 05 06 07 08 09 10 11 IO'.split()
a = 'BITS_OUT BITS_IN SLOT_RAW_OUT SLOT_RAW_IN WARN ERROR'.split() + \
    ['SLOT_OUT_' + s for s in slots] + ['SLOT_IN_' + s for s in slots]
Ann = SrdIntEnum.from_list('Ann', a)

Bin = SrdIntEnum.from_str('Bin', 'FRAME_OUT FRAME_IN SLOT_RAW_OUT SLOT_RAW_IN')


class Decoder(srd.Decoder):
    api_version = 3
    id = 'ac97'
    name = "AC '97"
    longname = "Audio Codec '97"
    desc = 'Audio and modem control for PC systems.'
Пример #11
0
bitrates = {
    'low-speed': 1500000,  # 1.5Mb/s (+/- 1.5%)
    'low-speed-rp': 1500000,  # 1.5Mb/s (+/- 1.5%)
    'full-speed': 12000000,  # 12Mb/s (+/- 0.25%)
    'automatic': None
}

sym_annotation = {
    'J': [0, ['J']],
    'K': [1, ['K']],
    'SE0': [2, ['SE0', '0']],
    'SE1': [3, ['SE1', '1']],
}

St = SrdIntEnum.from_str('St', 'IDLE GET_BIT GET_EOP WAIT_IDLE')


class SamplerateError(Exception):
    pass


class Decoder(srd.Decoder):
    api_version = 3
    id = 'usb_signalling'
    name = 'USB signalling'
    longname = 'Universal Serial Bus (LS/FS) signalling'
    desc = 'USB (low-speed/full-speed) signalling protocol.'
    license = 'gplv2+'
    inputs = ['logic']
    outputs = ['usb_signalling']
Пример #12
0
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, see <http://www.gnu.org/licenses/>.
##

import sigrokdecode as srd
from collections import namedtuple
from common.srdhelper import SrdIntEnum
from .lists import *

Ann = SrdIntEnum.from_str(
    'Ann', 'STROBE SINGLE_READ SINGLE_WRITE BURST_READ \
    BURST_WRITE STATUS_READ STATUS WARN')

Pos = namedtuple('Pos', ['ss', 'es'])
Data = namedtuple('Data', ['mosi', 'miso'])


class Decoder(srd.Decoder):
    api_version = 3
    id = 'cc1101'
    name = 'CC1101'
    longname = 'Texas Instruments CC1101'
    desc = 'Low-power sub-1GHz RF transceiver chip.'
    license = 'gplv2+'
    inputs = ['spi']
    outputs = []
Пример #13
0
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, see <http://www.gnu.org/licenses/>.
##

import sigrokdecode as srd
from math import ceil
from common.srdhelper import SrdIntEnum
from .lists import *

L = len(cmds)
RX = 0
TX = 1

Ann = SrdIntEnum.from_list('Ann',
                           [c[0]
                            for c in cmds.values()] + ['BIT', 'FIELD', 'WARN'])


def cmd_annotation_classes():
    return tuple([tuple([cmd[0].lower(), cmd[1]]) for cmd in cmds.values()])


class Decoder(srd.Decoder):
    api_version = 3
    id = 'amulet_ascii'
    name = 'Amulet ASCII'
    longname = 'Amulet LCD ASCII'
    desc = 'Amulet Technologies LCD controller ASCII protocol.'
    license = 'gplv3+'
    inputs = ['uart']
Пример #14
0
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, see <http://www.gnu.org/licenses/>.
##

import re
import sigrokdecode as srd
from common.srdhelper import SrdIntEnum

Pin = SrdIntEnum.from_str('Pin', 'CLK DATA CE')

ann_cmdbit, ann_databit, ann_cmd, ann_data, ann_warning = range(5)


class Decoder(srd.Decoder):
    api_version = 3
    id = 'sda2506'
    name = 'SDA2506'
    longname = 'Siemens SDA 2506-5'
    desc = 'Serial nonvolatile 1-Kbit EEPROM.'
    license = 'gplv2+'
    inputs = ['logic']
    outputs = []
    tags = ['IC', 'Memory']
    channels = (