Skip to content

Use the embedded-hal::digital::v2::OutputPin traits #8

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

Merged
merged 2 commits into from
Jun 10, 2019
Merged

Use the embedded-hal::digital::v2::OutputPin traits #8

merged 2 commits into from
Jun 10, 2019

Conversation

eldruin
Copy link
Member

@eldruin eldruin commented Jun 10, 2019

I added an error enum with two types, a communication error type and a pin error type.
Now users of this crate can handle I2C or SPI communication errors as well as SPI pin setting errors.
Nevertheless, it requires no changes in the user code if the results were only unwrapped like in the examples in this crate.

In order to keep the creation infallible, I moved the chip-select high setting from the SpiInterface::new into a DisplayInterface::init() method which will be called when the user calls display.init().unwrap().

SA: rust-embedded/embedded-hal#135

Copy link
Collaborator

@jamwaffles jamwaffles 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! Tested on one of my SH1106 modules with a Blue Pill and it all looks fine to me.

@jamwaffles jamwaffles merged commit 5c7c056 into rust-embedded-community:master Jun 10, 2019
@jamwaffles
Copy link
Collaborator

Released in 0.2.0.

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.

2 participants