Giter Club home page Giter Club logo

cd74hc4067-rs's Introduction

Hello ๐Ÿ‘‹

I'm a software dev interested in robust systems software that is also fun to work on :)
Currently, working as a Rust Developer. Also, I have a number of personal projects ongoing...

๐Ÿ”ญ


I like working on things that do stuff. Currently a dodecahedron infinity light, air quality sensor, and autonomous mini sailboat.
Also, sometimes I make low-hanging-fruit changes to Rust libraries (just clippy lint fixes, tests, formatting, that kind of stuff).


If you want to ๐Ÿ’ฌ, send me a ๐Ÿ“ซ!




cd74hc4067-rs's People

Contributors

barafael avatar marius-meissner avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

marius-meissner

cd74hc4067-rs's Issues

Dropped pins in case of enable/disable error

Thank you for this neat crate, especially with the good test coverage and the typestate implementation.

As the enable/disable functions are consuming, the struct including the pins is dropped:

pub fn enable(mut self) -> Result<Cd74hc4067<P, E, EnabledState>, Error<P, E>> {

However, this can be a problem for some systems that operate a singleton principle for GPIO pins. On such systems, it is only possible to obtain a pin instance once. An example of this is the RP2040 HAL:

It is not possible for users to create new instances of a Pin. Singleton instances of each pin are made available to users through the Pins struct.

Of course, there are workaround (e.g. wrapped pins with internal reference), but that would be very inconvenient and not elegant.

I see two possible solutions in case of an error:

  1. Releasing the internal pins as part of the Error enum
  2. Return a tuple containing the error + struct with the old state

Personally, I tend towards the second solution
What do you think?

Looking forward to your feedback.

PS: If desired, I can also support with an appropriate PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.