Skip to content

Commit 05702d8

Browse files
committed
litei2c: add to litex
add litei2c to litex. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
1 parent bccd1e9 commit 05702d8

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

litex/soc/integration/soc.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,6 +2043,18 @@ def add_etherbone(self, name="etherbone", phy=None, phy_cd="eth", data_width=8,
20432043
add_ip_address_constants(self, "REMOTEIP", ethmac_remote_ip)
20442044
add_mac_address_constants(self, "MACADDR", ethmac_address)
20452045

2046+
# Add I2C Master -------------------------------------------------------------------------------
2047+
def add_i2c_master(self, name="i2cmaster", pads=None, **kwargs):
2048+
# Imports.
2049+
from litei2c import LiteI2C
2050+
2051+
# Core.
2052+
self.check_if_exists(name)
2053+
if pads is None:
2054+
pads = self.platform.request(name)
2055+
i2c = LiteI2C(self.sys_clk_freq, pads=pads, **kwargs)
2056+
self.add_module(name=name, module=i2c)
2057+
20462058
# Add SPI Master --------------------------------------------------------------------------------
20472059
def add_spi_master(self, name="spimaster", pads=None, data_width=8, spi_clk_freq=1e6, with_clk_divider=True, **kwargs):
20482060
# Imports.

litex_setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def __init__(self, url, clone="regular", develop=True, sha1=None, branch="master
8989
"litescope": GitRepo(url="https://github.com/enjoy-digital/", tag=True),
9090
"litejesd204b": GitRepo(url="https://github.com/enjoy-digital/", tag=True),
9191
"litespi": GitRepo(url="https://github.com/litex-hub/", tag=True),
92+
"litei2c": GitRepo(url="https://github.com/litex-hub/", tag=True),
9293

9394
# LiteX Misc Cores.
9495
# -----------------

0 commit comments

Comments
 (0)