/Zephyr-Core-3.5.0/drivers/counter/ |
D | counter_esp32_rtc.c | 44 struct counter_alarm_cfg alarm_cfg; member 104 const struct counter_alarm_cfg *alarm_cfg) in counter_esp32_set_alarm() argument 112 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) == 0) { in counter_esp32_set_alarm() 113 WRITE_PERI_REG(RTC_CNTL_SLP_TIMER0_REG, (now + alarm_cfg->ticks)); in counter_esp32_set_alarm() 115 WRITE_PERI_REG(RTC_CNTL_SLP_TIMER0_REG, alarm_cfg->ticks); in counter_esp32_set_alarm() 127 data->alarm_cfg.callback = alarm_cfg->callback; in counter_esp32_set_alarm() 128 data->alarm_cfg.user_data = alarm_cfg->user_data; in counter_esp32_set_alarm() 212 if (data->alarm_cfg.callback) { in counter_esp32_isr() 213 data->alarm_cfg.callback(dev, 0, now, data->alarm_cfg.user_data); in counter_esp32_isr()
|
D | counter_esp32_tmr.c | 55 struct counter_alarm_cfg alarm_cfg; member 82 data->alarm_cfg.callback = NULL; in counter_esp32_init() 138 const struct counter_alarm_cfg *alarm_cfg) in counter_esp32_set_alarm() argument 148 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) == 0) { in counter_esp32_set_alarm() 149 timer_hal_set_alarm_value(&data->hal_ctx, (now + alarm_cfg->ticks)); in counter_esp32_set_alarm() 151 timer_hal_set_alarm_value(&data->hal_ctx, alarm_cfg->ticks); in counter_esp32_set_alarm() 156 data->alarm_cfg.callback = alarm_cfg->callback; in counter_esp32_set_alarm() 157 data->alarm_cfg.user_data = alarm_cfg->user_data; in counter_esp32_set_alarm() 225 if (data->alarm_cfg.callback) { in counter_esp32_isr() 226 data->alarm_cfg.callback(dev, 0, now, data->alarm_cfg.user_data); in counter_esp32_isr()
|
D | counter_ambiq_timer.c | 91 const struct counter_alarm_cfg *alarm_cfg) in counter_ambiq_set_alarm() argument 101 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) == 0) { in counter_ambiq_set_alarm() 102 am_hal_timer_compare1_set(0, now + alarm_cfg->ticks); in counter_ambiq_set_alarm() 104 am_hal_timer_compare1_set(0, alarm_cfg->ticks); in counter_ambiq_set_alarm() 107 data->user_data = alarm_cfg->user_data; in counter_ambiq_set_alarm() 108 data->callback = alarm_cfg->callback; in counter_ambiq_set_alarm()
|
D | counter_rpi_pico_timer.c | 71 const struct counter_alarm_cfg *alarm_cfg) in counter_rpi_pico_timer_set_alarm() argument 76 uint64_t target = (alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) ? 0 : alarm_cfg->ticks; in counter_rpi_pico_timer_set_alarm() 82 if (alarm_cfg->ticks > counter_rpi_pico_timer_get_top_value(dev)) { in counter_rpi_pico_timer_set_alarm() 90 chdata->callback = alarm_cfg->callback; in counter_rpi_pico_timer_set_alarm() 91 chdata->user_data = alarm_cfg->user_data; in counter_rpi_pico_timer_set_alarm() 96 if (alarm_cfg->flags & COUNTER_ALARM_CFG_EXPIRE_WHEN_LATE) { in counter_rpi_pico_timer_set_alarm()
|
D | counter_timer_shell.c | 98 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()
|
D | counter_gecko_stimer.c | 176 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()
|
D | counter_gecko_rtcc.c | 151 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()
|
D | counter_mchp_xec.c | 111 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()
|
D | counter_mcux_snvs.c | 73 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()
|
D | counter_sam_tc.c | 133 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()
|
D | counter_native_posix.c | 99 const struct counter_alarm_cfg *alarm_cfg) in ctr_set_alarm() argument 108 pending_alarm = *alarm_cfg; in ctr_set_alarm() 111 if (!(alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE)) { in ctr_set_alarm()
|
D | counter_dw_timer.c | 216 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()
|
D | counter_smartbond_timer.c | 100 const struct counter_alarm_cfg *alarm_cfg) in counter_smartbond_set_alarm() argument 108 bool absolute = alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE; in counter_smartbond_set_alarm() 109 uint32_t flags = alarm_cfg->flags; in counter_smartbond_set_alarm() 110 uint32_t val = alarm_cfg->ticks; in counter_smartbond_set_alarm() 117 if (chan != 0 || alarm_cfg->ticks > counter_smartbond_get_top_value(dev)) { in counter_smartbond_set_alarm() 126 data->callback = alarm_cfg->callback; in counter_smartbond_set_alarm() 127 data->user_data = alarm_cfg->user_data; in counter_smartbond_set_alarm()
|
D | counter_mcux_gpt.c | 61 const struct counter_alarm_cfg *alarm_cfg) in mcux_gpt_set_alarm() argument 67 uint32_t ticks = alarm_cfg->ticks; in mcux_gpt_set_alarm() 74 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) == 0) { in mcux_gpt_set_alarm() 82 data->alarm_callback = alarm_cfg->callback; in mcux_gpt_set_alarm() 83 data->alarm_user_data = alarm_cfg->user_data; in mcux_gpt_set_alarm()
|
D | counter_mcux_ctimer.c | 95 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()
|
D | counter_mcux_rtc.c | 94 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()
|
D | counter_mcux_lpc_rtc.c | 75 const struct counter_alarm_cfg *alarm_cfg) in mcux_lpc_rtc_set_alarm() argument 82 uint32_t ticks = alarm_cfg->ticks; in mcux_lpc_rtc_set_alarm() 96 if ((alarm_cfg->flags & COUNTER_ALARM_CFG_ABSOLUTE) == 0) { in mcux_lpc_rtc_set_alarm() 105 data->alarm_callback = alarm_cfg->callback; in mcux_lpc_rtc_set_alarm() 106 data->alarm_user_data = alarm_cfg->user_data; in mcux_lpc_rtc_set_alarm()
|
D | counter_sam0_tc32.c | 183 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.5.0/samples/drivers/counter/alarm/src/ |
D | main.c | 16 struct counter_alarm_cfg alarm_cfg; variable 109 alarm_cfg.flags = 0; in main() 110 alarm_cfg.ticks = counter_us_to_ticks(counter_dev, DELAY); in main() 111 alarm_cfg.callback = test_counter_interrupt_fn; in main() 112 alarm_cfg.user_data = &alarm_cfg; in main() 115 &alarm_cfg); in main() 118 alarm_cfg.ticks) / USEC_PER_SEC), in main() 119 alarm_cfg.ticks); in main()
|
/Zephyr-Core-3.5.0/tests/drivers/counter/maxim_ds3231_api/src/ |
D | test_counter.c | 24 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.5.0/samples/boards/mimxrt595_evk_cm33/system_off/src/ |
D | main.c | 17 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.5.0/drivers/watchdog/ |
D | wdt_andes_atcwdt200.c | 98 struct counter_alarm_cfg alarm_cfg; variable 126 counter_set_channel_alarm(counter_dev, 2, &alarm_cfg); in wdt_counter_cb() 147 alarm_cfg.flags = 0; in wdt_atcwdt200_set_max_timeout() 148 alarm_cfg.callback = wdt_counter_cb; in wdt_atcwdt200_set_max_timeout() 149 alarm_cfg.user_data = &alarm_cfg; in wdt_atcwdt200_set_max_timeout() 150 alarm_cfg.ticks = ((WDOGCFG_PERIOD_MAX * counter_freq) / EXT_CLOCK_FREQ) >> 1; in wdt_atcwdt200_set_max_timeout() 210 ret = counter_set_channel_alarm(pit_counter_dev, 2, &alarm_cfg); in wdt_atcwdt200_setup() 284 alarm_cfg.flags = 0; in wdt_atcwdt200_install_timeout() 285 alarm_cfg.callback = wdt_counter_cb; in wdt_atcwdt200_install_timeout() 286 alarm_cfg.user_data = &alarm_cfg; in wdt_atcwdt200_install_timeout() [all …]
|
/Zephyr-Core-3.5.0/tests/drivers/counter/counter_basic_api/src/ |
D | test_counter.c | 658 struct counter_alarm_cfg alarm_cfg = { in test_late_alarm_instance() local 674 alarm_cfg.ticks = 0; in test_late_alarm_instance() 675 err = counter_set_channel_alarm(dev, 0, &alarm_cfg); in test_late_alarm_instance() 687 err = counter_get_value(dev, &(alarm_cfg.ticks)); in test_late_alarm_instance() 691 err = counter_set_channel_alarm(dev, 0, &alarm_cfg); in test_late_alarm_instance() 710 struct counter_alarm_cfg alarm_cfg = { in test_late_alarm_error_instance() local 725 alarm_cfg.ticks = 0; in test_late_alarm_error_instance() 726 err = counter_set_channel_alarm(dev, 0, &alarm_cfg); in test_late_alarm_error_instance() 731 err = counter_get_value(dev, &(alarm_cfg.ticks)); in test_late_alarm_error_instance() 735 err = counter_set_channel_alarm(dev, 0, &alarm_cfg); in test_late_alarm_error_instance() [all …]
|
/Zephyr-Core-3.5.0/subsys/testsuite/busy_sim/ |
D | busy_sim.c | 21 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.5.0/samples/boards/mimxrt1060_evk/system_off/src/ |
D | main.c | 73 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()
|