zephyrproject-rtos / gsoc-2022-arduino-core

Arduino Core Zephyr Module (GSoC 2022 Project)
Apache License 2.0
43 stars 11 forks source link

zephyrCommon: Implement analogRead()/analogReference() #54

Closed soburi closed 1 year ago

soburi commented 1 year ago

The 'io-channels' node under the 'zephyr,user' defines available ADC channels.

The 'io-channel-pins' defines the mapping of ADC channels to pin numbers. API looks up the 'io-channel-pins' when querying the ADC channel by digital pin number. So it should be in the same order as 'io-channels' node.

For original Arduino API compatibility, ADC resolution should configure as 10-bit.

ADC that is on MCU supported by Zephyr exists only 16-bit resolution currently. So it supports resolutions up to 16-bit.

Signed-off-by: TOKITA Hiroshi tokita.hiroshi@fujitsu.com

soburi commented 1 year ago

@DhruvaG2000 Rebase to newest main branch done. Could you please review again?

DhruvaG2000 commented 1 year ago

Code looks good, but let me test this patch on real hardware before approving and merging.

soburi commented 1 year ago

Code looks good, but let me test this patch on real hardware before approving and merging.

Okay, No need to hurry