-
Notifications
You must be signed in to change notification settings - Fork 3k
RTC specification (branch feature-hal-spec) #4931
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
Conversation
Add the doxygen group hal_specification as a container group for all the API specifications.
Add requirements, tests, an example implementation and additional function documentation to the HAL RTC API.
cc @bulislaw |
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.
Thanks Russ it looks great! Do you also have the porting guide chapter somewhere?
*/ | ||
void rtc_init(void); | ||
|
||
/** Deinitialize RTC | ||
* | ||
* TODO: The function is not used by rtc api in mbed-drivers. | ||
* Powerdown the RTC after in preparation for sleep, powerdown or reset. |
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.
after in preparation
That's probably wrong
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.
Yep it is. I'll fix the wording
* | ||
* # Defined behavior | ||
* * The function ::rtc_init is safe to call repeatedly - Verified by test ::rtc_init_test | ||
* * RTC accuracy is at least 10% - Not verified |
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.
Is the 10% mentioned somewhere else than in tests?
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.
Nope, just here. There should be a hal test for the eventually though
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.
Should we mention it in the PG as well so people implementing the API have better picture of what's required.
* * The function ::rtc_init is safe to call repeatedly - Verified by test ::rtc_init_test | ||
* * RTC accuracy is at least 10% - Not verified | ||
* * Init/free doesn't stop RTC from counting - Verified by test ::rtc_persist_test | ||
* * Software reset doesn't stop RTC from counting - Verified by ::rtc_reset_test |
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.
All these constraints/assumptions should be documented in main header and porting guide.
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.
The API header has example code for each function and should be embedded in the porting guide. This test header serves as additional information that will also be in the porting guide. Keeping test declarations out of the API header makes it easier to understand since all the functions in that header need to be implemented by the porter.
@@ -0,0 +1,97 @@ | |||
/* mbed Microcontroller Library |
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.
We don't usually have test headers, maybe it would make more sense to pull all the requirements to a main API header and porting guide and test case descriptions to the test c file? I think having yet another header to look at is a bit confusing.
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.
This is required to allow verification tests to be referenced from the doxygen.
Any update here , @c1728p9 ? |
I created a dedicated branch for the RTC specification and create a new PR against it. Please add further comments on PR #5008 |
Add the RTC HAL API specification along with tests which verify it.