reconfigureOutput method

void reconfigureOutput({
  1. OutputMode outputMode = OutputMode.pushPull,
  2. Bias bias = Bias.unknown,
  3. ActiveState activeState = ActiveState.high,
  4. @required bool initialValue = false,
})

Reconfigures the line as output with the given configuration.

If ProxyGpiod.supportsBias is false, bias must be null, otherwise a UnsupportedError will be thrown.

This will throw a UnsupportedError if ProxyGpiod.supportsLineReconfiguration is false.

Implementation

void reconfigureOutput(
    {OutputMode outputMode = OutputMode.pushPull,
      Bias bias = Bias.unknown,
      ActiveState activeState = ActiveState.high,
      @required bool initialValue = false}) {
  ArgumentError.checkNotNull(outputMode, "outputMode");
  _checkSupportsBiasValue(bias);
  ArgumentError.checkNotNull(activeState, "activeState");
  ArgumentError.checkNotNull(initialValue, "initialValue");
  _checkSupportsLineReconfiguration();

  //return _synchronizedWrite(() async {
    _info = null;
    _value = null;

//      if (!_requested) {
//        throw StateError(
//            "Can't reconfigured line because it is not requested.");
//      }

    _ProxyGpiodPlatformSide.reconfigureLine(
        lineHandle: _lineHandle,
        direction: LineDirection.output,
        outputMode: outputMode,
        bias: bias,
        activeState: activeState,
        initialValue: initialValue);

    _value = initialValue;
    _info = _ProxyGpiodPlatformSide.getLineInfo(_lineHandle);
  //});
}