mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
dvisampler/edid: fix sda sampling, needs to be similar to scl.
Video sources with high scl frequency were not able to access EDID information through I2C. I2C start was not detected correctly and was randomly reseting the fsm during transfers.(seen with litescope)
This commit is contained in:
parent
12f5858850
commit
31956de790
1 changed files with 6 additions and 2 deletions
|
@ -36,6 +36,7 @@ class EDID(Module, AutoCSR):
|
||||||
# EDID
|
# EDID
|
||||||
scl_raw = Signal()
|
scl_raw = Signal()
|
||||||
sda_i = Signal()
|
sda_i = Signal()
|
||||||
|
sda_raw = Signal()
|
||||||
sda_drv = Signal()
|
sda_drv = Signal()
|
||||||
_sda_drv_reg = Signal()
|
_sda_drv_reg = Signal()
|
||||||
_sda_i_async = Signal()
|
_sda_i_async = Signal()
|
||||||
|
@ -43,7 +44,7 @@ class EDID(Module, AutoCSR):
|
||||||
self.specials += [
|
self.specials += [
|
||||||
MultiReg(pads.scl, scl_raw),
|
MultiReg(pads.scl, scl_raw),
|
||||||
Tristate(pads.sda, 0, _sda_drv_reg, _sda_i_async),
|
Tristate(pads.sda, 0, _sda_drv_reg, _sda_i_async),
|
||||||
MultiReg(_sda_i_async, sda_i)
|
MultiReg(_sda_i_async, sda_raw)
|
||||||
]
|
]
|
||||||
|
|
||||||
scl_i = Signal()
|
scl_i = Signal()
|
||||||
|
@ -51,7 +52,10 @@ class EDID(Module, AutoCSR):
|
||||||
samp_carry = Signal()
|
samp_carry = Signal()
|
||||||
self.sync += [
|
self.sync += [
|
||||||
Cat(samp_count, samp_carry).eq(samp_count + 1),
|
Cat(samp_count, samp_carry).eq(samp_count + 1),
|
||||||
If(samp_carry, scl_i.eq(scl_raw))
|
If(samp_carry,
|
||||||
|
scl_i.eq(scl_raw),
|
||||||
|
sda_i.eq(sda_raw)
|
||||||
|
)
|
||||||
]
|
]
|
||||||
|
|
||||||
scl_r = Signal()
|
scl_r = Signal()
|
||||||
|
|
Loading…
Reference in a new issue