def __init__(self, layout):
ClassLogger.__init__(self)
# IO event callbacks occur in another thread, dbus/gdk need
# to be made aware of this.
gobject.threads_init()
GPIO.setmode(GPIO.BCM)
self._layout = layout
for name, config in layout.iteritems():
for point in ['pin', 'pull_up_down']:
Inputs._raise_if_not_in(point, config)
config = copy.deepcopy(config)
config['name'] = name
self._inputs_by_channel[config['pin']] = config
self._configure_input(name, config)
评论列表
文章目录