mirror of
https://github.com/litex-hub/litex-boards.git
synced 2025-01-03 03:43:36 -05:00
litex_m2_baseboard: Add LCD.
This commit is contained in:
parent
393252ddc9
commit
fe08491e8d
2 changed files with 16 additions and 1 deletions
litex_boards
|
@ -25,6 +25,13 @@ _io = [
|
||||||
("user_btn", 0, Pins("M19"), IOStandard("LVCMOS33")),
|
("user_btn", 0, Pins("M19"), IOStandard("LVCMOS33")),
|
||||||
("user_btn", 1, Pins("M20"), IOStandard("LVCMOS33")),
|
("user_btn", 1, Pins("M20"), IOStandard("LVCMOS33")),
|
||||||
|
|
||||||
|
# LCD
|
||||||
|
("lcd", 0,
|
||||||
|
Subsignal("scl", Pins("P18"), Misc("PULLMODE=UP")),
|
||||||
|
Subsignal("sda", Pins("L20"), Misc("PULLMODE=UP")),
|
||||||
|
IOStandard("LVCMOS33")
|
||||||
|
),
|
||||||
|
|
||||||
# RGMII Ethernet
|
# RGMII Ethernet
|
||||||
("eth_clocks", 0,
|
("eth_clocks", 0,
|
||||||
Subsignal("tx", Pins("M1")),
|
Subsignal("tx", Pins("M1")),
|
||||||
|
|
|
@ -20,6 +20,7 @@ from litex.soc.cores.clock import *
|
||||||
from litex.soc.integration.soc_core import *
|
from litex.soc.integration.soc_core import *
|
||||||
from litex.soc.integration.builder import *
|
from litex.soc.integration.builder import *
|
||||||
from litex.soc.cores.video import VideoHDMIPHY
|
from litex.soc.cores.video import VideoHDMIPHY
|
||||||
|
from litex.soc.cores.bitbang import I2CMaster
|
||||||
|
|
||||||
from liteeth.phy.ecp5rgmii import LiteEthPHYRGMII
|
from liteeth.phy.ecp5rgmii import LiteEthPHYRGMII
|
||||||
|
|
||||||
|
@ -66,6 +67,7 @@ class BaseSoC(SoCCore):
|
||||||
with_ethernet = False,
|
with_ethernet = False,
|
||||||
with_etherbone = False,
|
with_etherbone = False,
|
||||||
with_video_terminal = False,
|
with_video_terminal = False,
|
||||||
|
with_lcd = False,
|
||||||
**kwargs):
|
**kwargs):
|
||||||
platform = litex_m2_baseboard.Platform(toolchain="trellis")
|
platform = litex_m2_baseboard.Platform(toolchain="trellis")
|
||||||
|
|
||||||
|
@ -89,12 +91,15 @@ class BaseSoC(SoCCore):
|
||||||
if with_etherbone:
|
if with_etherbone:
|
||||||
self.add_etherbone(phy=self.ethphy)
|
self.add_etherbone(phy=self.ethphy)
|
||||||
|
|
||||||
|
|
||||||
# Video ------------------------------------------------------------------------------------
|
# Video ------------------------------------------------------------------------------------
|
||||||
if with_video_terminal:
|
if with_video_terminal:
|
||||||
self.submodules.videophy = VideoHDMIPHY(platform.request("hdmi"), clock_domain="hdmi", pn_swap=["g", "b"])
|
self.submodules.videophy = VideoHDMIPHY(platform.request("hdmi"), clock_domain="hdmi", pn_swap=["g", "b"])
|
||||||
self.add_video_terminal(phy=self.videophy, timings="640x480@75Hz", clock_domain="hdmi")
|
self.add_video_terminal(phy=self.videophy, timings="640x480@75Hz", clock_domain="hdmi")
|
||||||
|
|
||||||
|
# LCD --------------------------------------------------------------------------------------
|
||||||
|
if with_lcd:
|
||||||
|
self.submodules.i2c = I2CMaster(platform.request("lcd"))
|
||||||
|
|
||||||
# Build --------------------------------------------------------------------------------------------
|
# Build --------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -111,6 +116,8 @@ def main():
|
||||||
sdopts.add_argument("--with-sdcard", action="store_true", help="Enable SDCard support")
|
sdopts.add_argument("--with-sdcard", action="store_true", help="Enable SDCard support")
|
||||||
viopts = parser.add_mutually_exclusive_group()
|
viopts = parser.add_mutually_exclusive_group()
|
||||||
viopts.add_argument("--with-video-terminal", action="store_true", help="Enable Video Terminal (HDMI)")
|
viopts.add_argument("--with-video-terminal", action="store_true", help="Enable Video Terminal (HDMI)")
|
||||||
|
parser.add_argument("--with-lcd", action="store_true", help="Enable OLED LCD support")
|
||||||
|
|
||||||
builder_args(parser)
|
builder_args(parser)
|
||||||
soc_core_args(parser)
|
soc_core_args(parser)
|
||||||
trellis_args(parser)
|
trellis_args(parser)
|
||||||
|
@ -121,6 +128,7 @@ def main():
|
||||||
with_ethernet = args.with_ethernet,
|
with_ethernet = args.with_ethernet,
|
||||||
with_etherbone = args.with_etherbone,
|
with_etherbone = args.with_etherbone,
|
||||||
with_video_terminal = args.with_video_terminal,
|
with_video_terminal = args.with_video_terminal,
|
||||||
|
with_lcd = args.with_lcd,
|
||||||
**soc_core_argdict(args)
|
**soc_core_argdict(args)
|
||||||
)
|
)
|
||||||
if args.with_spi_sdcard:
|
if args.with_spi_sdcard:
|
||||||
|
|
Loading…
Reference in a new issue