pd.py 18.3 KB
Newer Older
1 2 3 4
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2012-2013 Uwe Hermann <uwe@hermann-uwe.de>
Andy Dneg's avatar
Andy Dneg committed
5
## Copyright (C) 2019 DreamSourceLab <support@dreamsourcelab.com>
6
## Copyright (C) 2020 Raptor Engineering, LLC <support@raptorengineering.com>
7 8 9 10 11 12 13 14 15 16 17 18
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## 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
Andy Dneg's avatar
Andy Dneg committed
19
## along with this program; if not, see <http://www.gnu.org/licenses/>.
20 21 22 23 24 25 26 27 28 29 30 31 32
##

import sigrokdecode as srd

# ...
fields = {
    # START field (indicates start or stop of a transaction)
    'START': {
        0b0000: 'Start of cycle for a target',
        0b0001: 'Reserved',
        0b0010: 'Grant for bus master 0',
        0b0011: 'Grant for bus master 1',
        0b0100: 'Reserved',
33
        0b0101: 'TPM',
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
        0b0110: 'Reserved',
        0b0111: 'Reserved',
        0b1000: 'Reserved',
        0b1001: 'Reserved',
        0b1010: 'Reserved',
        0b1011: 'Reserved',
        0b1100: 'Reserved',
        0b1101: 'Start of cycle for a Firmware Memory Read cycle',
        0b1110: 'Start of cycle for a Firmware Memory Write cycle',
        0b1111: 'Stop/abort (end of a cycle for a target)',
    },
    # Cycle type / direction field
    # Bit 0 (LAD[0]) is unused, should always be 0.
    # Neither host nor peripheral are allowed to drive 0b11x0.
    'CT_DR': {
        0b0000: 'I/O read',
DreamSourceLab's avatar
DreamSourceLab committed
50
        0b0001: 'I/O read',
51
        0b0010: 'I/O write',
DreamSourceLab's avatar
DreamSourceLab committed
52
        0b0011: 'I/O write',
53
        0b0100: 'Memory read',
DreamSourceLab's avatar
DreamSourceLab committed
54
        0b0101: 'Memory read',
55
        0b0110: 'Memory write',
DreamSourceLab's avatar
DreamSourceLab committed
56
        0b0111: 'Memory write',
57
        0b1000: 'DMA read',
DreamSourceLab's avatar
DreamSourceLab committed
58
        0b1001: 'DMA read',
59
        0b1010: 'DMA write',
DreamSourceLab's avatar
DreamSourceLab committed
60
        0b1011: 'DMA write',
61
        0b1100: 'Reserved / not allowed',
DreamSourceLab's avatar
DreamSourceLab committed
62
        0b1101: 'Reserved / not allowed',
63
        0b1110: 'Reserved / not allowed',
DreamSourceLab's avatar
DreamSourceLab committed
64
        0b1111: 'Reserved / not allowed',
65
    },
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
    # Cycle type / direction field
    # False for read cycle, True for write cycle
    'CT_DR_WR': {
        0b0000: False,
        0b0001: False,
        0b0010: True,
        0b0011: True,
        0b0100: False,
        0b0101: False,
        0b0110: True,
        0b0111: True,
        0b1000: False,
        0b1001: False,
        0b1010: True,
        0b1011: True,
        0b1100: False,
        0b1101: False,
        0b1110: False,
        0b1111: False,
    },
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
    # SIZE field (determines how many bytes are to be transferred)
    # Bits[3:2] are reserved, must be driven to 0b00.
    # Neither host nor peripheral are allowed to drive 0b0010.
    'SIZE': {
        0b0000: '8 bits (1 byte)',
        0b0001: '16 bits (2 bytes)',
        0b0010: 'Reserved / not allowed',
        0b0011: '32 bits (4 bytes)',
    },
    # CHANNEL field (bits[2:0] contain the DMA channel number)
    'CHANNEL': {
        0b0000: '0',
        0b0001: '1',
        0b0010: '2',
        0b0011: '3',
        0b0100: '4',
        0b0101: '5',
        0b0110: '6',
        0b0111: '7',
    },
    # SYNC field (used to add wait states)
    'SYNC': {
        0b0000: 'Ready',
        0b0001: 'Reserved',
        0b0010: 'Reserved',
        0b0011: 'Reserved',
        0b0100: 'Reserved',
        0b0101: 'Short wait',
        0b0110: 'Long wait',
        0b0111: 'Reserved',
        0b1000: 'Reserved',
        0b1001: 'Ready more (DMA only)',
        0b1010: 'Error',
        0b1011: 'Reserved',
        0b1100: 'Reserved',
        0b1101: 'Reserved',
        0b1110: 'Reserved',
        0b1111: 'Reserved',
    },
}

