diff --git a/litex/soc/cores/i2c_worker.py b/litex/soc/cores/i2c_worker.py index 1c1a3d8e76..a718ec981e 100644 --- a/litex/soc/cores/i2c_worker.py +++ b/litex/soc/cores/i2c_worker.py @@ -28,6 +28,14 @@ class I2CState(IntEnum): ABORT = 9 CLR_FIFO = 10 + @classmethod + def encode(self): + return list(map(lambda c: c.value, self)) + + @classmethod + def __len__(self): + return 11 + @dataclass class I2CQueueEntry(param.Parameterized):