/Zephyr-latest/samples/drivers/counter/alarm/ |
D | README.rst | 1 .. zephyr:code-sample:: alarm 2 :name: Counter Alarm 5 Implement an alarm application using the counter API. 9 This sample provides an example of alarm application using :ref:`counter API <counter_api>`. 10 It sets an alarm with an initial delay of 2 seconds. At each alarm 11 expiry, a new alarm is configured with a delay multiplied by 2. 20 This sample requires the support of a timer IP compatible with alarm setting. 31 :zephyr-app: samples/drivers/counter/alarm 42 Counter alarm sample 44 Set alarm in 2 sec [all …]
|
D | sample.yaml | 12 - "Counter alarm sample" 13 - "Set alarm in 2 sec" 14 - "!!! Alarm !!!" 18 sample.drivers.counter.alarm: 46 sample.drivers.counter.alarm.stm32_rtc:
|
/Zephyr-latest/tests/drivers/rtc/rtc_api/src/ |
D | test_alarm.c | 76 /* Clear alarm alarm time */ in ZTEST() 80 zassert_ok(ret, "Failed to clear alarm %d time", i); in ZTEST() 83 /* Disable alarm callback */ in ZTEST() 88 "Failed to clear and disable alarm %d callback", i); in ZTEST() 91 /* Every supported alarm field should reject invalid values. */ in ZTEST() 94 zassert_ok(ret, "Failed to get supported alarm %d fields", i); in ZTEST() 103 "%s: RTC should reject invalid alarm %d time in field %zu.", in ZTEST() 112 zassert_ok(ret, "Failed to get supported alarm %d fields", i); in ZTEST() 115 zassert_ok(ret, "Configured alarm time fields to set are not supported"); in ZTEST() 120 zassert_ok(ret, "Failed to set alarm %d time", i); in ZTEST() [all …]
|
D | test_alarm_callback.c | 72 /* Disable alarm callback */ in ZTEST() 77 TC_PRINT("Alarm callbacks not supported\n"); in ZTEST() 80 zassert_ok(ret, "Failed to clear and disable alarm %d", i); in ZTEST() 86 zassert_ok(ret, "Failed to set alarm %d time", i); in ZTEST() 93 /* Clear alarm pending status */ in ZTEST() 96 zassert_true(ret > -1, "Failed to clear alarm %d pending status", i); in ZTEST() 99 /* Set and enable alarm callback */ in ZTEST() 111 zassert_ok(ret, "Failed to set alarm %d callback", i); in ZTEST() 119 /* Wait before validating alarm callbacks have not been called prematurely */ in ZTEST() 122 /* Validate alarm callbacks have not been called prematurely */ in ZTEST() [all …]
|
/Zephyr-latest/include/zephyr/drivers/ |
D | rtc.h | 34 * @brief Mask for alarm time fields to enable when setting alarm time 35 * @name RTC Alarm Time Mask 85 * @brief RTC alarm triggered callback 88 * @param id Alarm id 89 * @param user_data Optional user data passed with the alarm configuration 113 * @brief API for getting the supported fields of the RTC alarm time 120 * @brief API for setting RTC alarm time 127 * @brief API for getting RTC alarm time 134 * @brief API for testing if RTC alarm is pending 140 * @brief API for setting RTC alarm callback [all …]
|
D | counter.h | 76 * @name Alarm configuration flags 78 * @brief Used in alarm configuration structure (@ref counter_alarm_cfg). 82 * @brief Counter alarm absolute value flag. 90 * @brief Alarm flag enabling immediate expiration when driver detects that 91 * absolute alarm was set too late. 93 * Alarm callback must be called from the same context as if it was set on time. 109 * absolute alarm (see @ref counter_set_channel_alarm). 115 /** @brief Alarm callback 119 * @param ticks Counter value that triggered the alarm. 126 /** @brief Alarm callback structure. [all …]
|
/Zephyr-latest/include/zephyr/drivers/rtc/ |
D | maxim_ds3231.h | 23 * * two alarm channels are supported but are not equally capable: 46 /** @brief Bit in ctrl or ctrl_stat associated with alarm 1. */ 49 /** @brief Bit in ctrl or ctrl_stat associated with alarm 2. */ 57 /** @brief ctrl bit for alarm 1 interrupt enable. */ 60 /** @brief ctrl bit for alarm 2 interrupt enable. */ 66 * signal indicates alarm events. 104 * If an alarm callback handler is registered this bit is 112 * If an alarm callback handler is registered this bit is 131 /** @brief Control alarm behavior on match in seconds field. 133 * If clear the alarm fires only when the RTC seconds matches the [all …]
|
/Zephyr-latest/tests/kernel/sched/wraparound/src/ |
D | main.c | 16 K_TIMER_DEFINE(alarm, alarm_callback, NULL); 29 /* Wake up myself by alarm */ in ZTEST() 31 k_timer_start(&alarm, K_TICKS(wakeup_ticks), K_FOREVER); in ZTEST() 33 /* Waiting alarm's k_wakeup() call */ in ZTEST() 38 k_timer_stop(&alarm); in ZTEST()
|
/Zephyr-latest/samples/drivers/counter/maxim_ds3231/ |
D | README.rst | 62 The alarm configuration is read from non-volatile memory and displayed. 66 Alarm 1 flags 0 at 254034017: 0 67 Alarm 2 flags e at 252374400: 0 70 representation displayed. The second-resolution alarm is configured to 72 alarm is configured to fire once per minute:: 75 Set sec alarm 90 at 1563516007 ~ 2019-07-19 06:00:07 Fri 200: 5 76 Set min alarm flags f at 1563516007 ~ 2019-07-19 06:00:07 Fri 200: 7 83 Sec alarm flags 10 at 252914407 ~ 1978-01-06 06:00:07 Fri 006 84 Min alarm flags e at 252374400 ~ 1977-12-31 00:00:00 Sat 365 86 The second-resolution alarm was signalled, and processed by the [all …]
|
/Zephyr-latest/drivers/rtc/ |
D | rtc_emul.c | 148 struct rtc_emul_alarm *alarm; in rtc_emul_test_alarms() local 151 alarm = &data->alarms[i]; in rtc_emul_test_alarms() 153 if (alarm->mask == 0) { in rtc_emul_test_alarms() 157 if ((alarm->mask & RTC_ALARM_TIME_MASK_SECOND) && in rtc_emul_test_alarms() 158 (alarm->datetime.tm_sec != data->datetime.tm_sec)) { in rtc_emul_test_alarms() 162 if ((alarm->mask & RTC_ALARM_TIME_MASK_MINUTE) && in rtc_emul_test_alarms() 163 (alarm->datetime.tm_min != data->datetime.tm_min)) { in rtc_emul_test_alarms() 167 if ((alarm->mask & RTC_ALARM_TIME_MASK_HOUR) && in rtc_emul_test_alarms() 168 (alarm->datetime.tm_hour != data->datetime.tm_hour)) { in rtc_emul_test_alarms() 172 if ((alarm->mask & RTC_ALARM_TIME_MASK_MONTHDAY) && in rtc_emul_test_alarms() [all …]
|
D | rtc_rpi_pico.c | 69 /* re-enable the alarm. */ in rtc_rpi_isr() 177 const struct rtc_time *alarm) in rtc_rpi_pico_alarm_set_time() argument 189 if (!rtc_utils_validate_rtc_time(alarm, mask)) { in rtc_rpi_pico_alarm_set_time() 193 LOG_INF("Setting alarm"); in rtc_rpi_pico_alarm_set_time() 197 /* Disable the alarm */ in rtc_rpi_pico_alarm_set_time() 210 ((alarm->tm_year + TM_YEAR_REF) << RTC_IRQ_SETUP_0_YEAR_LSB)); in rtc_rpi_pico_alarm_set_time() 215 (alarm->tm_mon << RTC_IRQ_SETUP_0_MONTH_LSB)); in rtc_rpi_pico_alarm_set_time() 220 ((alarm->tm_mday + 1) << RTC_IRQ_SETUP_0_DAY_LSB)); in rtc_rpi_pico_alarm_set_time() 225 (alarm->tm_wday << RTC_IRQ_SETUP_1_DOTW_LSB)); in rtc_rpi_pico_alarm_set_time() 230 (alarm->tm_hour << RTC_IRQ_SETUP_1_HOUR_LSB)); in rtc_rpi_pico_alarm_set_time() [all …]
|
/Zephyr-latest/drivers/counter/ |
D | counter_gecko_stimer.c | 59 struct counter_gecko_alarm_data alarm[STIMER_ALARM_NUM]; member 190 printk("Alarm timer count exceeded\n"); in counter_gecko_set_alarm() 203 dev_data->alarm[chan_id].ticks = top_val + (alarm_cfg->ticks - now_ticks); in counter_gecko_set_alarm() 205 dev_data->alarm[chan_id].ticks = in counter_gecko_set_alarm() 211 dev_data->alarm[chan_id].ticks = alarm_cfg->ticks; in counter_gecko_set_alarm() 214 dev_data->alarm[chan_id].callback = alarm_cfg->callback; in counter_gecko_set_alarm() 215 dev_data->alarm[chan_id].chan_id = chan_id; in counter_gecko_set_alarm() 216 dev_data->alarm[chan_id].dev = (struct device *)dev; in counter_gecko_set_alarm() 217 dev_data->alarm[chan_id].user_data = (struct counter_alarm_cfg *)alarm_cfg; in counter_gecko_set_alarm() 220 sl_sleeptimer_start_timer(&alarm_timer[chan_id], dev_data->alarm[chan_id].ticks, in counter_gecko_set_alarm() [all …]
|
D | counter_sam_tc.c | 21 * - The driver does not guarantee that short relative alarm will trigger the 73 struct counter_sam_alarm_data alarm[MAX_ALARMS_PER_TC_CHANNEL]; member 156 if (data->alarm[chan_id].callback != NULL) { 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() 190 LOG_DBG("set alarm: channel %u, count %u", chan_id, alarm_value); in counter_sam_tc_set_alarm() 210 data->alarm[chan_id].callback = NULL; in counter_sam_tc_cancel_alarm() 211 data->alarm[chan_id].user_data = NULL; in counter_sam_tc_cancel_alarm() 213 LOG_DBG("cancel alarm: channel %u", chan_id); in counter_sam_tc_cancel_alarm() 228 if (data->alarm[i].callback) { in counter_sam_tc_set_top_value() [all …]
|
D | counter_gecko_rtcc.c | 37 struct counter_gecko_alarm_data alarm[RTCC_ALARM_NUM]; member 109 if (dev_data->alarm[i].callback) { in counter_gecko_set_top_value() 161 if (dev_data->alarm[chan_id].callback != NULL) { 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() 186 LOG_DBG("set alarm: channel %u, count %u", chan_id, ccv); in counter_gecko_set_alarm() 205 dev_data->alarm[chan_id].callback = NULL; in counter_gecko_cancel_alarm() 206 dev_data->alarm[chan_id].user_data = NULL; in counter_gecko_cancel_alarm() 210 LOG_DBG("cancel alarm: channel %u", chan_id); in counter_gecko_cancel_alarm() 340 if (dev_data->alarm[i].callback) { in ISR_DIRECT_DECLARE() [all …]
|
D | counter_renesas_ra_agt.c | 55 /* Alarm-related data */ 56 struct counter_ra_agt_alarm alarm; /* Counter alarm config struct */ member 59 uint32_t guard_period; /* Absolute counter alarm's guard period */ 174 struct counter_ra_agt_alarm *const alarm = &data->alarm; in counter_ra_agt_set_alarm() local 183 LOG_ERR("%s: alarm ticks is larger than top value", __func__); in counter_ra_agt_set_alarm() 187 if (alarm->callback) { in counter_ra_agt_set_alarm() 191 alarm->callback = alarm_cfg->callback; in counter_ra_agt_set_alarm() 192 alarm->data = alarm_cfg->user_data; in counter_ra_agt_set_alarm() 203 /* Acceptable alarm value range, counting from current tick (now) */ in counter_ra_agt_set_alarm() 219 /* Recalculate alarm tick timestamp based on current tick (now) */ in counter_ra_agt_set_alarm() [all …]
|
D | counter_mcux_snvs.c | 88 LOG_ERR("Invalid alarm ticks"); in mcux_snvs_set_alarm() 99 /* disable RTC alarm interrupt */ in mcux_snvs_set_alarm() 104 /* Set alarm in seconds*/ in mcux_snvs_set_alarm() 108 /* enable RTC alarm interrupt */ in mcux_snvs_set_alarm() 118 /* disable SRTC alarm interrupt */ in mcux_snvs_set_alarm() 123 /* Set alarm in seconds*/ in mcux_snvs_set_alarm() 126 /* enable SRTC alarm interrupt */ in mcux_snvs_set_alarm() 144 /* disable RTC alarm interrupt */ in mcux_snvs_cancel_alarm() 154 /* disable SRTC alarm interrupt */ in mcux_snvs_cancel_alarm() 210 /* Clear alarm flag */ in mcux_snvs_isr() [all …]
|
D | Kconfig.mcux_snvs | 21 bool "IMX SNVS wake-up on SRTC alarm" 25 Assert Wake-Up Interrupt on SRTC alarm
|
D | counter_dw_timer.c | 78 /* alarm callback function */ 99 /* In case of alarm, mask interrupt and disable the callback. User in counter_dw_timer_irq_handler() 100 * can configure the alarm in same context within callback function. in counter_dw_timer_irq_handler() 182 /* top value cannot be updated if the alarm is active */ in counter_dw_timer_set_top_value() 185 LOG_ERR("Top value cannot be updated, alarm is active!"); in counter_dw_timer_set_top_value() 224 LOG_ERR("Invalid alarm configuration"); in counter_dw_timer_set_alarm() 228 /* Alarm callback is mandatory */ in counter_dw_timer_set_alarm() 230 LOG_ERR("Alarm callback function cannot be null"); in counter_dw_timer_set_alarm() 234 /* absolute alarm is not supported as interrupts are triggered in counter_dw_timer_set_alarm() 238 LOG_ERR("Absolute alarm is not supported"); in counter_dw_timer_set_alarm() [all …]
|
/Zephyr-latest/samples/drivers/counter/alarm/src/ |
D | main.c | 89 printk("!!! Alarm !!!\n"); in test_counter_interrupt_fn() 92 /* Set a new alarm with a double length duration */ in test_counter_interrupt_fn() 95 printk("Set alarm in %u sec (%u ticks)\n", in test_counter_interrupt_fn() 103 printk("Alarm could not be set\n"); in test_counter_interrupt_fn() 112 printk("Counter alarm sample\n\n"); in main() 128 printk("Set alarm in %u sec (%u ticks)\n", in main() 134 printk("Alarm settings invalid\n"); in main() 136 printk("Alarm setting request not supported\n"); in main()
|
/Zephyr-latest/drivers/sensor/st/stts751/ |
D | Kconfig | 63 int "High temperature threshold alarm" 66 HIGH temperature threshold to trigger an alarm 70 int "Low temperature threshold alarm" 73 LOW temperature threshold to trigger an alarm
|
/Zephyr-latest/dts/bindings/sensor/ |
D | st,stts22h-i2c.yaml | 35 HIGH temperature threshold above which an alarm is triggered. 36 Valid range is 0 to 255. It defaults to 0 (alarm off) which is 46 LOW temperature threshold below which an alarm is triggered. 47 Valid range is 0 to 255. It defaults to 0 (alarm off) which is
|
/Zephyr-latest/tests/drivers/counter/maxim_ds3231_api/src/ |
D | test_counter.c | 216 "%s: Alarm (%d) too early now: %d (counting up).", in alarm_handler() 220 "%s: Alarm (%d) too early now: %d (counting down).", in alarm_handler() 256 /* Counter does not support any alarm */ in test_single_shot_alarm_instance() 273 " exceeded the limit set alarm", dev->name); in test_single_shot_alarm_instance() 279 zassert_equal(0, err, "%s: Counter set alarm failed (err: %d)", in test_single_shot_alarm_instance() 287 "%s: Expecting alarm callback", dev->name); in test_single_shot_alarm_instance() 292 "%s: Expecting alarm callback", dev->name); in test_single_shot_alarm_instance() 295 zassert_equal(0, err, "%s: Counter disabling alarm failed %d", dev->name, err); in test_single_shot_alarm_instance() 359 * Two alarms set. First alarm is absolute, second relative. Because 360 * setting of both alarms is delayed it is expected that second alarm [all …]
|
/Zephyr-latest/tests/drivers/counter/counter_basic_api/src/ |
D | test_counter.c | 357 /* Arbitrary limit for alarm processing - time between hw expiration in alarm_handler() 380 "Unexpected distance between reported alarm value(%u) " in alarm_handler() 423 /* Counter does not support any alarm */ in test_single_shot_alarm_instance() 440 " exceeded the limit set alarm", dev->name); in test_single_shot_alarm_instance() 446 zassert_equal(0, err, "%s: Counter set alarm failed (err: %d)", in test_single_shot_alarm_instance() 453 zassert_equal(1, cnt, "%s: Expecting alarm callback", dev->name); in test_single_shot_alarm_instance() 458 zassert_equal(1, cnt, "%s: Expecting alarm callback", dev->name); in test_single_shot_alarm_instance() 461 zassert_equal(0, err, "%s: Counter disabling alarm failed", dev->name); in test_single_shot_alarm_instance() 531 * Two alarms set. First alarm is absolute, second relative. Because 532 * setting of both alarms is delayed it is expected that second alarm [all …]
|
/Zephyr-latest/samples/boards/nxp/mimxrt1060_evk/system_off/ |
D | README.rst | 15 additionally set an alarm 10 seconds in the future to wake up the processor 41 alarm to fire and wake the device up automatically. 55 RTC Alarm set for 10 seconds to wake from soft-off.
|
/Zephyr-latest/samples/boards/nuvoton/numaker/system_off/src/ |
D | main.c | 39 /* Set alarm time */ in set_alarm_10s() 45 printk("Failed to set alarm\n"); in set_alarm_10s() 58 printk("Wake-up alarm set for 10 seconds.\n"); in main()
|