Skip to content

RTC API refine documentation and test coverage #56584

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

Merged

Conversation

bjarki-andreasen
Copy link
Collaborator

@bjarki-andreasen bjarki-andreasen commented Apr 5, 2023

This PR is based on the remaining comments from @nordicjm on this PR #52618

The PR performs the following

  • Updates the release notes to mention the addition of the experimental RTC API
  • Opens up the RTC API helpers test suite to more test platforms,
  • Makes RTC API test suite run for native_posix and native_posix_64
  • Performs some general refinement of the doxygen documentation for the rtc.h header, and the rtc.rst documentation.
  • Makes the alarms-count dts property optional, with a default value of 0, instead of required.

@bjarki-andreasen bjarki-andreasen force-pushed the rtc_api_refine_docs branch 2 times, most recently from 1aaad4f to dfcf5bd Compare April 5, 2023 18:29
@bjarki-andreasen bjarki-andreasen marked this pull request as ready for review April 5, 2023 19:15
@zephyrbot zephyrbot added Release Notes To be mentioned in the release notes area: RTC Real Time Clock area: Devicetree Binding PR modifies or adds a Device Tree binding area: native port Host native arch port (native_sim) area: Documentation labels Apr 5, 2023
@zephyrbot zephyrbot requested a review from kartben April 5, 2023 19:16
@bjarki-andreasen bjarki-andreasen changed the title RTC API refine documentation RTC API refine documentation and test coverage Apr 5, 2023
functions :c:func:`rtc_set_time` and :c:func:`rtc_get_time`, the optional functions
:c:func:`rtc_alarm_get_supported_fields`, :c:func:`rtc_alarm_set_time`,
:c:func:`rtc_alarm_get_time`, :c:func:`rtc_alarm_is_pending` and
:c:func:`rtc_alarm_set_callback` enabled by :kconfig:option:`CONFIG_RTC_ALARM`,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:c:func:`rtc_alarm_set_callback` enabled by :kconfig:option:`CONFIG_RTC_ALARM`,
:c:func:`rtc_alarm_set_callback` are enabled with :kconfig:option:`CONFIG_RTC_ALARM`,

:c:func:`rtc_alarm_get_supported_fields`, :c:func:`rtc_alarm_set_time`,
:c:func:`rtc_alarm_get_time`, :c:func:`rtc_alarm_is_pending` and
:c:func:`rtc_alarm_set_callback` enabled by :kconfig:option:`CONFIG_RTC_ALARM`,
theoptional function :c:func:`rtc_update_set_callback` enabled by
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
theoptional function :c:func:`rtc_update_set_callback` enabled by
the optional function :c:func:`rtc_update_set_callback` is enabled with

:c:func:`rtc_alarm_set_callback` enabled by :kconfig:option:`CONFIG_RTC_ALARM`,
theoptional function :c:func:`rtc_update_set_callback` enabled by
:kconfig:option:`CONFIG_RTC_UPDATE` and lastly the optional functions
:c:func:`rtc_set_calibration` and :c:func:`rtc_get_calibration` enabled by
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:c:func:`rtc_set_calibration` and :c:func:`rtc_get_calibration` enabled by
:c:func:`rtc_set_calibration` and :c:func:`rtc_get_calibration` are enabled with

@@ -8,6 +8,6 @@ description: RTC device common bindings
properties:
alarms-count:
type: int
required: true
default: 0
description: |
Number of alarms supported by RTC device
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a description for a default, something like "Default of 0 to indicate that unless set otherwise, the RTC has no alarms"

nordicjm
nordicjm previously approved these changes Apr 11, 2023
jhedberg
jhedberg previously approved these changes Apr 19, 2023
$ west build -p -b <your board> zephyr/tests/drivers/rtc/rtc_api/
west build -p -b <your board> zephyr/tests/drivers/rtc/rtc_api/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be using zephyr-app-commands:: here.

$ west build -p -b <your board> -t menuconfig zephyr/tests/drivers/rtc/rtc_api/
west build -p -b <your board> -t menuconfig zephyr/tests/drivers/rtc/rtc_api/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

$ west build
west build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too.

Bjarki Arge Andreasen added 2 commits April 20, 2023 10:07
Fixed spelling mistakes, added links in place of
highlighted text where appropriate and switched
unformatted blocks with bash commands to bash
code blocks.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
Added entry for new RTC API in new APIs section of
release notes.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
Bjarki Arge Andreasen added 3 commits April 20, 2023 10:07
Hid type definitions of API functions from documentation
using INTERNAL_HIDDEN condition.

Changed nested groups inside rtc_interface group to use
@name instead.

Use @anchor to reference definitions for
RTC_ALARM_TIME_MASK.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
The test suite was limited to the native_posix board,
now it is built and run for any board supported by CI.

The native_posix yaml files for both 32 and 64 bit
boards have been expanded to support rtc, allowing CI
to build and test the rtc_api test suite against the
native_posix and native_posix_64 boards.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
This commit makes the alarms-count dts property of the
rtc-device.yaml optional, setting the default to 0.

This simplifies the dts rtc dts node by not requiring
the property to be set to 0 if it is not supported.

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
@carlescufi carlescufi merged commit 9eae6fd into zephyrproject-rtos:main Apr 20, 2023
@bjarki-andreasen bjarki-andreasen deleted the rtc_api_refine_docs branch April 20, 2023 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree Binding PR modifies or adds a Device Tree binding area: Documentation area: native port Host native arch port (native_sim) area: RTC Real Time Clock Release Notes To be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants