soc/cores/i2c: add interrupt

This commit is contained in:
Andrew Dennison 2023-01-17 10:58:41 +11:00
parent 4ddab34714
commit ad37e17743
1 changed files with 7 additions and 1 deletions

View File

@ -11,7 +11,7 @@
from migen import *
from litex.soc.interconnect import wishbone
from litex.soc.interconnect.csr_eventmanager import *
# I2C-----------------------------------------------------------------------------------------------
@ -237,6 +237,12 @@ class I2CMaster(Module):
i2c.sda_i.eq(self.sda_t.i),
]
# Event Manager.
self.submodules.ev = EventManager()
self.ev.idle = EventSourceLevel()
self.ev.finalize()
self.comb += self.ev.idle.trigger.eq(i2c.idle)
I2C_XFER_ADDR, I2C_CONFIG_ADDR = range(2)
(
I2C_ACK,