Apollo3: Implement AnalogIn and PwmOut #476
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
This PR implements ADC and PWM support for Ambiq Apollo3, rounding out the basic Mbed HALs available on this target. The HALs largely pass the Mbed CI shield compliance testing, meaning that they should work how users expect them to.
This implementation was based on the SparkFun Arduino code code found here: https://github.com/sparkfun/Arduino_Apollo3/blob/main/cores/arduino/sdk/core-implement/CommonAnalog.cpp . However, I made some improvements:
Impact of changes
Migration actions required
Documentation
Doc page created: https://mbed-ce.dev/mcu-info/AMA3B1KK/
Pull request type
Test results
I ran this PR with the CI shield PWM test. It passed except that the duty cycle accuracy is not very good -- the test expects +-0.1% but we seem to be off by 0.2% in some cases. I think this is an issue with my test setup (currently out of town so using my Windows laptop) and will keep investigating, but I don't want to hold up this PR because of it.