@@ -204,18 +204,18 @@ def digital_read(self, pin):
204
204
return self .digital_read_bulk_b ((1 << (pin - 32 ))) != 0
205
205
return self .digital_read_bulk ((1 << pin )) != 0
206
206
207
- def digital_read_bulk (self , pins ):
207
+ def digital_read_bulk (self , pins , delay = 0.008 ):
208
208
"""Get the values of all the pins on the 'A' port as a bitmask"""
209
209
buf = bytearray (4 )
210
- self .read (_GPIO_BASE , _GPIO_BULK , buf )
210
+ self .read (_GPIO_BASE , _GPIO_BULK , buf , delay = delay )
211
211
buf [0 ] = buf [0 ] & 0x3F
212
212
ret = struct .unpack (">I" , buf )[0 ]
213
213
return ret & pins
214
214
215
- def digital_read_bulk_b (self , pins ):
215
+ def digital_read_bulk_b (self , pins , delay = 0.008 ):
216
216
"""Get the values of all the pins on the 'B' port as a bitmask"""
217
217
buf = bytearray (8 )
218
- self .read (_GPIO_BASE , _GPIO_BULK , buf )
218
+ self .read (_GPIO_BASE , _GPIO_BULK , buf , delay = delay )
219
219
ret = struct .unpack (">I" , buf [4 :])[0 ]
220
220
return ret & pins
221
221
@@ -405,7 +405,7 @@ def read8(self, reg_base, reg):
405
405
self .read (reg_base , reg , ret )
406
406
return ret [0 ]
407
407
408
- def read (self , reg_base , reg , buf , delay = .005 ):
408
+ def read (self , reg_base , reg , buf , delay = .008 ):
409
409
"""Read an arbitrary I2C register range on the device"""
410
410
self .write (reg_base , reg )
411
411
if self ._drdy is not None :
0 commit comments