Skip to content

Commit e4ad995

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

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
@@ -2049,6 +2049,18 @@ def add_etherbone(self, name="etherbone", phy=None, phy_cd="eth", data_width=8,
20492049
add_ip_address_constants(self, "REMOTEIP", ethmac_remote_ip)
20502050
add_mac_address_constants(self, "MACADDR", ethmac_address)
20512051

2052+
# Add I2C Master -------------------------------------------------------------------------------
2053+
def add_i2c_master(self, name="i2cmaster", pads=None, **kwargs):
2054+
# Imports.
2055+
from litei2c import LiteI2C
2056+
2057+
# Core.
2058+
self.check_if_exists(name)
2059+
if pads is None:
2060+
pads = self.platform.request(name)
2061+
i2c = LiteI2C(self.sys_clk_freq, pads=pads, **kwargs)
2062+
self.add_module(name=name, module=i2c)
2063+
20522064
# Add SPI Master --------------------------------------------------------------------------------
20532065
def add_spi_master(self, name="spimaster", pads=None, data_width=8, spi_clk_freq=1e6, with_clk_divider=True, **kwargs):
20542066
# 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, branch="main"),
9293

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

0 commit comments

Comments
 (0)