import sigrokdecode as srd
-class MissingDataError(Exception):
+class ChannelError(Exception):
pass
regs = {
pos = (ss, es)
if miso is None or mosi is None:
- raise MissingDataError('Both MISO and MOSI pins required.')
+ raise ChannelError('Both MISO and MOSI pins required.')
if self.first:
self.first = False
protocol-decoder nrf24l01
stack spi nrf24l01
input spi/nrf24l01/nrf24l01-test-no-command.sr
- output nrf24l01 exception match MissingDataError
+ output nrf24l01 exception match ChannelError
test no-miso
protocol-decoder spi channel cs=0 channel clk=1 channel mosi=2
protocol-decoder nrf24l01
stack spi nrf24l01
input spi/nrf24l01/nrf24l01-test-no-command.sr
- output nrf24l01 exception match MissingDataError
+ output nrf24l01 exception match ChannelError
test unknown-command
protocol-decoder spi channel cs=0 channel clk=1 channel mosi=2 channel miso=3
class SamplerateError(Exception):
pass
-class MissingDataError(Exception):
+class ChannelError(Exception):
pass
class Decoder(srd.Decoder):
# Either MISO or MOSI (but not both) can be omitted.
if not (self.have_miso or self.have_mosi):
- raise MissingDataError('Either MISO or MOSI (or both) pins required.')
+ raise ChannelError('Either MISO or MOSI (or both) pins required.')
self.find_clk_edge(miso, mosi, clk, cs)
input misc/no-samplerate.sr
output spi exception match SamplerateError
-test exception_missing_datapins
+test exception_channel
protocol-decoder spi channel cs=1 channel clk=0
input spi/spi-count-msb.sr
- output spi exception match MissingDataError
+ output spi exception match ChannelError
class SamplerateError(Exception):
pass
+class ChannelError(Exception):
+ pass
+
class Decoder(srd.Decoder):
api_version = 2
id = 'uart'
# Either RX or TX (but not both) can be omitted.
has_pin = [rx in (0, 1), tx in (0, 1)]
if has_pin == [False, False]:
- raise Exception('Either TX or RX (or both) pins required.')
+ raise ChannelError('Either TX or RX (or both) pins required.')
# State machine.
for rxtx in (RX, TX):