add I2C into ls180
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 30 Sep 2020 21:33:25 +0000 (22:33 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 30 Sep 2020 21:33:25 +0000 (22:33 +0100)
src/soc/litex/florent/libresoc/ls180.py
src/soc/litex/florent/ls180soc.py

index 5331cd7f12d764e3501a83a142b6bed6585c4d74..6e122c66c06e5e859e771997ab78eab2071abf4e 100644 (file)
@@ -123,7 +123,7 @@ _io.append(make_uart("uart", 0))
 _io.append(make_uart("uart", 1))
 
 # not connected - eurgh have to adjust this to match the total pincount.
-num_nc = 42
+num_nc = 40
 nc = ' '.join("NC%d" % i for i in range(num_nc))
 _io.append(("nc", 0, Pins(nc), IOStandard("LVCMOS33")))
 
index fd6c84b95f20b05bcdf1876c440ae84652d2afd0..ecb10bcc02e5074e5071f4c2f6580745f7d6d6db 100755 (executable)
@@ -47,7 +47,7 @@ SoCCSRHandler.supported_address_width.append(12)
 # GPIO Tristate -------------------------------------------------------
 # doesn't work properly.
 #from litex.soc.cores.gpio import GPIOTristate
-from litex.soc.interconnect.csr import CSRStorage, CSRStatus
+from litex.soc.interconnect.csr import CSRStorage, CSRStatus, CSRField
 from migen.genlib.cdc import MultiReg
 
 # Imports
@@ -471,10 +471,9 @@ class LibreSoCSim(SoCCore):
             setattr(self.submodules, name, PWM(platform.request("pwm", i)))
             self.add_csr(name)
 
-        if False: # TODO: convert to _i _o _oe
-            # I2C Master
-            self.submodules.i2c = I2CMaster(platform.request("i2c"))
-            self.add_csr("i2c")
+        # I2C Master
+        self.submodules.i2c = I2CMaster(platform.request("i2c"))
+        self.add_csr("i2c")
 
         # SDCard -----------------------------------------------------