reconfigureOutput method
void
reconfigureOutput({
- OutputMode outputMode = OutputMode.pushPull,
- Bias bias = Bias.unknown,
- ActiveState activeState = ActiveState.high,
- @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);
//});
}