id = 'qi'
name = 'Qi'
longname = 'Qi charger protocol'
- desc = 'Protocol used by Qi receiver'
+ desc = 'Protocol used by Qi receiver.'
license = 'gplv2+'
inputs = ['logic']
- outputs = ['qi']
+ outputs = []
+ tags = ['Embedded/industrial', 'Wireless/RF']
channels = (
{'id': 'qi', 'name': 'Qi', 'desc': 'Demodulated Qi data line'},
)
annotations = (
- ('bits', 'Bits'),
- ('bytes-errors', 'Bit errors'),
- ('bytes-start', 'Start bits'),
- ('bytes-info', 'Info bits'),
- ('bytes-data', 'Data bytes'),
- ('packets-data', 'Packet data'),
- ('packets-checksum-ok', 'Packet checksum'),
- ('packets-checksum-err', 'Packet checksum'),
+ ('bit', 'Bit'),
+ ('byte-error', 'Bit error'),
+ ('byte-start', 'Start bit'),
+ ('byte-info', 'Info bit'),
+ ('byte-data', 'Data byte'),
+ ('packet-data', 'Packet data'),
+ ('packet-checksum-ok', 'Packet checksum OK'),
+ ('packet-checksum-err', 'Packet checksum error'),
)
annotation_rows = (
('bits', 'Bits', (0,)),
)
def __init__(self):
+ self.reset()
+
+ def reset(self):
self.samplerate = None
self.reset_variables()
'C: PC = %d MP = %d P = %d C = %d WS = %d WO = %d' %
(powerclass, maxpower, prop, count, winsize, winoff),
'Configuration', 'C'])
- elif self.packet[0] == 0x71: # Identification
+ elif self.packet[0] == 0x71: # Identification
version = '%d.%d' % ((self.packet[1] & 0xf0) >> 4, self.packet[1] & 0x0f)
mancode = '%02x%02x' % (self.packet[2], self.packet[3])
devid = '%02x%02x%02x%02x' % (self.packet[4] & ~0x80,
if not self.samplerate:
raise SamplerateError('Cannot decode without samplerate.')
- (qi,) = self.wait({'skip': 1})
+ (qi,) = self.wait()
self.handle_transition(self.samplenum, qi == 0)
while True:
prev = self.samplenum