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