GPIO constructor

GPIO(
  1. int line,
  2. GPIOdirection direction, [
  3. int chip = 0
])

Opens the character device GPIO with the specified GPIO line and direction at the default character device GPIO with the chip number. The default chip number is 0, with the path /dev/gpiochip0.

Use GPIO.setBaseGPIOpath to change the default character device path.

Implementation

GPIO(this.line, this.direction, [this.chip = 0])
    : path = _gpioBasePath + chip.toString(),
      name = '',
      _gpioHandle =
          _openGPIO(_gpioBasePath + chip.toString(), line, direction);