示例#1
0
    def init(self):
        super().init()
        ports = []
        for n, (port_id, port_desc, hwid) in enumerate(sorted(comports()), 1):
            port_str = port_id + ' - ' + port_desc
            ports.append(port_str)
        Machine.set_feature('UART', ports)

        Machine.set_handler_class('UART', UART_PC)
示例#2
0
    def init(self):
        super().init()
        Machine.set_feature('PIN_IO', LIST_PIN_IO)
        Machine.set_feature('PIN_I', LIST_PIN_IO)
        Machine.set_feature('PIN_O', LIST_PIN_IO)
        Machine.set_feature('I2C', LIST_I2C)
        Machine.set_feature('SPI', LIST_SPI)

        Machine.set_handler_class('PIN_IO', Pin_PC)
        Machine.set_handler_class('I2C', I2C_PC)
示例#3
0
    def init(self):
        super().init()
        GPIO.setmode(GPIO.BCM)
        GPIO.setwarnings(False)

        Machine.set_feature('PIN_IO', LIST_PIN_IO)
        Machine.set_feature('PIN_I', LIST_PIN_IO)
        Machine.set_feature('PIN_O', LIST_PIN_IO)
        Machine.set_feature('I2C', LIST_I2C)
        Machine.set_feature('SPI', LIST_SPI)

        ports = []
        for n, (port_id, port_desc, hwid) in enumerate(sorted(comports()), 1):
            port_str = port_id + ' - ' + port_desc
            ports.append(port_str)
        Machine.set_feature('UART', ports)
        print(ports)

        Machine.set_handler_class('PIN_IO', Pin_RPi)
        Machine.set_handler_class('UART', UART_RPi)
        Machine.set_handler_class('I2C', I2C_RPi)
示例#4
0
    def init(self):
        super().init()
        Machine.set_feature('PIN_IO', LIST_PIN_IO)
        Machine.set_feature('PIN_I', LIST_PIN_IO)
        Machine.set_feature('PIN_O', LIST_PIN_IO)
        Machine.set_feature('I2C', LIST_I2C)
        Machine.set_feature('SPI', LIST_SPI)
        Machine.set_feature('UART', LIST_UART)

        Machine.set_handler_class('PIN_IO', Pin_ESP32)
        Machine.set_handler_class('I2C', I2C_ESP32)
        Machine.set_handler_class('ADC', ADC_ESP32)
        Machine.set_handler_class('UART', UART_ESP32)
示例#5
0
    def init(self):
        super().init()

        Machine.set_feature('I2C', LIST_I2C)

        Machine.set_handler_class('I2C', I2C_PC)
示例#6
0
    def init(self):
        super().init()
        Machine.set_feature('PIN_IO', LIST_PIN_IO)
        Machine.set_feature('PIN_I', LIST_PIN_IO)
        Machine.set_feature('PIN_O', LIST_PIN_IO)
        Machine.set_feature('PIN_ADC', LIST_PIN_ADC)
        Machine.set_feature('PIN_DAC', LIST_PIN_DAC)
        Machine.set_feature('I2C', LIST_I2C)
        Machine.set_feature('SPI', LIST_SPI)
        Machine.set_feature('UART', LIST_UART)
        Machine.set_feature('CAN', LIST_CAN)

        Machine.set_handler_class('PIN_IO', Pin_PyB)
        Machine.set_handler_class('UART', UART_PyB)