Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4cabca17a5ad
Choose a base ref
...
head repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 724208f50189
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Mar 12, 2019

  1. applet.interface.spi_master: let subclasses add their own pin arguments.

    This makes sense for cases where a subclassing applet e.g. requires
    SS, SCK, and MOSI but doesn't need MISO at all.
    whitequark committed Mar 12, 2019
    Copy the full SHA
    724208f View commit details
Showing with 6 additions and 5 deletions.
  1. +6 −5 software/glasgow/applet/interface/spi_master/__init__.py
11 changes: 6 additions & 5 deletions software/glasgow/applet/interface/spi_master/__init__.py
Original file line number Diff line number Diff line change
@@ -279,13 +279,14 @@ class SPIMasterApplet(GlasgowApplet, name="spi-master"):
__pins = ("sck", "ss", "mosi", "miso")

@classmethod
def add_build_arguments(cls, parser, access):
def add_build_arguments(cls, parser, access, omit_pins=False):
super().add_build_arguments(parser, access)

access.add_pin_argument(parser, "sck", required=True)
access.add_pin_argument(parser, "ss")
access.add_pin_argument(parser, "mosi")
access.add_pin_argument(parser, "miso")
if not omit_pins:
access.add_pin_argument(parser, "sck", required=True)
access.add_pin_argument(parser, "ss")
access.add_pin_argument(parser, "mosi")
access.add_pin_argument(parser, "miso")

parser.add_argument(
"-b", "--bit-rate", metavar="FREQ", type=int, default=100,