oxidecomputer / oxidecomputer/humility

want to be able to specify device for `humility spi`

Open
#182 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
584
Forks
63
Avg merge
3h
Merged PRs (30d)
2

Description

humility i2c allows me to specify a specific device in the app.toml which is great. It would be nice to have this for SPI and have it take care of chip selects. In particular, this comes to a head when we're dealing with the FPGAs that are on the Sidecar front I/O board. While they are both on the SPI1 peripheral, there are multiple different pins that are being used for chip selects and an internal mux to boot. For example, in the app.toml we see:

[config.spi.spi1.mux_options.port_adg]
outputs = [
    {port = "A", pins = [5], af = 5}, # FRONT_IO_SCK
    {port = "D", pins = [7], af = 5}, # FRONT_IO_COPI
]
input = {port = "G", pin = 9, af = 5} # FRONT_IO_CIPO

[config.spi.spi1.devices.ecp5_front_io_fpga]
mux = "port_adg"
cs = [{port = "G", pin = 10}] # FRONT_IO_CS0

[config.spi.spi1.devices.ecp5_front_io_user_design]
mux = "port_adg"
cs = [{port = "A", pin = 15}] # FRONT_IO_CS1

If you try to just use a plain spi1 it's not clear what it's talking to and doesn't necessarily work.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the humility spi and humility i2c entry points, then inspect the app.toml configuration under config.spi.spi1.devices. Add a way for humility spi to select ecp5_front_io_fpga or ecp5_front_io_user_design and use its configured chip select; verify that selecting a device works when multiple chip selects share SPI1.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.