forked from M-Labs/artiq
gateware.spi: simpler clk bias
This commit is contained in:
parent
d5893d15fb
commit
9a881aa430
|
@ -20,7 +20,7 @@ class SPIClockGen(Module):
|
||||||
cnt.eq(cnt - 1),
|
cnt.eq(cnt - 1),
|
||||||
If(self.edge,
|
If(self.edge,
|
||||||
cnt.eq(self.load[1:] +
|
cnt.eq(self.load[1:] +
|
||||||
(self.load[0] & self.bias)),
|
(self.load[0] & (self.clk ^ self.bias))),
|
||||||
self.clk.eq(~self.clk),
|
self.clk.eq(~self.clk),
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
@ -143,7 +143,7 @@ class SPIMachine(Module):
|
||||||
).Else(
|
).Else(
|
||||||
self.cg.load.eq(self.div_read),
|
self.cg.load.eq(self.div_read),
|
||||||
),
|
),
|
||||||
self.cg.bias.eq(fsm.before_entering("SETUP")),
|
self.cg.bias.eq(self.clk_phase),
|
||||||
fsm.ce.eq(self.cg.edge),
|
fsm.ce.eq(self.cg.edge),
|
||||||
self.cs.eq(~fsm.ongoing("IDLE")),
|
self.cs.eq(~fsm.ongoing("IDLE")),
|
||||||
self.reg.ce.eq(self.cg.edge),
|
self.reg.ce.eq(self.cg.edge),
|
||||||
|
|
Loading…
Reference in New Issue