class Decoder(srd.Decoder):
Andy Dneg's avatar
Andy Dneg committed
128
    api_version = 3
129 130
    id = 'lpc'
    name = 'LPC'
Andy Dneg's avatar
Andy Dneg committed
131
    longname = 'Low Pin Count'
132 133 134
    desc = 'Protocol for low-bandwidth devices on PC mainboards.'
    license = 'gplv2+'
    inputs = ['logic']
Andy Dneg's avatar
Andy Dneg committed
135 136
    outputs = []
    tags = ['PC']
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
    channels = (
        {'id': 'lframe', 'name': 'LFRAME#', 'desc': 'Frame'},
        {'id': 'lclk',   'name': 'LCLK',    'desc': 'Clock'},
        {'id': 'lad0',   'name': 'LAD[0]',  'desc': 'Addr/control/data 0'},
        {'id': 'lad1',   'name': 'LAD[1]',  'desc': 'Addr/control/data 1'},
        {'id': 'lad2',   'name': 'LAD[2]',  'desc': 'Addr/control/data 2'},
        {'id': 'lad3',   'name': 'LAD[3]',  'desc': 'Addr/control/data 3'},
    )
    optional_channels = (
        {'id': 'lreset', 'name': 'LRESET#', 'desc': 'Reset'},
        {'id': 'ldrq',   'name': 'LDRQ#',   'desc': 'Encoded DMA / bus master request'},
        {'id': 'serirq', 'name': 'SERIRQ',  'desc': 'Serialized IRQ'},
        {'id': 'clkrun', 'name': 'CLKRUN#', 'desc': 'Clock run'},
        {'id': 'lpme',   'name': 'LPME#',   'desc': 'LPC power management event'},
        {'id': 'lpcpd',  'name': 'LPCPD#',  'desc': 'Power down'},
        {'id': 'lsmi',   'name': 'LSMI#',   'desc': 'System Management Interrupt'},
    )
    annotations = (
        ('warnings', 'Warnings'),
        ('start', 'Start'),
        ('cycle-type', 'Cycle-type/direction'),
        ('addr', 'Address'),
        ('tar1', 'Turn-around cycle 1'),
        ('sync', 'Sync'),
DreamSourceLab's avatar
DreamSourceLab committed
161
        ('timeout', 'Time Out'),
162 163 164 165
        ('data', 'Data'),
        ('tar2', 'Turn-around cycle 2'),
    )
    annotation_rows = (
DreamSourceLab's avatar
DreamSourceLab committed
166
        ('data', 'Data', (1, 2, 3, 4, 5, 6, 7, 8)),
167 168 169 170
        ('warnings', 'Warnings', (0,)),
    )

    def __init__(self):
Andy Dneg's avatar
Andy Dneg committed
171 172 173
        self.reset()

    def reset(self):
174 175 176 177 178
        self.state = 'IDLE'
        self.oldlclk = -1
        self.samplenum = 0
        self.lad = -1
        self.addr = 0
179
        self.direction = 0
180 181 182 183 184
        self.cur_nibble = 0
        self.cycle_type = -1
        self.databyte = 0
        self.tarcount = 0
        self.synccount = 0
185
        self.timeoutcount = 0
186 187 188 189 190 191 192 193 194
        self.oldpins = None
        self.ss_block = self.es_block = None

    def start(self):
        self.out_ann = self.register(srd.OUTPUT_ANN)

    def putb(self, data):
        self.put(self.ss_block, self.es_block, self.out_ann, data)

DreamSourceLab's avatar
DreamSourceLab committed
195
    def handle_get_start(self, lframe):
