# # #
+ done = Signal()
bits = Signal(8)
xfer = Signal()
shift = Signal()
# Control FSM ------------------------------------------------------------------------------
self.submodules.fsm = fsm = FSM(reset_state="IDLE")
fsm.act("IDLE",
- self.done.eq(1),
+ done.eq(1),
If(self.start,
NextValue(bits, 0),
NextState("WAIT-CLK-FALL")
shift.eq(1),
self.irq.eq(1)
)
+ self.sync += self.done.eq(done & ~self.start)
# Chip Select generation -------------------------------------------------------------------
if hasattr(pads, "cs_n"):
If(clk_fall & shift,
miso_data.eq(Cat(miso, miso_data))
),
- If(self.done, self.miso.eq(miso_data)),
+ If(done, self.miso.eq(miso_data)),
]
def add_csr(self, with_cs=True, with_loopback=True):