wtorek, 3 kwietnia 2018 11:17:31 CEST
bob.fe...@rafresearch.com:
Good solution would probably be to pair these 2 ADCs into one single device in
fs. Just like when you open ADC1 with multiple channels you get single
"/dev/adc0" device and on read() you get struct with information what channel
that read corresponds to. In that solution you would open register ADC1 and
ADC2 into single "/dev/adc0" device and on read() you would receive
information about channel *and* adc device. That would force user to open and
close both devices at once.
While this seems good it has one big issue. It would require API changes in
ADC communication and there would be problems with ioctls - after first glance
at this, it looks impossible to implement with current API so it's rather a
no-go.
Well, looks like noone came up with any good solution to fix this and since
this is big issue I would suggest adding #error or at least #warning if
someone enables two or more ADCs with same RST pin. It doesn't really work
anyway (not without hacks in stm32_adc.c driver) so it shouldn't be possible
to set such configuration.
Thoughts?
--
Best regards
Łyszczek Michał