def __init__(self, rpi_settings=None, callback=None):
"""
Class used to:
- manage RPI GPIO
- thread to catch mute button signal
The object receive a rpi settings object which contains pin number to use on the Rpi
When a signal is caught form the mute button, the callback method from the main controller is called
:param rpi_settings: Settings object with GPIO pin number to use
:type rpi_settings: RpiSettings
:param callback: Callback function from the main controller to call when the mute button is pressed
"""
super(RpiUtils, self).__init__()
GPIO.setmode(GPIO.BCM) # Use GPIO name
GPIO.setwarnings(False)
self.rpi_settings = rpi_settings
self.callback = callback
self.init_gpio(self.rpi_settings)
评论列表
文章目录