projects
/
litex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
59fda8d
)
cores/spi: fix/simplify loopback
author
Florent Kermarrec
<florent@enjoy-digital.fr>
Sat, 13 Jul 2019 11:10:24 +0000
(13:10 +0200)
committer
Florent Kermarrec
<florent@enjoy-digital.fr>
Sat, 13 Jul 2019 11:10:27 +0000
(13:10 +0200)
litex/soc/cores/spi.py
patch
|
blob
|
history
diff --git
a/litex/soc/cores/spi.py
b/litex/soc/cores/spi.py
index 75d8ac12fc0c0b21da558afcd01831f88ae2ed42..6fb1e4680ebf89a4e77d62324f2c127a7184a842 100755
(executable)
--- a/
litex/soc/cores/spi.py
+++ b/
litex/soc/cores/spi.py
@@
-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()