196 197 198 199 200 201 202
        # LAD[3:0]: START field (1 clock cycle).

        # The last value of LAD[3:0] before LFRAME# gets de-asserted is what
        # the peripherals must use. However, the host can keep LFRAME# asserted
        # multiple clocks, and we output all START fields that occur, even
        # though the peripherals are supposed to ignore all but the last one.
        self.es_block = self.samplenum
Andy Dneg's avatar
Andy Dneg committed
203
        self.putb([1, [fields['START'][self.oldlad], 'START', 'St', 'S']])
204 205 206 207 208 209 210 211
        self.ss_block = self.samplenum


        # LFRAME# is asserted (low). Wait until it gets de-asserted again
        # (the host is allowed to keep it asserted multiple clocks).
        if lframe != 1:
            return

212
        if (self.oldlad == 0b0000 or self.oldlad == 0b0101):
DreamSourceLab's avatar
DreamSourceLab committed
213 214
            self.start_field = self.oldlad
            self.state = 'GET CT/DR'
215 216 217 218 219 220 221
        elif (self.oldlad == 0b1101 or self.oldlad == 0b1110):
            self.start_field = self.oldlad
            if (self.oldlad == 0b1110):
                self.direction = True
            else:
                self.direction = False
            self.state = 'GET FW IDSEL'
DreamSourceLab's avatar
DreamSourceLab committed
222 223
        else:
            self.state = 'IDLE'
224

DreamSourceLab's avatar
DreamSourceLab committed
225
    def handle_get_ct_dr(self):
226 227
        # LAD[3:0]: Cycle type / direction field (1 clock cycle).

DreamSourceLab's avatar
DreamSourceLab committed
228
        self.cycle_type = fields['CT_DR'][self.oldlad]
229
        self.direction = fields['CT_DR_WR'][self.oldlad]
230 231 232

        # TODO: Warning/error on invalid cycle types.
        if self.cycle_type == 'Reserved':
DreamSourceLab's avatar
DreamSourceLab committed
233
            self.putb([0, ['Invalid cycle type (%s)' % self.oldlad_bits]])
234 235 236 237 238 239 240 241 242

        self.es_block = self.samplenum
        self.putb([2, ['Cycle type: %s' % self.cycle_type]])
        self.ss_block = self.samplenum

        self.state = 'GET ADDR'
        self.addr = 0
        self.cur_nibble = 0

243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294
    def handle_get_fw_idsel(self):
        # LAD[3:0]: IDSEL field (1 clock cycle).
        self.es_block = self.samplenum
        s = 'IDSEL: 0x%%0%dx' % self.oldlad
        self.putb([3, [s % self.oldlad]])
        self.ss_block = self.samplenum

        self.state = 'GET FW ADDR'
        self.addr = 0
        self.cur_nibble = 0

    def handle_get_fw_addr(self):
        # LAD[3:0]: ADDR field (7 clock cycles).
        addr_nibbles = 7 # Address is 28bits.

        # Addresses are driven MSN-first.
        offset = ((addr_nibbles - 1) - self.cur_nibble) * 4
        if (offset < 0):
            self.putb([0, ['Warning: Invalid address shift: %d' % offset]])
            self.state = 'IDLE'
            return
        self.addr |= (self.oldlad << offset)

        # Continue if we haven't seen all ADDR cycles, yet.
        if (self.cur_nibble < addr_nibbles - 1):
            self.cur_nibble += 1
            return

        self.es_block = self.samplenum
        s = 'Address: 0x%%0%dx' % addr_nibbles
        self.putb([3, [s % self.addr]])
        self.ss_block = self.samplenum

        self.state = 'GET FW MSIZE'

    def handle_get_fw_msize(self):
        # LAD[3:0]: MSIZE field (1 clock cycle).
        self.es_block = self.samplenum
        s = 'MSIZE: 0x%%0%dx' % self.oldlad
        self.putb([3, [s % self.oldlad]])
        self.ss_block = self.samplenum
        self.msize = self.oldlad

        if self.direction == 1:
            self.state = 'GET FW DATA'
            self.cycle_count = 0
            self.dataword = 0
            self.cur_nibble = 0
        else:
            self.state = 'GET TAR'
            self.tar_count = 0

