-
Notifications
You must be signed in to change notification settings - Fork 590
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
Add System.Device.Adc.{AdcChannel, AdcChannelMode, AdcController} and port Mcp3008 device binding to new surface area #90
Comments
@joperezr would you be interested in picking this one up next? |
I was planning on working on testing infrastructure next, but I can also do this one instead. |
This might help... [Proposal] Provide interfaces for different controllers |
ADS1115 is also in progress: #191 Might be worth taking a closer look soon and convert stuff like FSR to use generic ADC |
The thing about this is that technically ADC is not really a communication protocol, so I'm not so sure if the right place for this would be the main library with a namespace like System.Device.Adc. IMO, this is something that should probably live on the device bidnings package instead, perhaps some sort of interface that all ADCs need to implement. |
@joperezr ADC is a device so System.Device sounds like a good place 😄 |
For the namespace we’ve been using System.Device.{CommunicationProtocol} Where Communication protocol is a Device protocol. We currently have Gpio, Pwm, I2c, and Spi. That means that this would be the first namespace where the third part of it is not a protocol. For device bindings. We have been using Iot.Device instead, so this would probably be something like Iot.Device.Adc |
@joperezr so are you suggesting not having System.Device.Adc in core API similar to System.Device.Gpio/I2c/Spi/Pwm? If so, I disagree as there are dev boards that have true ADC pins (like BeagleBoard Black). We should have similar classes/interfaces for controllers/drivers as we're doing with Gpio/Pwm. Therefore, dev boards and bindings could implement them. For example, the Mcp3008 could also implement IAdcController like Mcp23xxx implements IGpioController. If I misunderstood you.... then disregard 😕 |
I think we should not think that much about how to package this yet and rather what abstraction is useful right now. Once we are closer to shipping then we have more conversations of what to put where (and it makes sense to put pure abstraction in different place than implementation) but I think we still got some time until then and as long APIs are experimental it is easier to put them in one bag for now. |
I see, I actually wasn't aware that there are some devices that have pins for this particular pourpose which then does mean that it would make sense to have this on the main library. In any case, as @krwq says, I think that because of what @shaggygi brings up it would be fine to put the implementation on the main library for now, and move it later if we don't think it should be there once shipping is close. |
That would be really good to have an IAdcController interface like the IGpioController one. I would be able to implement both on the GrovePi (see #246) to be used fully transparently as a both devices. that would simplify how to create some basic sensors like basic buttons, basic analogic sound sensors, etc. |
@joperezr my thinking is we could use https://docs.microsoft.com/en-us/uwp/api/windows.devices.adc.adccontroller as inspiration for an IAdcController |
We are currently questioning if we should have these interface. For things which take ADC as an input we think the users should use We would need to see some specific examples to see what problems it would solve to have them. I haven't personally had much chance playing with ADC to think of any so would be useful for someone who has to provide something. |
All ADC are measuring in byte, int, long or equivalent (some can be negative as well). They all have a reference ADC which can be as well one of those. |
[Triage] All the ADC MCPxxxx bindings has been moved under the System.Device.Adc namespace: https://github.com/dotnet/iot/tree/main/src/devices/Mcp3xxx |
We need to standardize ADC device binding APIs, using Windows.Devices.Adc as a starting point, and update the 10-bit ADC Mcp3008 device binding accordingly.
https://docs.microsoft.com/en-us/uwp/api/windows.devices.adc.adccontroller
https://github.com/dotnet/iot/tree/master/src/devices/Mcp3008
The text was updated successfully, but these errors were encountered: