X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoders%2Fi2c%2Fpd.py;h=0e7f769e16f16eda276de9809f01fe43106b3983;hp=e226c24a41905ea55728b75bdc7d6278cc4be3d5;hb=97b874bd0b6913ed52df1b8aac5e7491479fac9a;hpb=592f355b7fcf1cfb9e38d5d52373b6559ac26ecc diff --git a/decoders/i2c/pd.py b/decoders/i2c/pd.py index e226c24..0e7f769 100644 --- a/decoders/i2c/pd.py +++ b/decoders/i2c/pd.py @@ -14,8 +14,7 @@ ## 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 +## along with this program; if not, see . ## # TODO: Look into arbitration, collision detection, clock synchronisation, etc. @@ -131,10 +130,6 @@ class Decoder(srd.Decoder): self.out_bitrate = self.register(srd.OUTPUT_META, meta=(int, 'Bitrate', 'Bitrate from Start bit to Stop bit')) - # Assume that the initial SCL/SDA pin state is high (logic 1). - # This is a good default, since both pins have pullups as per spec. - self.initial_pins = [1, 1] - def putx(self, data): self.put(self.ss, self.es, self.out_ann, data) @@ -273,8 +268,7 @@ class Decoder(srd.Decoder): # a) Data sampling of receiver: SCL = rising, and/or # b) START condition (S): SCL = high, SDA = falling, and/or # c) STOP condition (P): SCL = high, SDA = rising - conds = [{0: 'r'}, {0: 'h', 1: 'f'}, {0: 'h', 1: 'r'}] - pins = self.wait(conds[:]) # TODO + pins = self.wait([{0: 'r'}, {0: 'h', 1: 'f'}, {0: 'h', 1: 'r'}]) # Check which of the condition(s) matched and handle them. if self.matched[0]: