-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
drivers: adc: adc_sam0: rework devicetree support #24789
Conversation
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
Rework the devicetree to utilize new DT_INST macros and extract per instance data for clocks from devicetree. We add a property ('calib-offset') for the SAM{D,E}5x family of SoCs that is the bit position offset from ADC0 BIASCOMP in the NVM Software Calibration Area Mapping. For ADC0 this is typically 0 and for ADC1 this will be 14. Signed-off-by: Kumar Gala <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me.
Tested and verified working on atsamd21_xpro
:
Running test suite adc_basic_test
===================================================================
starting test - test_adc_sample_one_channel
Samples read: 0x0d3c 0x0000 0x0000 0x0000 0x0000 0x0000
PASS - test_adc_sample_one_channel
===================================================================
starting test - test_adc_sample_two_channels
SKIP - test_adc_sample_two_channels
===================================================================
starting test - test_adc_asynchronous_call
Samples read: 0x0d3b 0x0d3a 0x0d38 0x0d3b 0x0d3e 0x0000
PASS - test_adc_asynchronous_call
===================================================================
starting test - test_adc_sample_with_interval
sample_with_interval_callback: sampling 0
sample_with_interval_callback: sampling 1
sample_with_interval_callback: sampling 2
sample_with_interval_callback: sampling 3
sample_with_interval_callback: sampling 4
Samples read: 0x0d35 0x0d36 0x0d34 0x0d33 0x0d37 0x0000
PASS - test_adc_sample_with_interval
===================================================================
starting test - test_adc_repeated_samplings
repeated_samplings_callback: done 1
Samples read: 0x0d38 0x0000 0x0000 0x0000 0x0000 0x0000
repeated_samplings_callback: done 2
Samples read: 0x0d38 0x0d2b 0x0000 0x0000 0x0000 0x0000
repeated_samplings_callback: done 3
Samples read: 0x0d2c 0x0d2b 0x0000 0x0000 0x0000 0x0000
repeated_samplings_callback: done 4
Samples read: 0x0d2a 0x0d2b 0x0000 0x0000 0x0000 0x0000
repeated_samplings_callback: done 5
Samples read: 0x0d2a 0x0d2b 0x0000 0x0000 0x0000 0x0000
repeated_samplings_callback: done 6
Samples read: 0x0d26 0x0d2b 0x0000 0x0000 0x0000 0x0000
repeated_samplings_callback: done 7
Samples read: 0x0d25 0x0d2b 0x0000 0x0000 0x0000 0x0000
repeated_samplings_callback: done 8
Samples read: 0x0d2c 0x0d2b 0x0000 0x0000 0x0000 0x0000
repeated_samplings_callback: done 9
Samples read: 0x0d27 0x0d2b 0x0000 0x0000 0x0000 0x0000
repeated_samplings_callback: done 10
Samples read: 0x0d26 0x0d2b 0x0000 0x0000 0x0000 0x0000
PASS - test_adc_repeated_samplings
===================================================================
starting test - test_adc_invalid_request
E: ADC resolution value 0 is not valid
E: ADC resolution value 0 is not valid
Samples read: 0x0d37 0x0000 0x0000 0x0000 0x0000 0x0000
PASS - test_adc_invalid_request
===================================================================
Test suite adc_basic_test succeeded
===================================================================
PROJECT EXECUTION SUCCESSFUL
As for atsame54_xpro
, tests/drivers/adc/adc_api
hangs, but that also happens on master, so the problem was not introduced by this PR.
Rework the devicetree to utilize new DT_INST macros and extract per
instance data for clocks from devicetree.
We add a property ('calib-offset') for the SAM{D,E}5x family of SoCs
that is the bit position offset from ADC0 BIASCOMP in the NVM Software
Calibration Area Mapping. For ADC0 this is typically 0 and for ADC1
this will be 14.
Signed-off-by: Kumar Gala [email protected]