## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2012 Uwe Hermann ## ## 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 ## along with this program; if not, write to the Free Software ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## ''' I2C protocol decoder. The Inter-Integrated Circuit (I2C) bus is a bidirectional, multi-master bus using two signals (SCL = serial clock line, SDA = serial data line). Protocol output format: I2C packet: [, ] is one of: - 'START' (START condition) - 'START REPEAT' (Repeated START condition) - 'ADDRESS READ' (Slave address, read) - 'ADDRESS WRITE' (Slave address, write) - 'DATA READ' (Data, read) - 'DATA WRITE' (Data, write) - 'STOP' (STOP condition) - 'ACK' (ACK bit) - 'NACK' (NACK bit) is the data or address byte associated with the 'ADDRESS*' and 'DATA*' command. Slave addresses do not include bit 0 (the READ/WRITE indication bit). For example, a slave address field could be 0x51 (instead of 0xa2). For 'START', 'START REPEAT', 'STOP', 'ACK', and 'NACK' is None. ''' from .pd import *