Home
last modified time | relevance | path

Searched full:rtc (Results 1 – 25 of 968) sorted by relevance

12345678910>>...39

/Zephyr-latest/drivers/rtc/
DKconfig4 menuconfig RTC config
5 bool "Real-Time Clock (RTC) drivers"
7 Enable RTC driver configuration.
9 if RTC
11 module = RTC
12 module-str = rtc
16 int "RTC init priority"
19 RTC device driver initialization priority.
22 bool "RTC driver alarm support"
24 This is an option which enables driver support for RTC alarms.
[all …]
Drtc_ll_stm32.c17 #include <zephyr/drivers/rtc.h>
50 /* RTC start time: 1st, Jan, 2000 */
87 /* Zephyr mask supported by RTC device, values from RTC_ALARM_TIME_MASK */
102 * After system reset, the RTC registers are protected against parasitic write access by the
104 * Hence, DBP bit must be set in order to enable RTC registers write access.
148 uint32_t hour_format = LL_RTC_GetHourFormat(RTC); in rtc_stm32_configure()
149 uint32_t sync_prescaler = LL_RTC_GetSynchPrescaler(RTC); in rtc_stm32_configure()
150 uint32_t async_prescaler = LL_RTC_GetAsynchPrescaler(RTC); in rtc_stm32_configure()
152 LL_RTC_DisableWriteProtection(RTC); in rtc_stm32_configure()
154 /* configuration process requires to stop the RTC counter so do it in rtc_stm32_configure()
[all …]
/Zephyr-latest/dts/bindings/rtc/
Dnxp,rtc.yaml5 description: NXP Real Time Clock (RTC)
7 compatible: "nxp,rtc"
9 include: rtc.yaml
17 default: "RTC"
19 - "RTC"
22 Select one of two possible clock sources for the RTC:
23 * RTC: RTC prescaler increments using RTC clock.
24 * LPO: RTC prescaler increments using 1 kHz LPO.
Dst,stm32-rtc.yaml5 description: STM32 RTC
7 compatible: "st,stm32-rtc"
10 - rtc.yaml
11 - rtc-device.yaml
27 Number of alarms supported by STM32 RTC device.
28 Most of STM32 MCU series have 2 RTC alarms, A & B.
35 line connected to the RTC Alarm event.
36 Not required, since RTC Alarm interrupt could be routed directly to Nested
/Zephyr-latest/samples/drivers/rtc/src/
Dmain.c9 #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()
[all …]
/Zephyr-latest/tests/drivers/rtc/shell/src/
Dmain.c9 #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()
[all …]
/Zephyr-latest/doc/hardware/peripherals/
Drtc.rst3 Real-Time Clock (RTC)
19 * - RTC
22 An RTC is a low power device which tracks time using broken-down time.
38 between broken-down time and the unix timestamp within the RTC
63 RTC device driver test suite
66 The test suite validates the behavior of the RTC device driver. It
68 alias ``rtc`` to designate the RTC device to test.
73 * RTC Time incrementing correctly.
99 :zephyr-app: tests/drivers/rtc/rtc_api
102 To build the test with additional RTC features enabled, use menuconfig
[all …]
/Zephyr-latest/drivers/counter/
Dcounter_ll_stm32_rtc.c8 * Source file for the STM32 RTC driver
108 static inline ErrorStatus ll_func_init_alarm(RTC_TypeDef *rtc, uint32_t format, in ll_func_init_alarm() argument
112 return LL_RTC_ALARM_Init(rtc, format, alarmStruct); in ll_func_init_alarm()
114 return LL_RTC_ALMA_Init(rtc, format, alarmStruct); in ll_func_init_alarm()
118 static inline void ll_func_clear_alarm_flag(RTC_TypeDef *rtc) in ll_func_clear_alarm_flag() argument
121 LL_RTC_ClearFlag_ALR(rtc); in ll_func_clear_alarm_flag()
123 LL_RTC_ClearFlag_ALRA(rtc); in ll_func_clear_alarm_flag()
127 static inline uint32_t ll_func_is_active_alarm(RTC_TypeDef *rtc) in ll_func_is_active_alarm() argument
130 return LL_RTC_IsActiveFlag_ALR(rtc); in ll_func_is_active_alarm()
132 return LL_RTC_IsActiveFlag_ALRA(rtc); in ll_func_is_active_alarm()
[all …]
Dcounter_nrfx_rtc.c73 NRF_RTC_Type *rtc; member
87 nrfy_rtc_task_trigger(config->rtc, NRF_RTC_TASK_START); in start()
96 nrfy_rtc_task_trigger(config->rtc, NRF_RTC_TASK_STOP); in stop()
105 return nrfy_rtc_counter_get(config->rtc); in read()
167 NRFY_IRQ_PENDING_SET(NRFX_IRQ_NUMBER_GET(config->rtc)); in set_cc_int_pending()
172 * RTC will not generate event if CC value equals COUNTER+1. If such CC is
190 nrfy_rtc_cc_set(config->rtc, chan, val); in handle_next_tick_case()
192 if (nrfy_rtc_counter_get(config->rtc) != now) { in handle_next_tick_case()
195 nrfy_rtc_int_enable(config->rtc, NRF_RTC_CHANNEL_INT_MASK(chan)); in handle_next_tick_case()
207 * - RTC registers are clocked with LF clock (32kHz) and sampled between two
[all …]
DKconfig.mcux_lpc_rtc5 bool "MCUX LPC RTC driver"
10 Enable the LPC rtc driver.
13 bool "MCUX LPC RTC 1Hz counter driver"
20 bool "MCUX LPC RTC High Resolution counter driver"
24 Enable support for LPC rtc high resolution counter.
DKconfig.stm32_rtc1 # STM32 Cube LL RTC
7 bool "STM32 Counter RTC driver"
8 default y if !RTC
15 Build RTC driver for STM32 SoCs.
21 bool "Save rtc time value between resets"
31 of the counter. The frequency of the time is RTC Source Clock divided
/Zephyr-latest/include/zephyr/drivers/
Drtc.h9 * @file drivers/rtc.h
17 * @brief RTC Interface
18 * @defgroup rtc_interface RTC Interface
35 * @name RTC Alarm Time Mask
76 * @brief RTC update event callback
85 * @brief RTC alarm triggered callback
101 * @brief API for setting RTC time
107 * @brief API for getting RTC time
113 * @brief API for getting the supported fields of the RTC alarm time
120 * @brief API for setting RTC alarm time
[all …]
/Zephyr-latest/samples/drivers/rtc/
DREADME.rst1 .. zephyr:code-sample:: rtc
2 :name: Real-Time Clock (RTC)
10 This sample shows how to use the :ref:`rtc driver API <rtc_api>`
11 to set and read the date/time from RTC and display on the console
12 and can be built and executed on boards supporting RTC.
20 :zephyr-app: samples/drivers/rtc
30 RTC date and time: 2024-11-17 04:19:00
31 RTC date and time: 2024-11-17 04:19:01
/Zephyr-latest/tests/subsys/mgmt/mcumgr/os_mgmt_datetime/boards/
Dnative_sim.overlay7 rtc = &rtc;
10 rtc: rtc {
12 compatible = "zephyr,rtc-emul";
Dqemu_arc_qemu_arc_hs6x.overlay7 rtc = &rtc;
10 rtc: rtc {
12 compatible = "zephyr,rtc-emul";
Dqemu_cortex_m0.overlay7 rtc = &rtc;
10 rtc: rtc {
12 compatible = "zephyr,rtc-emul";
Dqemu_leon3.overlay7 rtc = &rtc;
10 rtc: rtc {
12 compatible = "zephyr,rtc-emul";
Dqemu_malta.overlay7 rtc = &rtc;
10 rtc: rtc {
12 compatible = "zephyr,rtc-emul";
Dqemu_riscv64.overlay7 rtc = &rtc;
10 rtc: rtc {
12 compatible = "zephyr,rtc-emul";
Dqemu_riscv64_qemu_virt_riscv64_smp.overlay7 rtc = &rtc;
10 rtc: rtc {
12 compatible = "zephyr,rtc-emul";
/Zephyr-latest/soc/nordic/nrf53/
Dsync_rtc.c17 * small and rtc synchronization process might not handle events on time.
31 uint8_t rtc; member
37 /* Algorithm for establishing RTC offset on the network side.
40 * APP starts first thus its RTC is ahead. Only network will need to adjust its
44 * using just IPC, PPI and RTC.
47 * APP: setup PPI connection from IPC_RECEIVE to RTC CAPTURE, enable interrupt
49 * NET: setup RTC CC for arbitrary offset from now, setup PPI from RTC_COMPARE to IPC_SEND
58 * NET: setup PPI from IPC_RECEIVE to RTC CAPTURE
60 * When NET RTC captures IPC event it takes CC value and knowing CC value previously
62 * to calculate exact offset between RTC counters.
[all …]
/Zephyr-latest/tests/drivers/rtc/shell/
Dtestcase.yaml2 drivers.rtc.shell:
8 - rtc
10 filter: dt_alias_exists("rtc")
11 depends_on: rtc
/Zephyr-latest/tests/drivers/rtc/rtc_api/src/
Dtest_alarm_callback.c10 #include <zephyr/drivers/rtc.h>
16 static const struct device *rtc = DEVICE_DT_GET(DT_ALIAS(rtc)); variable
17 static const uint16_t alarms_count = DT_PROP(DT_ALIAS(rtc), alarms_count);
74 ret = rtc_alarm_set_callback(rtc, i, NULL, NULL); in ZTEST()
85 ret = rtc_alarm_set_time(rtc, i, test_alarm_time_mask_set, &test_alarm_time_set); in ZTEST()
89 /* Set RTC time */ in ZTEST()
90 ret = rtc_set_time(rtc, &test_rtc_time_set); in ZTEST()
95 ret = rtc_alarm_is_pending(rtc, i); in ZTEST()
102 ret = rtc_alarm_set_callback(rtc, i, in ZTEST()
106 ret = rtc_alarm_set_callback(rtc, i, in ZTEST()
[all …]
Dtest_alarm.c10 #include <zephyr/drivers/rtc.h>
17 static const struct device *rtc = DEVICE_DT_GET(DT_ALIAS(rtc)); variable
18 static const uint16_t alarms_count = DT_PROP(DT_ALIAS(rtc), alarms_count);
78 ret = rtc_alarm_set_time(rtc, i, 0, NULL); in ZTEST()
85 ret = rtc_alarm_set_callback(rtc, i, NULL, NULL); in ZTEST()
93 ret = rtc_alarm_get_supported_fields(rtc, i, &alarm_time_mask_supported); in ZTEST()
99 ret = rtc_alarm_set_time(rtc, i, test_alarm_time_masks[j], in ZTEST()
103 "%s: RTC should reject invalid alarm %d time in field %zu.", in ZTEST()
104 rtc->name, i, j); in ZTEST()
111 ret = rtc_alarm_get_supported_fields(rtc, i, &alarm_time_mask_supported); in ZTEST()
[all …]
/Zephyr-latest/samples/boards/nuvoton/numaker/system_off/src/
Dmain.c10 #include <zephyr/drivers/rtc.h>
18 static const struct device *rtc = DEVICE_DT_GET(DT_ALIAS(rtc)); variable
28 /* Initialize RTC time to set */ in set_alarm_10s()
36 /* Set RTC time */ in set_alarm_10s()
37 ret = rtc_set_time(rtc, &time_set); in set_alarm_10s()
43 ret = rtc_alarm_set_time(rtc, 0, alarm_time_mask_set, &alarm_time_set); in set_alarm_10s()
51 const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(rtc)); in main()

12345678910>>...39