rust-embedded / rust-embedded/linux-embedded-hal
impl embedded_hal::digital::Error for linux_embedded_hal::gpio_cdev::Error
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 319
- Forks
- 60
- Avg merge
- 12h 31m
- Merged PRs (30d)
- 1
Description
I'm trying to write an initialisation function for a driver, but the fact that the pin initialisation functions don't give me an embedded-hal Error trait is being a bit of a pain in the behind for me.
I can't properly incorperate the errors that arise when setting up gpios in my drivers error enum.
My situation is an SPI device that has two additional gpios, a reset and an interrupt pin.
This is a very hardware specific driver so the pins and spidev are created in the driver::new() function.
The linux_embedded_hal::spi::SPIError does implement embedded_hal::spi::Error so that one is fine I think.
Is this a workable idea?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating linux_embedded_hal::gpio_cdev::Error and comparing it with the existing linux_embedded_hal::spi::SPIError implementation of embedded-hal::spi::Error. Determine the requirements of embedded_hal::digital::Error, then verify that GPIO initialisation errors can be used in a driver's error enum and that the relevant checks pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100