File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -288,6 +288,31 @@ def int_flagb(self):
288
288
flags = [pin + 8 for pin in range (8 ) if intfb & (1 << pin )]
289
289
return flags
290
290
291
+ @property
292
+ def int_cap (self ):
293
+ """Returns a list with the pin values at time of interrupt
294
+ port A ----> pins 0-7
295
+ port B ----> pins 8-15
296
+ """
297
+ intcap = self ._read_u16le (_MCP23017_INTCAPA )
298
+ return [(intcap >> pin ) & 1 for pin in range (16 )]
299
+
300
+ @property
301
+ def int_capa (self ):
302
+ """Returns a list of pin values at time of interrupt
303
+ pins: 0-7
304
+ """
305
+ intcapa = self ._read_u8 (_MCP23017_INTCAPA )
306
+ return [(intcapa >> pin ) & 1 for pin in range (8 )]
307
+
308
+ @property
309
+ def int_capb (self ):
310
+ """Returns a list of pin values at time of interrupt
311
+ pins: 8-15
312
+ """
313
+ intcapb = self ._read_u8 (_MCP23017_INTCAPB )
314
+ return [(intcapb >> pin ) & 1 for pin in range (8 )]
315
+
291
316
def clear_ints (self ):
292
317
"""Clears interrupts by reading INTCAP."""
293
318
self ._read_u16le (_MCP23017_INTCAPA )
You can’t perform that action at this time.
0 commit comments