mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
cores/spi: fix/simplify loopback
This commit is contained in:
parent
59fda8da93
commit
d3aaaf5e6c
1 changed files with 5 additions and 4 deletions
|
@ -117,15 +117,16 @@ class SPIMaster(Module, AutoCSR):
|
|||
self.sync += \
|
||||
If(shift,
|
||||
If(clk_rise,
|
||||
miso.eq(pads.miso),
|
||||
If(self.loopback,
|
||||
miso.eq(pads.mosi)
|
||||
).Else(
|
||||
miso.eq(pads.miso)
|
||||
)
|
||||
).Elif(clk_fall,
|
||||
miso_data.eq(Cat(miso, miso_data[:-1]))
|
||||
)
|
||||
)
|
||||
|
||||
# Loopback ---------------------------------------------------------------------------------
|
||||
self.comb += If(self.loopback, pads.miso.eq(pads.mosi))
|
||||
|
||||
def add_control(self):
|
||||
self._control = CSRStorage(16)
|
||||
self._status = CSRStatus()
|
||||
|
|
Loading…
Reference in a new issue