DreamSourceLab's avatar
DreamSourceLab committed
295
    def handle_get_addr(self):
296 297 298 299 300 301 302 303 304 305 306 307 308
        # LAD[3:0]: ADDR field (4/8/0 clock cycles).

        # I/O cycles: 4 ADDR clocks. Memory cycles: 8 ADDR clocks.
        # DMA cycles: no ADDR clocks at all.
        if self.cycle_type in ('I/O read', 'I/O write'):
            addr_nibbles = 4 # Address is 16bits.
        elif self.cycle_type in ('Memory read', 'Memory write'):
            addr_nibbles = 8 # Address is 32bits.
        else:
            addr_nibbles = 0 # TODO: How to handle later on?

        # Addresses are driven MSN-first.
        offset = ((addr_nibbles - 1) - self.cur_nibble) * 4
309 310 311 312
        if (offset < 0):
            self.putb([0, ['Warning: Invalid address shift: %d' % offset]])
            self.state = 'IDLE'
            return
DreamSourceLab's avatar
DreamSourceLab committed
313
        self.addr |= (self.oldlad << offset)
314 315 316 317 318 319 320 321 322 323 324

        # Continue if we haven't seen all ADDR cycles, yet.
        if (self.cur_nibble < addr_nibbles - 1):
            self.cur_nibble += 1
            return

        self.es_block = self.samplenum
        s = 'Address: 0x%%0%dx' % addr_nibbles
        self.putb([3, [s % self.addr]])
        self.ss_block = self.samplenum

325 326 327 328 329 330
        if self.direction == 1:
            self.state = 'GET DATA'
            self.cycle_count = 0
        else:
            self.state = 'GET TAR'
            self.tar_count = 0
331

DreamSourceLab's avatar
DreamSourceLab committed
332
    def handle_get_tar(self):
333 334 335
        # LAD[3:0]: First TAR (turn-around) field (2 clock cycles).

        self.es_block = self.samplenum
DreamSourceLab's avatar
DreamSourceLab committed
336
        self.putb([4, ['TAR, cycle %d: %s' % (self.tarcount, self.oldlad_bits)]])
Andy Dneg's avatar
Andy Dneg committed
337
        self.ss_block = self.samplenum
338 339 340 341 342

        # On the first TAR clock cycle LAD[3:0] is driven to 1111 by
        # either the host or peripheral. On the second clock cycle,
        # the host or peripheral tri-states LAD[3:0], but its value
        # should still be 1111, due to pull-ups on the LAD lines.
DreamSourceLab's avatar
DreamSourceLab committed
343
        if self.oldlad_bits != '1111':
344
            self.putb([0, ['TAR, cycle %d: %s (expected 1111)' % \
DreamSourceLab's avatar
DreamSourceLab committed
345
                           (self.tarcount, self.oldlad_bits)]])
346 347 348 349 350 351 352 353

        if (self.tarcount != 1):
            self.tarcount += 1
            return

        self.tarcount = 0
        self.state = 'GET SYNC'

DreamSourceLab's avatar
DreamSourceLab committed
354
    def handle_get_sync(self, lframe):
355 356
        # LAD[3:0]: SYNC field (1-n clock cycles).

DreamSourceLab's avatar
DreamSourceLab committed
357 358
        self.sync_val = self.oldlad_bits
        self.cycle_type = fields['SYNC'][self.oldlad]
359

DreamSourceLab's avatar
DreamSourceLab committed
360
        self.es_block = self.samplenum
361 362 363 364 365
        # TODO: Warnings if reserved value are seen?
        if self.cycle_type == 'Reserved':
            self.putb([0, ['SYNC, cycle %d: %s (reserved value)' % \
                           (self.synccount, self.sync_val)]])

Andy Dneg's avatar
Andy Dneg committed
366
        self.es_block = self.samplenum
367 368 369 370
        self.putb([5, ['SYNC, cycle %d: %s' % (self.synccount, self.sync_val)]])
        self.ss_block = self.samplenum

        # TODO
