From 929e55d7e62b7430b917d8a28604f315d4bb64b5 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 29 Jul 2020 09:07:44 +0200 Subject: [PATCH] platforms/trellisboard: add SDCard PMOD pins. --- litex_boards/platforms/trellisboard.py | 28 +++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/litex_boards/platforms/trellisboard.py b/litex_boards/platforms/trellisboard.py index 03b780b..c79f520 100644 --- a/litex_boards/platforms/trellisboard.py +++ b/litex_boards/platforms/trellisboard.py @@ -209,9 +209,35 @@ _connectors = [ ("ext0", "T1 U1 AE5 AE4 AB5 AB6 Y5 W5 W2 Y1 AB7 AC6 AB3 AB4 AD3 AE3 AB1 AC1 AD1 AE1 AD6 AE6 AC7 AD7"), ("ext1", "P5 P4 R7 T7 R6 T6 U6 U7 R4 T5 T4 U5 U4 V4 V6 V7 P2 P3 R3 T3 N1 P1 U2 U3"), ("ext2", "K6 K7 J7 J6 H6 H5 F4 F5 F3 E3 C4 C3 C5 D5 D3 D2 H2 H3 J3 K3 B1 C2 F1 H1") - ] + +# PMODS -------------------------------------------------------------------------------------------- + +def sdcard_pmod_io(pmod): + return [ + # SDCard PMOD: + # - https://store.digilentinc.com/pmod-microsd-microsd-card-slot/ + # - https://github.com/antmicro/arty-expansion-board + ("spisdcard", 0, + Subsignal("clk", Pins(f"{pmod}:3")), + Subsignal("mosi", Pins(f"{pmod}:1"), Misc("PULLMODE=UP")), + Subsignal("cs_n", Pins(f"{pmod}:0"), Misc("PULLMODE=UP")), + Subsignal("miso", Pins(f"{pmod}:2"), Misc("PULLMODE=UP")), + Misc("SLEWRATE=FAST"), + IOStandard("LVCMOS33"), + ), + ("sdcard", 0, + Subsignal("data", Pins(f"{pmod}:2 {pmod}:4 {pmod}:5 {pmod}:0"), Misc("PULLMODE=UP")), + Subsignal("cmd", Pins(f"{pmod}:1"), Misc("PULLMODE=UP")), + Subsignal("clk", Pins(f"{pmod}:3")), + Subsignal("cd", Pins(f"{pmod}:6")), + Misc("SLEWRATE=FAST"), + IOStandard("LVCMOS33"), + ), +] +_sdcard_pmod_io = sdcard_pmod_io("pmoda") # SDCARD PMOD on PMODA. + # Platform ----------------------------------------------------------------------------------------- class Platform(LatticePlatform):