Commit Graph

4 Commits

Author SHA1 Message Date
Bjarki Arge Andreasen
1fc26b8974 drivers: rtc: api: Add helper for determining calibration
Add helper function which calculates the required calibration to
1 Hertz from the actual frequency of an RTC. This helper is both
functional and adds to the documentation of the RTC calibration
API.

The rtc.h header now includes zephyr/kernel.h instead of
zephyr/types.h as __ASSERT_NO_MSG is now referenced in the header.

The commit additionally extends the rtc_api_helpers test suite
with a test to validate the conversion function itself.

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-06-18 14:35:55 -04:00
Florian Grandel
78dc3950dc tests: drivers: rtc: zassert_true -> zassert_equal
Using the more specialized zassert_equal() macro where appropriate.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-12 09:26:16 +02:00
Anas Nashif
fc249bdda0 tests: rtc: fix test identifier
Tests need to be prefixed with test_.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-21 01:43:17 +09:00
Bjarki Arge Andreasen
8da512a25b tests/drivers/rtc: Add rtc_api_helpers test suite
This test suite validates the RTC API helper
functions, like currently, and exclusively, the
rtc_time_to_tm() helper function.

It also validates that the struct rtc_time is
member to member compatible with the struct tm
from the tm_sec to and including the tm_isdts
member.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-04-04 17:03:38 +02:00