371 372 373 374 375 376 377 378 379 380 381
        if (self.cycle_type != 'Short wait' and self.cycle_type != 'Long wait'):
            self.cycle_count = 0
            if (lframe == 0):
                self.state = 'GET TIMEOUT'
            elif (self.start_field == 0b1101 or self.start_field == 0b1110):
                self.state = 'GET FW DATA'
                self.cycle_count = 0
                self.dataword = 0
                self.cur_nibble = 0
            else:
                self.state = 'GET DATA'
DreamSourceLab's avatar
DreamSourceLab committed
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398

    def handle_get_timeout(self):
        # LFRAME#: tie low (4 clock cycles).

        if (self.oldlframe != 0):
            self.putb([0, ['TIMEOUT cycle, LFRAME# must be low for 4 LCLk cycles']])
            self.timeoutcount = 0
            self.state = 'IDLE'
            return

        self.es_block = self.samplenum
        self.putb([6, ['Timeout %d' % self.timeoutcount]])
        self.ss_block = self.samplenum

        if (self.timeoutcount != 3):
            self.timeoutcount += 1
            return
399

DreamSourceLab's avatar
DreamSourceLab committed
400 401
        self.timeoutcount = 0
        self.state = 'IDLE'
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445

    def handle_get_fw_data(self):
        # LAD[3:0]: DATA field
        if (self.msize == 0b0000):
            data_nibbles = 2 # Data is 8bits.
        elif (self.msize == 0b0001):
            data_nibbles = 4 # Data is 16bits.
        elif (self.msize == 0b0010):
            data_nibbles = 8 # Data is 32bits.
        elif (self.msize == 0b0100):
            data_nibbles = 32 # Data is 128bits.
        elif (self.msize == 0b0111):
            data_nibbles = 256 # Data is 1024bits.
        else:
            self.putb([0, ['Warning: Invalid MSIZE: %d' % self.msize]])
            self.state = 'IDLE'
            return

        # Data is driven LSN-first.
        nibble_swap = self.cur_nibble % 2
        offset = ((data_nibbles - 1) - self.cur_nibble) * 4
        if (nibble_swap):
            offset += 4
        else:
            offset -= 4
        if (offset < 0):
            self.putb([0, ['Warning: Invalid data shift: %d' % offset]])
            self.state = 'IDLE'
            return
        self.dataword |= (self.oldlad << offset)

        # Continue if we haven't seen all DATA cycles, yet.
        if (self.cur_nibble < data_nibbles - 1):
            self.cur_nibble += 1
            return

        self.es_block = self.samplenum
        s = 'DATA: 0x%%0%dx' % data_nibbles
        self.putb([3, [s % self.dataword]])
        self.ss_block = self.samplenum

        self.cycle_count = 0
        self.state = 'GET TAR2'

DreamSourceLab's avatar
DreamSourceLab committed
446
    def handle_get_data(self):
447 448 449 450
        # LAD[3:0]: DATA field (2 clock cycles).

        # Data is driven LSN-first.
        if (self.cycle_count == 0):
DreamSourceLab's avatar
DreamSourceLab committed
451
            self.databyte = self.oldlad
452
        elif (self.cycle_count == 1):
DreamSourceLab's avatar
DreamSourceLab committed
453
            self.databyte |= (self.oldlad << 4)
454
        else:
455 456 457
            self.putb([0, ['Warning: Invalid cycle_count: %d' % self.cycle_count]])
            self.state = 'IDLE'
            return
458 459 460 461 462 463

        if (self.cycle_count != 1):
            self.cycle_count += 1
            return

        self.es_block = self.samplenum
DreamSourceLab's avatar
DreamSourceLab committed
464
        self.putb([7, ['DATA: 0x%02x' % self.databyte]])
465 466 467 468 469
        self.ss_block = self.samplenum

        self.cycle_count = 0
        self.state = 'GET TAR2'

DreamSourceLab's avatar
DreamSourceLab committed
470
    def handle_get_tar2(self):
471 472 473
        # LAD[3:0]: Second TAR field (2 clock cycles).

        self.es_block = self.samplenum
DreamSourceLab's avatar
DreamSourceLab committed
474
        self.putb([8, ['TAR, cycle %d: %s' % (self.tarcount, self.oldlad_bits)]])
