ErrorCheckingTransmitter constructor

ErrorCheckingTransmitter(
  1. Logic data, {
  2. required int codeWidth,
  3. required String name,
  4. String? definitionName,
})

Creates a transmitter for data.

Implementation

ErrorCheckingTransmitter(Logic data,
    {required int codeWidth, required super.name, super.definitionName}) {
  this.data = addInput('data', data, width: data.width);

  addOutput('code', width: codeWidth);
  addOutput('transmission', width: codeWidth + data.width) <=
      [code, this.data].swizzle();

  code <= calculateCode();
}