setLevel method

void setLevel(
  1. int offset, {
  2. required bool value,
})

Drives offset from the outside world, as hardware would.

If a request holds the line with edge detection, this generates an edge event exactly as the kernel would — including the sequence numbers.

Implementation

void setLevel(int offset, {required bool value}) {
  final changed = _levels[offset] != value;
  _levels[offset] = value;
  if (changed) onEdge?.call(offset, level: value);
}