Skip to content

Commit

Permalink
litei2c: add to litex
Browse files Browse the repository at this point in the history
add litei2c to litex.

Signed-off-by: Fin Maaß <[email protected]>
  • Loading branch information
maass-hamburg committed Sep 27, 2024
1 parent b135f71 commit e4ad995
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions litex/soc/integration/soc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2049,6 +2049,18 @@ def add_etherbone(self, name="etherbone", phy=None, phy_cd="eth", data_width=8,
add_ip_address_constants(self, "REMOTEIP", ethmac_remote_ip)
add_mac_address_constants(self, "MACADDR", ethmac_address)

# Add I2C Master -------------------------------------------------------------------------------
def add_i2c_master(self, name="i2cmaster", pads=None, **kwargs):
# Imports.
from litei2c import LiteI2C

# Core.
self.check_if_exists(name)
if pads is None:
pads = self.platform.request(name)
i2c = LiteI2C(self.sys_clk_freq, pads=pads, **kwargs)
self.add_module(name=name, module=i2c)

# Add SPI Master --------------------------------------------------------------------------------
def add_spi_master(self, name="spimaster", pads=None, data_width=8, spi_clk_freq=1e6, with_clk_divider=True, **kwargs):
# Imports.
Expand Down
1 change: 1 addition & 0 deletions litex_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def __init__(self, url, clone="regular", develop=True, sha1=None, branch="master
"litescope": GitRepo(url="https://github.com/enjoy-digital/", tag=True),
"litejesd204b": GitRepo(url="https://github.com/enjoy-digital/", tag=True),
"litespi": GitRepo(url="https://github.com/litex-hub/", tag=True),
"litei2c": GitRepo(url="https://github.com/litex-hub/", tag=True, branch="main"),

# LiteX Misc Cores.
# -----------------
Expand Down

0 comments on commit e4ad995

Please sign in to comment.