475 476 477 478 479 480
        self.ss_block = self.samplenum

        # On the first TAR clock cycle LAD[3:0] is driven to 1111 by
        # either the host or peripheral. On the second clock cycle,
        # the host or peripheral tri-states LAD[3:0], but its value
        # should still be 1111, due to pull-ups on the LAD lines.
DreamSourceLab's avatar
DreamSourceLab committed
481
        if self.oldlad_bits != '1111':
482
            self.putb([0, ['Warning: TAR, cycle %d: %s (expected 1111)'
DreamSourceLab's avatar
DreamSourceLab committed
483
                           % (self.tarcount, self.oldlad_bits)]])
484 485 486 487 488 489 490 491

        if (self.tarcount != 1):
            self.tarcount += 1
            return

        self.tarcount = 0
        self.state = 'IDLE'

Andy Dneg's avatar
Andy Dneg committed
492 493
    def decode(self):
        while True:
494 495 496

            # Only look at the signals upon rising LCLK edges. The LPC clock
            # is the same as the PCI clock (which is sampled at rising edges).
Andy Dneg's avatar
Andy Dneg committed
497
            (lframe, lclk, lad0, lad1, lad2, lad3, lreset, ldrq, serirq, clkrun, lpme, lpcpd, lsmi) = self.wait({1: 'r'})
498 499 500

            # Store LAD[3:0] bit values (one nibble) in local variables.
            # Most (but not all) states need this.
DreamSourceLab's avatar
DreamSourceLab committed
501
            lad = (lad3 << 3) | (lad2 << 2) | (lad1 << 1) | lad0
Andy Dneg's avatar
Andy Dneg committed
502
            lad_bits = '{:04b}'.format(lad)
DreamSourceLab's avatar
DreamSourceLab committed
503
            # self.putb([0, ['LAD: %s' % lad_bits]])
504 505 506 507 508 509

            # TODO: Only memory read/write is currently supported/tested.

            # State machine
            if self.state == 'IDLE':
                # A valid LPC cycle starts with LFRAME# being asserted (low).
Andy Dneg's avatar
Andy Dneg committed
510 511 512 513
                if lframe == 0:
                    self.ss_block = self.samplenum
                    self.state = 'GET START'
                    self.lad = -1
DreamSourceLab's avatar
DreamSourceLab committed
514
                else:
Andy Dneg's avatar
Andy Dneg committed
515
                    self.wait({0: 'f'})
516
            elif self.state == 'GET START':
DreamSourceLab's avatar
DreamSourceLab committed
517
                self.handle_get_start(lframe)
518
            elif self.state == 'GET CT/DR':
DreamSourceLab's avatar
DreamSourceLab committed
519
                self.handle_get_ct_dr()
520
            elif self.state == 'GET ADDR':
DreamSourceLab's avatar
DreamSourceLab committed
521
                self.handle_get_addr()
522 523 524 525 526 527
            elif self.state == 'GET FW IDSEL':
                self.handle_get_fw_idsel()
            elif self.state == 'GET FW ADDR':
                self.handle_get_fw_addr()
            elif self.state == 'GET FW MSIZE':
                self.handle_get_fw_msize()
528
            elif self.state == 'GET TAR':
DreamSourceLab's avatar
DreamSourceLab committed
529
                self.handle_get_tar()
530
            elif self.state == 'GET SYNC':
DreamSourceLab's avatar
DreamSourceLab committed
531 532 533
                self.handle_get_sync(lframe)
            elif self.state == 'GET TIMEOUT':
                self.handle_get_timeout()
534 535
            elif self.state == 'GET FW DATA':
                self.handle_get_fw_data()
536
            elif self.state == 'GET DATA':
DreamSourceLab's avatar
DreamSourceLab committed
537
                self.handle_get_data()
538
            elif self.state == 'GET TAR2':
DreamSourceLab's avatar
DreamSourceLab committed
539 540
                self.handle_get_tar2()

Andy Dneg's avatar
Andy Dneg committed
541
            self.oldlframe = lframe
DreamSourceLab's avatar
DreamSourceLab committed
542 543
            self.oldlad = lad
            self.oldlad_bits = lad_bits