Switch the pin state to a digital input with the provided starting
        pull-up resistor state (optional, no pull-up by default).  Note that
        pull-down resistors are NOT supported!
162497
def switch_to_input(self, pull=None, **kwargs):
        
        self.direction = digitalio.Direction.INPUT
        self.pull = pull
376354
def outputForInput(self, inState, inputSymbol):
        
        for (anInState, anInputSymbol,
             outState, outputSymbols) in self._transitions:
            if (inState, inputSymbol) == (anInState, anInputSymbol):
                return (outState, list(outputSymbols))
        raise NoTransition(state=inState, symbol=inputSymbol)
1150482
def put_device(self, pin, state, momentary=None, times=None, pause=None):
        
        url = self.base_url + '/device'

        payload = {
            "pin": pin,
            "state": state
        }

        if momentary is not None:
            payload["momentary"] = momentary

        if times is not None:
            payload["times"] = times

        if pause is not None:
            payload["pause"] = pause

        try:
            r = requests.put(url, json=payload, timeout=10)
            return r.json()
        except RequestException as err:
            raise Client.ClientError(err)
1025452
def change_digital(self, pin_nr, value):
        
        if not self._board:
            return
        with self._lock:
            self._act_digital[pin_nr].pin.write(value)
1296426
def set_gpio_pin(self, pin_number, setting, dest_addr_long=None):
        
        assert setting in const.GPIO_SETTINGS.values()
        self._send_and_wait(
            command=const.IO_PIN_COMMANDS[pin_number],
            parameter=setting.value,
            dest_addr_long=dest_addr_long)
1367894
private static void isrCallback(int pin) {
        // dispatch callback to the subscribers for this pin
        List<GpioInterruptCallback> callbacks = isrCallbacks[pin];

        // ensure callbacks collection exists for this pins number
        if(callbacks != null && !callbacks.isEmpty()){
            // iterate over each callback delegate and invoke the callback if the pin and edge type match
            for(GpioInterruptCallback callback : callbacks){
                callback.callback(pin);
            }
        }
    }
579506
def _select_input(self):
        """"""
        line, index = self.get_position('eof')
        if self.current_prompt_pos is None:
            pline, pindex = line, index
        else:
            pline, pindex = self.current_prompt_pos
        self.setSelection(pline, pindex, line, index)
1075704
@Override
    public void setState(MotorState state) {

        switch(state) {
            case STOP: {
                // set internal tracking state
                currentState = MotorState.STOP;

                // turn all GPIO pins to OFF state
                for(GpioPinDigitalOutput pin : pins)
                    pin.setState(offState);

                break;
            }
            case FORWARD: {
                // set internal tracking state
                currentState = MotorState.FORWARD;

                // start control thread if not already running
                if(!controlThread.isAlive()) {
                    controlThread = new GpioStepperMotorControl();
                    controlThread.start();
                }

                break;
            }
            case REVERSE: {
                // set internal tracking state
                currentState = MotorState.REVERSE;

                // start control thread if not already running
                if(!controlThread.isAlive()) {
                    controlThread = new GpioStepperMotorControl();
                    controlThread.start();
                }

                break;
            }
            default: {
                throw new UnsupportedOperationException("Cannot set motor state: " + state.toString());
            }
        }
    }
706219
public function setValue(int $state): bool
    {
        if ($this->type == GPIO::IN) {
            throw new GPIOException('Setting the value of a GPIO input pin is not supported!');
        }
        return $this->adapter->write($this->pin, $state);
    }
1098035
protected function resetInput()
    {
        if ($this->minInput === 0) {
            $this->state = self::STATE_COMPLETE;
        } else {
            $this->state = self::STATE_TIMEOUT;
        }
        $this->input = self::DTMF_NONE;
        return $this;
    }
1170286
def input_loop():
    ''''''
    while mpstate.status.exit != True:
        try:
            if mpstate.status.exit != True:
                line = input(mpstate.rl.prompt)
        except EOFError:
            mpstate.status.exit = True
            sys.exit(1)
        mpstate.input_queue.put(line)
757832
def set_enable(self, channel, value):
        '''
        '''
        try:
            bit = self._ch_map[channel]['GPIOEN']['bit']
        except KeyError:
            raise ValueError('set_enable() not supported for channel %s' % channel)
        self._set_power_gpio_value(bit=bit, value=value)
1147854
@Override
    public SensorState getState() {
        if(pin.isState(openState))
            return SensorState.OPEN;
        else
            return SensorState.CLOSED;
    }
1022771
def _input_pins(self, pins):
        
        [self._validate_channel(pin) for pin in pins]
        # Get GPIO state.
        gpio = self.i2c.read_list(self.GPIO, self.gpio_bytes)
        # Return True if pin's bit is set.
        return [(gpio[int(pin/8)] & 1 << (int(pin%8))) > 0 for pin in pins]
1132657
async def digital_pin_write(self, pin, value):
        

        command = (PrivateConstants.SET_DIGITAL_PIN_VALUE, pin, value)

        await self._send_command(command)
559771
@Override
    public SwitchState getState() {
        if(pin.isState(onState))
            return SwitchState.ON;
        else
            return SwitchState.OFF;
    }
105550
def initialize():
    
    for pin in sorted(OUTPUT_PINS.values()):
        _enable_pin(pin, OUT)

    for pin in sorted(INPUT_PINS.values()):
        _enable_pin(pin, IN)