How to use the pin.Pin function in pin

To help you get started, we’ve selected a few pin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kubos / kubos-old / test / integration / jenkinsnode / cistack / nasatbus.py View on Github external
def __init__(self):
        self.board = "na-satbus-3c0-gcc"
        self.arch = "ARM"
        self.cpu = "stm32f405"
        self.binfiletype = "ELF"
        self.pins = {
            'rst' : Pin(name = 'rst', number = 17),
            'pwr' : Pin(name = 'pwr', number = 27)
        }
github kubos / kubos-old / test / integration / jenkinsnode / cistack / stm32f407discovery.py View on Github external
def __init__(self):
        self.board = "stm32f407-disco-gcc"
        self.arch = "ARM"
        self.cpu = "stm32f407"
        self.binfiletype = "ELF"
        self.pins = {
            'rst' : Pin(name = 'rst', number = 17),
            'pwr' : Pin(name = 'pwr', number = 27),
            'opt' : Pin(name = 'opt', number = 22)  # optional
        }
github kubos / kubos-old / test / integration / jenkinsnode / cistack / msp430f5529.py View on Github external
def __init__(self):
        self.board = "msp430f5529-gcc"
        self.arch = "MSP430"
        self.cpu = "msp430f5529"
        self.binfiletype = "ELF"
        self.pins = {
            'rst' : Pin(name = 'rst', number = 17),
            'pwr' : Pin(name = 'pwr', number = 27),
            'opt' : Pin(name = 'opt', number = 22)  # optional
        }
github kubos / kubos-old / test / integration / jenkinsnode / cistack / noboard.py View on Github external
def __init__(self):
        self.board = "noboard"
        self.arch = "noarch"
        self.cpu = "nocpu"
        self.binfiletype = "nobinfile"
        self.pins = {
            'rst' : Pin(name = 'rst', number = 17),
            'pwr' : Pin(name = 'pwr', number = 27),
            'opt' : Pin(name = 'opt', number = 22)
        }
github kubos / kubos-old / test / integration / jenkinsnode / cistack / pyboard.py View on Github external
def __init__(self):
        self.board = "pyboard-gcc"
        self.arch = "ARM"
        self.cpu = "stm32f405"
        self.binfiletype = "BIN"
        self.pins = {
            'rst' : Pin(name = 'rst', number = 17),
            'pwr' : Pin(name = 'pwr', number = 27),
            'prg' : Pin(name = 'prg', number = 18),
            'opt' : Pin(name = 'opt', number = 22)
        }
github cryptoadvance / specter-diy / src / gui / screens.py View on Github external
style.text.color = lv.color_hex(0xffffff)
    style.text.letter_space = 15
    pin_lbl.set_style(lv.label.STYLE.MAIN, style)
    pin_lbl.set_width(HOR_RES-2*PADDING)
    pin_lbl.set_x(PADDING)
    pin_lbl.set_y(PADDING+50)
    pin_lbl.set_cursor_type(lv.CURSOR.HIDDEN)
    pin_lbl.set_one_line(True)
    pin_lbl.set_text_align(lv.label.ALIGN.CENTER)
    pin_lbl.set_pwd_show_time(0)

    instruct_txt = "Device tamper check.\nThese words should remain #ffffff the same every time#:"
    instruct_label = add_label(instruct_txt, 180, style="hint")
    instruct_label.set_recolor(True)
    antiphish_label = add_label(antiphishing_word(""), 250)
    Pin.read_counter()

    @feed_rng
    def cb(obj, event):
        nonlocal first_time_usage
        if event == lv.EVENT.RELEASED:
            c = obj.get_active_btn_text()
            if c is None:
                return
            if c == lv.SYMBOL.CLOSE:
                pin_lbl.set_text("")
                antiphish_label.set_text(antiphishing_word(""))
            elif c == lv.SYMBOL.OK:
                # FIXME: check PIN len
                Key.generate_key(pin_lbl.get_text());
                if first_time_usage:
                    Secret.save_secret(alert);
github cryptoadvance / specter-diy / src / gui / screens.py View on Github external
if c is None:
                return
            if c == lv.SYMBOL.CLOSE:
                pin_lbl.set_text("")
                antiphish_label.set_text(antiphishing_word(""))
            elif c == lv.SYMBOL.OK:
                # FIXME: check PIN len
                Key.generate_key(pin_lbl.get_text());
                if first_time_usage:
                    Secret.save_secret(alert);
                    callback()
                else:
                    Pin.counter -= 1
                    Pin.save_counter(alert)
                    if Pin.is_pin_valid():
                        Pin.reset_counter(alert)
                        callback()
                    else:
                        instruct_label.set_text("#f07070 Wrong pin: %d/%d #" % (Pin.counter, Pin.ATTEMPTS_MAX))
                        if Pin.counter <= 0:
                            Factory_settings.restore(alert)
                            Secret.generate_secret()
                            alert("Security","Device has been factory reset!")
                            first_time_usage = True
                            title_lbl.set_text(first_time_title)
                            instruct_label.set_text(instruct_txt)
                pin_lbl.set_text("")
                antiphish_label.set_text(antiphishing_word(""))
            else:
                instruct_label.set_text(instruct_txt)
                pin_lbl.add_text(c)
                word = antiphishing_word(pin_lbl.get_text())