Lines Matching full:rtc

9 #include <zephyr/drivers/rtc.h>
10 #include <zephyr/drivers/rtc/rtc_fake.h>
30 struct rtc_time rtc; member
35 static int rtc_fake_get_time_mock(const struct device *dev, struct rtc_time *rtc) in rtc_fake_get_time_mock() argument
39 *rtc = get_time_mock.rtc; in rtc_fake_get_time_mock()
43 static int rtc_fake_set_time_mock(const struct device *dev, const struct rtc_time *rtc) in rtc_fake_set_time_mock() argument
47 set_time_mock.rtc = *rtc; in rtc_fake_set_time_mock()
61 get_time_mock.rtc.tm_year = 2023 - 1900; /* rtc_time year offset */ in configure_get_time_mock()
62 get_time_mock.rtc.tm_mon = 12 - 1; /* rtc_time month offset */ in configure_get_time_mock()
63 get_time_mock.rtc.tm_mday = 24; in configure_get_time_mock()
64 get_time_mock.rtc.tm_hour = 12; in configure_get_time_mock()
65 get_time_mock.rtc.tm_min = 34; in configure_get_time_mock()
66 get_time_mock.rtc.tm_sec = 56; in configure_get_time_mock()
77 rtctime = &set_time_mock.rtc; in assert_set_time()
94 err = shell_execute_cmd(sh, "rtc get " FAKE_RTC_NAME); in ZTEST()
106 err = shell_execute_cmd(sh, "rtc get " FAKE_RTC_NAME); in ZTEST()
118 err = shell_execute_cmd(sh, "rtc get " FAKE_RTC_NAME); in ZTEST()
133 err = shell_execute_cmd(sh, "rtc set " FAKE_RTC_NAME " 2022-05-17"); in ZTEST()
137 assert_set_time(2022, 5, 17, get_time_mock.rtc.tm_hour, get_time_mock.rtc.tm_min, in ZTEST()
138 get_time_mock.rtc.tm_sec); in ZTEST()
149 err = shell_execute_cmd(sh, "rtc set " FAKE_RTC_NAME " 23:45:16"); in ZTEST()
164 err = shell_execute_cmd(sh, "rtc set " FAKE_RTC_NAME " 2022-05-17T23:45:16"); in ZTEST()
179 err = shell_execute_cmd(sh, "rtc set " FAKE_RTC_NAME " 2022:05:17T23:45:16"); in ZTEST()