Skip to content

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

Closed
wants to merge 2 commits into from

Conversation

c1728p9
Copy link
Contributor

@c1728p9 c1728p9 commented Aug 17, 2017

Add the RTC HAL API specification along with tests which verify it.

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.
@c1728p9 c1728p9 changed the title Rtc specification RTC specification Aug 17, 2017
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 18, 2017

cc @bulislaw

Copy link
Member

@bulislaw bulislaw left a 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.
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Member

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
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Contributor Author

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.

@theotherjimmy theotherjimmy changed the title RTC specification RTC specification (branch feature-hal-spec) Aug 21, 2017
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 31, 2017

Any update here , @c1728p9 ?

@c1728p9
Copy link
Contributor Author

c1728p9 commented Sep 2, 2017

I created a dedicated branch for the RTC specification and create a new PR against it. Please add further comments on PR #5008

@c1728p9 c1728p9 closed this Sep 2, 2017
@sg- sg- removed the needs: work label Sep 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants