From 0acd7cc817421574b25e647c044c1b568cf2ddd1 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 20 Mar 2018 16:12:36 +0000 Subject: [PATCH] add io option to Pin --- src/interface_decl.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/interface_decl.py b/src/interface_decl.py index c66098e..a74e812 100644 --- a/src/interface_decl.py +++ b/src/interface_decl.py @@ -72,10 +72,16 @@ pwminterface_decl = ''' class Pin(object): - def __init__(self, name, ready, enabled, action, inout): + def __init__(self, name, + ready=True, + enabled=True, + io=False, + action=False, + inout=True): self.name = name self.ready = ready self.enabled = enabled + self.io = io self.action = action self.inout = inout @@ -86,6 +92,8 @@ class Pin(object): status.append('always_ready') if self.enabled: status.append('always_enabled') + if self.io: + status.append('result="io"') res += ','.join(status) res += "*) method " if self.action: @@ -96,7 +104,6 @@ class Pin(object): res += ";" return res - # basic test if __name__ == '__main__': -- 2.30.2