ecoAPM / SimpleGPIO

A simple, low-ceremony GPIO library for all your IoT needs
MIT License
62 stars 17 forks source link

Support more complex hardware wanted? (e.g. MFRC522 RFID Reader) #21

Open sandreas opened 2 years ago

sandreas commented 2 years ago

As a developer, I want to integrate my MFRC522 RFID Reader, so that the lib would provide a nice and clean API to this device.

First I would like to thank you for this lib, my examples are not fully working, but at least it looks promising. Are you willing to extend it to support more complex stuff? Or should this be implemented in another lib?

I'm currently trying to implement support for the MFRC522 RFID Reader, would you like me to submit a PR, if I'm done?

For more information see:

SteveDesmond-ca commented 2 years ago

💯 Thanks for your words of encouragement! SPI has been in the backlog for quite some time (#10) so this would be a good excuse to finally figure out a good abstraction API over the underlying library.

Feel free to make any suggestions as a PR, or if you wanted to create an implementation on your own and we could work together to bring it inline/upstream, I think either one of those would work.

Alternatively, I was hoping that a chunk of the backlog could get handled in the next month or so, and get a 2.0 release out the door, so if time is not if the essence, the SPI API should hopefully be settled by then.

SteveDesmond-ca commented 2 years ago

Not #10, #6; #10 depends on #6

sandreas commented 2 years ago

Hey,

well, unfortunately I'm not much into electronics, why I currently have to understand, what is happening on the hardware layer... That said, there is an abstraction of SPI in the nanoFramework:

https://docs.nanoframework.net/api/System.Device.Spi.html

And here is a pure python implementation, that may be a good base for a port: https://github.com/tkegan/python-spi/blob/master/spi.py

So maybe you could describe, what to do, how to test it and if it is only a matter of implementation, I'll take a look. Got my small dotnet 6 app working on the raspberry yesterday, so there is definetely a testing environment up and running :-)

Heres the lib I'm experimenting with currently: https://github.com/gusmanb/RaspiSharp (looks really promising)

Here is some more unfiltered research stuff:

SteveDesmond-ca commented 2 years ago

SPI Input devices have been implemented as of 2.0.0-beta.4, but we unfortunately don't have any SPI devices that output to do a final hardware test with, so this feature is blocked on that.

Commissions have now been opened to prioritize this feature: https://github.com/sponsors/ecoAPM/sponsorships?tier_id=106618&preview=false

Until then, the underlying System.Device.Gpio and System.Iot.Device libraries have an MFRC522 implementation at https://github.com/dotnet/iot/tree/main/src/devices/Mfrc522.

sandreas commented 2 years ago

This is great news. I'd be happy to be a tester for this...

Maybe I can provide some hardware I own or donate a little amount of money to help you out?