gw: add I2C bitbang module

This commit is contained in:
David Lenfesty 2023-06-17 16:33:03 +00:00
parent 034160b301
commit c1c0122684
2 changed files with 10 additions and 1 deletions

View File

@ -19,6 +19,7 @@ from litex.soc.integration.soc_core import *
from litex.soc.integration.builder import *
from litex.soc.cores.video import VideoHDMIPHY
from litex.soc.cores.led import LedChaser
from litex.soc.cores.bitbang import I2CMaster
from litex.soc.interconnect.csr import *
@ -149,6 +150,10 @@ class BaseSoC(SoCCore):
sampler_region = SoCRegion(origin=None, size=0x0040_0000, cached=False)
self.bus.add_slave(name="sampler", slave=self.sampler_controller.bus, region=sampler_region)
# Add I2C
i2c = I2CMaster(platform.request("i2c"))
self.add_module(name="i2c", module=i2c)
# Build --------------------------------------------------------------------------------------------
def main():

View File

@ -40,7 +40,11 @@ _io_v7_0 = [ # Colorlight i9 documented by @smunaut
# TODO the other serial ports
# TODO I2C
("i2c", 0,
Subsignal("sda", Pins("D16")),
Subsignal("scl", Pins("F5")),
IOStandard("LVCMOS33")
),
# SPIFlash (GD25Q16CSIG)
("spiflash", 0,