Home
last modified time | relevance | path

Searched refs:alarm_cfg (Results 1 – 25 of 42) sorted by relevance

12

/Zephyr-Core-3.7.0/drivers/counter/
Dcounter_esp32_rtc.c49 struct counter_alarm_cfg alarm_cfg; member
104 const struct counter_alarm_cfg *alarm_cfg) in counter_esp32_set_alarm() argument
113 if (counter_ticks_to_us(dev, alarm_cfg->ticks) < 30) { in counter_esp32_set_alarm()
117 data->alarm_cfg.callback = alarm_cfg->callback; in counter_esp32_set_alarm()
118 data->alarm_cfg.user_data = alarm_cfg->user_data; in counter_esp32_set_alarm()
122 ticks = (alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) ? alarm_cfg->ticks in counter_esp32_set_alarm()
123 : now + alarm_cfg->ticks; in counter_esp32_set_alarm()
226 if (data->alarm_cfg.callback) { in counter_esp32_isr()
227 data->alarm_cfg.callback(dev, 0, now, data->alarm_cfg.user_data); in counter_esp32_isr()
Dcounter_esp32_tmr.c56 struct counter_alarm_cfg alarm_cfg; member
83 data->alarm_cfg.callback = NULL; in counter_esp32_init()
135 const struct counter_alarm_cfg *alarm_cfg) in counter_esp32_set_alarm() argument
145 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) == 0) { in counter_esp32_set_alarm()
147 (now + alarm_cfg->ticks)); in counter_esp32_set_alarm()
150 alarm_cfg->ticks); in counter_esp32_set_alarm()
155 data->alarm_cfg.callback = alarm_cfg->callback; in counter_esp32_set_alarm()
156 data->alarm_cfg.user_data = alarm_cfg->user_data; in counter_esp32_set_alarm()
223 if (data->alarm_cfg.callback) { in counter_esp32_isr()
224 data->alarm_cfg.callback(dev, 0, now, data->alarm_cfg.user_data); in counter_esp32_isr()
Dcounter_timer_shell.c98 struct counter_alarm_cfg alarm_cfg; in cmd_timer_oneshot() local
126 alarm_cfg.flags = 0; in cmd_timer_oneshot()
127 alarm_cfg.ticks = counter_us_to_ticks(timer_dev, (uint64_t)delay); in cmd_timer_oneshot()
128 alarm_cfg.callback = timer_alarm_handler; in cmd_timer_oneshot()
129 alarm_cfg.user_data = NULL; in cmd_timer_oneshot()
132 err = counter_set_channel_alarm(timer_dev, (uint8_t)channel, &alarm_cfg); in cmd_timer_oneshot()
Dcounter_gecko_stimer.c176 const struct counter_alarm_cfg *alarm_cfg) in counter_gecko_set_alarm() argument
184 if ((top_val != 0) && (alarm_cfg->ticks > top_val)) { in counter_gecko_set_alarm()
198 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) != 0) { in counter_gecko_set_alarm()
201 if (now_ticks < alarm_cfg->ticks) { in counter_gecko_set_alarm()
202 dev_data->alarm[chan_id].ticks = top_val + (alarm_cfg->ticks - now_ticks); in counter_gecko_set_alarm()
205 (top_val - (now_ticks - alarm_cfg->ticks)) % top_val; in counter_gecko_set_alarm()
210 dev_data->alarm[chan_id].ticks = alarm_cfg->ticks; in counter_gecko_set_alarm()
213 dev_data->alarm[chan_id].callback = alarm_cfg->callback; in counter_gecko_set_alarm()
216 dev_data->alarm[chan_id].user_data = (struct counter_alarm_cfg *)alarm_cfg; in counter_gecko_set_alarm()
Dcounter_ambiq_timer.c147 const struct counter_alarm_cfg *alarm_cfg) in counter_ambiq_set_alarm() argument
162 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) == 0) { in counter_ambiq_set_alarm()
164 now + alarm_cfg->ticks); in counter_ambiq_set_alarm()
166 am_hal_ctimer_compare_set(cfg->instance, AM_HAL_CTIMER_BOTH, 0, alarm_cfg->ticks); in counter_ambiq_set_alarm()
173 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) == 0) { in counter_ambiq_set_alarm()
174 am_hal_timer_compare1_set(cfg->instance, now + alarm_cfg->ticks); in counter_ambiq_set_alarm()
176 am_hal_timer_compare1_set(cfg->instance, alarm_cfg->ticks); in counter_ambiq_set_alarm()
180 data->user_data = alarm_cfg->user_data; in counter_ambiq_set_alarm()
181 data->callback = alarm_cfg->callback; in counter_ambiq_set_alarm()
Dcounter_gecko_rtcc.c151 const struct counter_alarm_cfg *alarm_cfg) in counter_gecko_set_alarm() argument
158 if ((top_value != 0) && (alarm_cfg->ticks > top_value)) { in counter_gecko_set_alarm()
165 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) != 0) { in counter_gecko_set_alarm()
166 ccv = alarm_cfg->ticks; in counter_gecko_set_alarm()
169 ccv = count + alarm_cfg->ticks; in counter_gecko_set_alarm()
171 uint64_t ccv64 = count + alarm_cfg->ticks; in counter_gecko_set_alarm()
181 dev_data->alarm[chan_id].callback = alarm_cfg->callback; in counter_gecko_set_alarm()
182 dev_data->alarm[chan_id].user_data = alarm_cfg->user_data; in counter_gecko_set_alarm()
Dcounter_rpi_pico_timer.c76 const struct counter_alarm_cfg *alarm_cfg) in counter_rpi_pico_timer_set_alarm() argument
81 uint64_t target = (alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) ? 0 : alarm_cfg->ticks; in counter_rpi_pico_timer_set_alarm()
87 if (alarm_cfg->ticks > counter_rpi_pico_timer_get_top_value(dev)) { in counter_rpi_pico_timer_set_alarm()
95 chdata->callback = alarm_cfg->callback; in counter_rpi_pico_timer_set_alarm()
96 chdata->user_data = alarm_cfg->user_data; in counter_rpi_pico_timer_set_alarm()
101 if (alarm_cfg->flags & COUNTER_ALARM_CFG_EXPIRE_WHEN_LATE) { in counter_rpi_pico_timer_set_alarm()
Dcounter_mchp_xec.c111 const struct counter_alarm_cfg *alarm_cfg) in counter_xec_set_alarm() argument
124 if (alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) { in counter_xec_set_alarm()
132 if (!alarm_cfg->callback) { in counter_xec_set_alarm()
136 if (alarm_cfg->ticks > counter->PRLD) { in counter_xec_set_alarm()
140 counter->CNT = alarm_cfg->ticks; in counter_xec_set_alarm()
142 data->alarm_cb = alarm_cfg->callback; in counter_xec_set_alarm()
143 data->user_data = alarm_cfg->user_data; in counter_xec_set_alarm()
147 LOG_DBG("%p Counter alarm set to %u ticks", dev, alarm_cfg->ticks); in counter_xec_set_alarm()
Dcounter_mcux_snvs.c73 const struct counter_alarm_cfg *alarm_cfg) in mcux_snvs_set_alarm() argument
81 ticks = alarm_cfg->ticks; in mcux_snvs_set_alarm()
83 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) == 0) { in mcux_snvs_set_alarm()
96 data->alarm_hp_rtc_callback = alarm_cfg->callback; in mcux_snvs_set_alarm()
97 data->alarm_hp_rtc_user_data = alarm_cfg->user_data; in mcux_snvs_set_alarm()
115 data->alarm_lp_srtc_callback = alarm_cfg->callback; in mcux_snvs_set_alarm()
116 data->alarm_lp_srtc_user_data = alarm_cfg->user_data; in mcux_snvs_set_alarm()
Dcounter_sam_tc.c133 const struct counter_alarm_cfg *alarm_cfg) in counter_sam_tc_set_alarm() argument
142 __ASSERT_NO_MSG(alarm_cfg->callback != NULL); in counter_sam_tc_set_alarm()
146 if ((top_value != 0) && (alarm_cfg->ticks > top_value)) { in counter_sam_tc_set_alarm()
151 if ((top_value == 0) && (alarm_cfg->ticks > UINT16_MAX)) { in counter_sam_tc_set_alarm()
166 data->alarm[chan_id].callback = alarm_cfg->callback; in counter_sam_tc_set_alarm()
167 data->alarm[chan_id].user_data = alarm_cfg->user_data; in counter_sam_tc_set_alarm()
169 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) != 0) { in counter_sam_tc_set_alarm()
170 alarm_value = alarm_cfg->ticks; in counter_sam_tc_set_alarm()
172 alarm_value = tc_ch->TC_CV + alarm_cfg->ticks; in counter_sam_tc_set_alarm()
Dcounter_dw_timer.c216 const struct counter_alarm_cfg *alarm_cfg) in counter_dw_timer_set_alarm() argument
223 if (alarm_cfg == NULL) { in counter_dw_timer_set_alarm()
229 if (!alarm_cfg->callback) { in counter_dw_timer_set_alarm()
237 if (alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) { in counter_dw_timer_set_alarm()
251 data->alarm_cb = alarm_cfg->callback; in counter_dw_timer_set_alarm()
252 data->prv_data = alarm_cfg->user_data; in counter_dw_timer_set_alarm()
260 sys_write32(alarm_cfg->ticks, reg_base + LOADCOUNT_OFST); in counter_dw_timer_set_alarm()
Dcounter_native_posix.c180 const struct counter_alarm_cfg *alarm_cfg) in ctr_set_alarm() argument
187 uint32_t ticks = alarm_cfg->ticks; in ctr_set_alarm()
195 if (!(alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE)) { in ctr_set_alarm()
204 pending_alarm[chan_id] = *alarm_cfg; in ctr_set_alarm()
Dcounter_mcux_gpt.c73 const struct counter_alarm_cfg *alarm_cfg) in mcux_gpt_set_alarm() argument
79 uint32_t ticks = alarm_cfg->ticks; in mcux_gpt_set_alarm()
86 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) == 0) { in mcux_gpt_set_alarm()
94 data->alarm_callback = alarm_cfg->callback; in mcux_gpt_set_alarm()
95 data->alarm_user_data = alarm_cfg->user_data; in mcux_gpt_set_alarm()
Dcounter_mcux_ctimer.c95 const struct counter_alarm_cfg *alarm_cfg) in mcux_lpc_ctimer_set_alarm() argument
99 uint32_t ticks = alarm_cfg->ticks; in mcux_lpc_ctimer_set_alarm()
103 if (alarm_cfg->ticks > top) { in mcux_lpc_ctimer_set_alarm()
112 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) == 0) { in mcux_lpc_ctimer_set_alarm()
119 data->channels[chan_id].alarm_callback = alarm_cfg->callback; in mcux_lpc_ctimer_set_alarm()
120 data->channels[chan_id].alarm_user_data = alarm_cfg->user_data; in mcux_lpc_ctimer_set_alarm()
Dcounter_mcux_rtc.c94 const struct counter_alarm_cfg *alarm_cfg) in mcux_rtc_set_alarm() argument
101 uint32_t ticks = alarm_cfg->ticks; in mcux_rtc_set_alarm()
115 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) == 0) { in mcux_rtc_set_alarm()
124 data->alarm_callback = alarm_cfg->callback; in mcux_rtc_set_alarm()
125 data->alarm_user_data = alarm_cfg->user_data; in mcux_rtc_set_alarm()
Dcounter_nxp_s32_sys_timer.c68 const struct counter_alarm_cfg *alarm_cfg) in nxp_s32_sys_timer_set_alarm() argument
73 uint32_t ticks = alarm_cfg->ticks; in nxp_s32_sys_timer_set_alarm()
84 ch_data->callback = alarm_cfg->callback; in nxp_s32_sys_timer_set_alarm()
85 ch_data->user_data = alarm_cfg->user_data; in nxp_s32_sys_timer_set_alarm()
90 if (alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) { in nxp_s32_sys_timer_set_alarm()
Dcounter_sam0_tc32.c183 const struct counter_alarm_cfg *alarm_cfg) in counter_sam0_tc32_set_alarm() argument
191 if (alarm_cfg->ticks > tc->CC[0].reg) { in counter_sam0_tc32_set_alarm()
202 data->ch.callback = alarm_cfg->callback; in counter_sam0_tc32_set_alarm()
203 data->ch.user_data = alarm_cfg->user_data; in counter_sam0_tc32_set_alarm()
205 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) != 0) { in counter_sam0_tc32_set_alarm()
206 tc->CC[1].reg = alarm_cfg->ticks; in counter_sam0_tc32_set_alarm()
211 counter_sam0_tc32_relative_alarm(dev, alarm_cfg->ticks); in counter_sam0_tc32_set_alarm()
/Zephyr-Core-3.7.0/samples/drivers/counter/alarm/src/
Dmain.c16 struct counter_alarm_cfg alarm_cfg; variable
111 alarm_cfg.flags = 0; in main()
112 alarm_cfg.ticks = counter_us_to_ticks(counter_dev, DELAY); in main()
113 alarm_cfg.callback = test_counter_interrupt_fn; in main()
114 alarm_cfg.user_data = &alarm_cfg; in main()
117 &alarm_cfg); in main()
120 alarm_cfg.ticks) / USEC_PER_SEC), in main()
121 alarm_cfg.ticks); in main()
/Zephyr-Core-3.7.0/tests/drivers/counter/maxim_ds3231_api/src/
Dtest_counter.c24 struct counter_alarm_cfg alarm_cfg; variable
225 zassert_true(&alarm_cfg == user_data, in alarm_handler()
249 alarm_cfg.flags = 0; in test_single_shot_alarm_instance()
250 alarm_cfg.callback = alarm_handler; in test_single_shot_alarm_instance()
251 alarm_cfg.user_data = &alarm_cfg; in test_single_shot_alarm_instance()
269 alarm_cfg.ticks = ticks + 1; in test_single_shot_alarm_instance()
270 err = counter_set_channel_alarm(dev, 0, &alarm_cfg); in test_single_shot_alarm_instance()
274 alarm_cfg.ticks = ticks - 1; in test_single_shot_alarm_instance()
277 alarm_cfg.ticks = ticks; in test_single_shot_alarm_instance()
278 err = counter_set_channel_alarm(dev, 0, &alarm_cfg); in test_single_shot_alarm_instance()
[all …]
/Zephyr-Core-3.7.0/samples/boards/mimxrt595_evk/system_off/src/
Dmain.c17 struct counter_alarm_cfg alarm_cfg = { 0 }; in main() local
30 alarm_cfg.ticks = counter_us_to_ticks(dev, 10 * USEC_PER_SEC); in main()
32 ret = counter_set_channel_alarm(dev, 0, &alarm_cfg); in main()
/Zephyr-Core-3.7.0/drivers/watchdog/
Dwdt_andes_atcwdt200.c83 struct counter_alarm_cfg alarm_cfg; variable
111 counter_set_channel_alarm(counter_dev, 2, &alarm_cfg); in wdt_counter_cb()
132 alarm_cfg.flags = 0; in wdt_atcwdt200_set_max_timeout()
133 alarm_cfg.callback = wdt_counter_cb; in wdt_atcwdt200_set_max_timeout()
134 alarm_cfg.user_data = &alarm_cfg; in wdt_atcwdt200_set_max_timeout()
135 alarm_cfg.ticks = ((WDOGCFG_PERIOD_MAX * counter_freq) / EXT_CLOCK_FREQ) >> 1; in wdt_atcwdt200_set_max_timeout()
195 ret = counter_set_channel_alarm(pit_counter_dev, 2, &alarm_cfg); in wdt_atcwdt200_setup()
269 alarm_cfg.flags = 0; in wdt_atcwdt200_install_timeout()
270 alarm_cfg.callback = wdt_counter_cb; in wdt_atcwdt200_install_timeout()
271 alarm_cfg.user_data = &alarm_cfg; in wdt_atcwdt200_install_timeout()
[all …]
/Zephyr-Core-3.7.0/tests/drivers/counter/counter_basic_api/src/
Dtest_counter.c685 struct counter_alarm_cfg alarm_cfg = { in test_late_alarm_instance() local
701 alarm_cfg.ticks = 0; in test_late_alarm_instance()
702 err = counter_set_channel_alarm(dev, 0, &alarm_cfg); in test_late_alarm_instance()
714 err = counter_get_value(dev, &(alarm_cfg.ticks)); in test_late_alarm_instance()
718 err = counter_set_channel_alarm(dev, 0, &alarm_cfg); in test_late_alarm_instance()
737 struct counter_alarm_cfg alarm_cfg = { in test_late_alarm_error_instance() local
752 alarm_cfg.ticks = 0; in test_late_alarm_error_instance()
753 err = counter_set_channel_alarm(dev, 0, &alarm_cfg); in test_late_alarm_error_instance()
758 err = counter_get_value(dev, &(alarm_cfg.ticks)); in test_late_alarm_error_instance()
762 err = counter_set_channel_alarm(dev, 0, &alarm_cfg); in test_late_alarm_error_instance()
[all …]
/Zephyr-Core-3.7.0/subsys/testsuite/busy_sim/
Dbusy_sim.c21 struct counter_alarm_cfg alarm_cfg; member
106 data->alarm_cfg.ticks = get_timeout(true); in counter_alarm_callback()
125 err = counter_set_channel_alarm(config->counter, 0, &data->alarm_cfg); in counter_alarm_callback()
148 data->alarm_cfg.ticks = counter_us_to_ticks(config->counter, 100); in busy_sim_start()
149 err = counter_set_channel_alarm(config->counter, 0, &data->alarm_cfg); in busy_sim_start()
199 data->alarm_cfg.callback = counter_alarm_callback; in busy_sim_init()
200 data->alarm_cfg.flags = COUNTER_ALARM_CFG_EXPIRE_WHEN_LATE; in busy_sim_init()
/Zephyr-Core-3.7.0/samples/boards/mimxrt1060_evk/system_off/src/
Dmain.c73 const struct counter_alarm_cfg alarm_cfg = { in main() local
78 ret = counter_set_channel_alarm(snvs_rtc_dev, SNVS_LP_RTC_ALARM_ID, &alarm_cfg); in main()
84 counter_ticks_to_us(snvs_rtc_dev, alarm_cfg.ticks) / (1000ULL * 1000ULL)); in main()
/Zephyr-Core-3.7.0/drivers/timer/
Dmcux_os_timer.c99 struct counter_alarm_cfg alarm_cfg; in mcux_lpc_ostick_set_counter_timeout() local
101 alarm_cfg.ticks = ticks; in mcux_lpc_ostick_set_counter_timeout()
102 alarm_cfg.callback = NULL; in mcux_lpc_ostick_set_counter_timeout()
103 alarm_cfg.user_data = NULL; in mcux_lpc_ostick_set_counter_timeout()
104 alarm_cfg.flags = 0; in mcux_lpc_ostick_set_counter_timeout()
106 if (counter_set_channel_alarm(counter_dev, 0, &alarm_cfg) != 0) { in mcux_lpc_ostick_set_counter_timeout()

12