Add RTC module to ports/analog for MAX32690_apard #10592
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
I added a port-specific module, RTC to ports/analog. Now the analog port can handle
rtc.set_time_source()
,rtc.RTC()
andr.datetime()
. Note that the RTC calibration functions (common_hal_rtc_get_calibration()
andcommon_hal_rtc_set_calibration()
) are not implemented and are planned for the near future.The implementation in the RTC module also enables two functions in the time module, which are
time.time()
andtime.localtime()
.The following example prints the current time once per second:
The expected output is:
The following example call functions from the time module that rely on the RTC module. Successful execution confirms that the newly integrated RTC module enables these related functions in the time module.
An example of the expected output is:
Testing
After I finished implementing the module, I built and flashed the project in the
ports/analog
directory using OpenOCD with a J-Link device. After flashingfirmware.elf
to an AD-APARD32690-SL, I ran the code snippets in both code.py and REPL and received expected results.