Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sonata IO getting started guide #60

Merged
merged 1 commit into from
Nov 8, 2024
Merged

Conversation

GregAC
Copy link
Contributor

@GregAC GregAC commented Nov 8, 2024

Certainly room for improvement here but I'm keen to have something available with or very shortly after (i.e. today) the v1.0 release so people have a chance of working out how to use the IO.

There's a bunch of links to CHERIoT RTOS and Sonata System here. I think these should be linked to a specific commit/tag so they definitely correspond to v1.0. I haven't done that yet as things were still changing whilst I was writing this.

@GregAC
Copy link
Contributor Author

GregAC commented Nov 8, 2024

Couple of things still to do here:

  • dig out more ADC spec details (in particular voltage range!)
  • a short section explaining how you instantiate a driver and point it to a particular device
  • add usbdev to the sonata-prerelease board definition.

Copy link
Contributor

@marnovandermaas marnovandermaas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable to me. I would like Alex's review before merging this.

Copy link
Contributor

@AlexJones0 AlexJones0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall in terms of content but needs some fixes first.

doc/guide/sonata-io.md Outdated Show resolved Hide resolved
doc/guide/sonata-io.md Outdated Show resolved Hide resolved
doc/guide/sonata-io.md Outdated Show resolved Hide resolved
doc/guide/sonata-io.md Outdated Show resolved Hide resolved
doc/guide/sonata-io.md Outdated Show resolved Hide resolved
doc/guide/sonata-io.md Outdated Show resolved Hide resolved
doc/guide/sonata-io.md Outdated Show resolved Hide resolved
doc/guide/sonata-io.md Outdated Show resolved Hide resolved
doc/guide/sonata-io.md Outdated Show resolved Hide resolved
doc/guide/sonata-io.md Outdated Show resolved Hide resolved
@GregAC
Copy link
Contributor Author

GregAC commented Nov 8, 2024

Thanks for the reviews @AlexJones0 and @marnovandermaas I believe I have addressed all the comments.

The latest version also includes small new sections on the SPI CS lines and usage of `MMIO_CAPABILITY' to get access to a driver instance.

Copy link
Contributor

@AlexJones0 AlexJones0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good to me, thanks for the work on this @GregAC. Just 1 minor comment that was not quite fully addressed and this should be good to go!

Comment on lines 46 to 49
pinmux->output_pin_select(SonataPinmux::OutputPin::pmod0_1, 2);
pinmux->block_input_select(SonataPinmux::BlockInput::spi_1_cipo, 3);
pinmux->output_pin_select(SonataPinmux::OutputPin::pmod0_2, 2);
pinmux->output_pin_select(SonataPinmux::OutputPin::pmod0_4, 2);
Copy link
Contributor

@AlexJones0 AlexJones0 Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pinmux->output_pin_select(SonataPinmux::OutputPin::pmod0_1, 2);
pinmux->block_input_select(SonataPinmux::BlockInput::spi_1_cipo, 3);
pinmux->output_pin_select(SonataPinmux::OutputPin::pmod0_2, 2);
pinmux->output_pin_select(SonataPinmux::OutputPin::pmod0_4, 2);
pinmux.output_pin_select(SonataPinmux::OutputPin::pmod0_1, 2);
pinmux.block_input_select(SonataPinmux::BlockInput::spi_1_cipo, 3);
pinmux.output_pin_select(SonataPinmux::OutputPin::pmod0_2, 2);
pinmux.output_pin_select(SonataPinmux::OutputPin::pmod0_4, 2);

Still not quite correct - pinmux is now a SonataPinmux object and not a pointer, so -> usage should be replaced with .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah whoops.

Maybe I should do something radical like actually compile my code snippet and check it works...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have demonstrated this working in a test program. May add that as an example (demonstrates using the pmod SPI) but that's a job for Monday!

@GregAC GregAC merged commit 1f5f67c into lowRISC:main Nov 8, 2024
1 check passed
@GregAC GregAC deleted the sonata-io-doc branch November 8, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants