## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
# TODO: Look into arbitration, collision detection, clock synchronisation, etc.
# TODO: Implement support for 10bit slave addresses.
# TODO: Implement support for inverting SDA/SCL levels (0->1 and 1->0).
# TODO: Look into arbitration, collision detection, clock synchronisation, etc.
# TODO: Implement support for 10bit slave addresses.
# TODO: Implement support for inverting SDA/SCL levels (0->1 and 1->0).
longname = 'Inter-Integrated Circuit'
desc = 'Two-wire, multi-master, serial bus.'
license = 'gplv2+'
longname = 'Inter-Integrated Circuit'
desc = 'Two-wire, multi-master, serial bus.'
license = 'gplv2+'
- ['Start', 'Start condition'],
- ['Repeat start', 'Repeat start condition'],
- ['Stop', 'Stop condition'],
- ['ACK', 'ACK'],
- ['NACK', 'NACK'],
- ['Address read', 'Address read'],
- ['Address write', 'Address write'],
- ['Data read', 'Data read'],
- ['Data write', 'Data write'],
- ['Warnings', 'Human-readable warnings'],
+ ['start', 'Start condition'],
+ ['repeat-start', 'Repeat start condition'],
+ ['stop', 'Stop condition'],
+ ['ack', 'ACK'],
+ ['nack', 'NACK'],
+ ['address-read', 'Address read'],
+ ['address-write', 'Address write'],
+ ['data-read', 'Data read'],
+ ['data-write', 'Data write'],
+ ['warnings', 'Human-readable warnings'],
+ binary = (
+ ('address-read', 'Address read'),
+ ('address-write', 'Address write'),
+ ('data-read', 'Data read'),
+ ('data-write', 'Data write'),
+ )
self.out_bitrate = self.register(srd.OUTPUT_META,
meta=(int, 'Bitrate', 'Bitrate from Start bit to Stop bit'))
self.out_bitrate = self.register(srd.OUTPUT_META,
meta=(int, 'Bitrate', 'Bitrate from Start bit to Stop bit'))
def putx(self, data):
self.put(self.startsample, self.samplenum, self.out_ann, data)
def putp(self, data):
def putx(self, data):
self.put(self.startsample, self.samplenum, self.out_ann, data)
def putp(self, data):
- self.put(self.startsample, self.samplenum, self.out_proto, data)
+ self.put(self.startsample, self.samplenum, self.out_python, data)
+
+ def putb(self, data):
+ self.put(self.startsample, self.samplenum, self.out_binary, data)
def is_start_condition(self, scl, sda):
# START condition (S): SDA = falling, SCL = high
def is_start_condition(self, scl, sda):
# START condition (S): SDA = falling, SCL = high
self.putp([cmd, d])
self.putx([proto[cmd][0], ['%s: %02X' % (proto[cmd][1], d),
'%s: %02X' % (proto[cmd][2], d), '%02X' % d]])
self.putp([cmd, d])
self.putx([proto[cmd][0], ['%s: %02X' % (proto[cmd][1], d),
'%s: %02X' % (proto[cmd][2], d), '%02X' % d]])