Lines Matching full:rtc
9 #include <zephyr/drivers/rtc.h>
12 const struct device *const rtc = DEVICE_DT_GET(DT_ALIAS(rtc)); variable
14 static int set_date_time(const struct device *rtc) in set_date_time() argument
26 ret = rtc_set_time(rtc, &tm); in set_date_time()
34 static int get_date_time(const struct device *rtc) in get_date_time() argument
39 ret = rtc_get_time(rtc, &tm); in get_date_time()
45 printk("RTC date and time: %04d-%02d-%02d %02d:%02d:%02d\n", tm.tm_year + 1900, in get_date_time()
53 /* Check if the RTC is ready */ in main()
54 if (!device_is_ready(rtc)) { in main()
59 set_date_time(rtc); in main()
61 /* Continuously read the current date and time from the RTC */ in main()
62 while (get_date_time(rtc) == 0) { in main()