PowerShell / PowerShell-IoT

Interact with I2C, SPI & GPIO devices using PowerShell Core!
https://www.powershellgallery.com/packages/Microsoft.PowerShell.IoT
MIT License
129 stars 28 forks source link

SPI implementation #53

Open DanielSSilva opened 4 years ago

DanielSSilva commented 4 years ago

I'm opening this issue so that we can discuss the implementation of the SPI interface. I'm not familiar with this interface, but from my understanding (and from what I'm seeing on the dotnet repo), this seems that the SPI device could be created once and used many times, whereas with current implementation, each time we are sending that through SPI, we are creating a new device and then disposing it. Would it make sense to have a similar approach to what we have on I2C ? Something like

Get- SPIDevice -BusId 0 -Frequency 2400 ...
DanielSSilva commented 4 years ago

Not only that, but it seems that there are some bindings (which we might or might not end up using) that require the SPI device as a parameter

anmenaga commented 4 years ago

It is probably a good idea to make cmdlet interface for SPI similar to what we have for I2C.