/Zephyr-latest/soc/arm/beetle/ |
D | power.c | 4 * SPDX-License-Identifier: Apache-2.0 68 /* Enable AHB and APB clocks */ in clock_active_init() 70 __BEETLE_SYSCON->ahbclkcfg0set = AHB_CLK_BITS; in clock_active_init() 73 __BEETLE_SYSCON->apbclkcfg0set = APB_CLK_BITS; in clock_active_init() 77 * @brief Configures the clock that remain active during sleep state. 79 * Configures the clock that remain active during sleep state. 83 /* Configure APB Peripheral Clock in sleep state */ in clock_sleep_init() 84 __BEETLE_SYSCON->apbclkcfg1set = APB_CLK_BITS; in clock_sleep_init() 94 /* Configure APB Peripheral Clock in deep sleep state */ in clock_deepsleep_init() 95 __BEETLE_SYSCON->apbclkcfg2set = APB_CLK_BITS; in clock_deepsleep_init() [all …]
|
/Zephyr-latest/samples/boards/espressif/light_sleep/ |
D | README.rst | 1 .. zephyr:code-sample:: esp32-light-sleep 2 :name: Light Sleep 4 Use light sleep mode on ESP32 to save power while preserving the state of the memory, CPU, and 10 This example illustrates usage of light sleep mode. Unlike deep sleep mode, 11 light sleep preserves the state of the memory, CPU, and peripherals. Execution 13 When the chip exits light sleep mode, execution continues at the point where it 14 was stopped, and :c:func:`esp_light_sleep_start()` function returns. 16 The example enables the following wakeup sources: 27 button, an external button can be connected, along with a 10k pull-up resistor, 28 and a 100nF capacitor to ground for debouncing. [all …]
|
/Zephyr-latest/tests/kernel/sleep/ |
D | README.txt | 1 Title: cooperative thread Sleep and Wakeup APIs 5 This test verifies that cooperative sleep and wakeup APIs operate as 8 --------------------------------------------------------------------------- 10 Building and Running Project: 12 This project outputs to the console. It can be built and executed 17 --------------------------------------------------------------------------- 21 Problems caused by out-dated project information can be addressed by 28 # and restore pre-defined configuration info 30 --------------------------------------------------------------------------- 34 Running test suite sleep [all …]
|
/Zephyr-latest/samples/boards/espressif/deep_sleep/ |
D | README.rst | 1 .. zephyr:code-sample:: esp32-deep-sleep 2 :name: Deep Sleep 4 Use deep sleep with wake on timer, GPIO, and EXT1 sources on ESP32. 9 The deep sleep mode of the ESP32 Series is a power saving mode that causes the 10 CPU, majority of RAM, and digital peripherals that are clocked from APB_CLK to 13 This sample shows how to set a wake up source, trigger deep sleep and then 14 make use of that pre-configured wake up source to bring the system back again. 21 uses GPIO2 and GPIO4 to trigger a wake up with any one of the two pins are 23 3. ``GPIO``: Only supported by some Espressif SoCs, in the case of ESP32-C3 24 GPIOS0~5 can be used as wake-up sources. [all …]
|
D | Kconfig | 2 # SPDX-License-Identifier: Apache-2.0 4 mainmenu "Espressif Deep Sleep demo" 7 bool "Enable wakeup from GPIO" 11 This option enables wake-up from deep sleep using GPIO2 and 12 GPIO4. The sample enables internal pull-down on EXT1 pins to 13 avoid random wake-ups. Otherwise, external pull-down should 14 be used for the same purpose. To trigger a wake-up, connect 18 bool "Enable wakeup from GPIO" 22 This option enables wake-up from GPIO. Only GPIO0~5 can be used 23 as wake-up source. Be aware that when low level is used to trigger [all …]
|
/Zephyr-latest/samples/boards/st/power_mgmt/serial_wakeup/ |
D | README.rst | 1 .. zephyr:code-sample:: stm32_pm_serial_wakeup 2 :name: Serial wakeup 3 :relevant-api: subsys_pm_device 10 This sample is a minimum application to demonstrate serial wakeup functionality 13 .. _stm32-pm-serial-wakeup-sample-requirements: 20 in core sleep states, as LPTIM (:dtcompatible:`st,stm32-lptim`). 23 be a functional wakeup source: 25 - Clocked by an oscillator available in Stop mode (LSE, LSI) or an oscillator capable 27 - Matching oscillator sources should be enabled 28 - If LSE is selected as clock source and shell serial port is a LPUART current speed [all …]
|
/Zephyr-latest/dts/bindings/sensor/ |
D | st,lis2dw12-common.yaml | 2 # SPDX-License-Identifier: Apache-2.0 6 lis2dw12.h and use the macros defined there. 9 #include <zephyr/dt-bindings/sensor/lis2dw12.h> 14 wakeup-duration = <LIS2DW12_DT_WAKEUP_4_ODR>; 15 ff-threshold = <LIS2DW12_DT_FF_THRESHOLD_500_mg>; 16 tap-mode = <LIS2DW12_DT_SINGLE_DOUBLE_TAP>; 17 power-mode = <LIS2DW12_DT_HP_MODE>; 18 bw-filt = <LIS2DW12_DT_FILTER_BW_ODR_DIV_2>; 21 include: sensor-device.yaml 24 irq-gpios: [all …]
|
D | ti,tmag5273.yaml | 2 # SPDX-License-Identifier: Apache-2.0 5 Texas Instruments Low-Power Linear 3D Hall-Effect Sensor with an I2C interface. 14 include tmag5273.h and use the macros defined there. 17 #include <zephyr/dt-bindings/sensor/tmag5273.h> 27 include: [sensor-device.yaml, i2c-device.yaml] 30 operation-mode: 38 - 0 # TMAG5273_DT_OPER_MODE_CONTINUOUS (continuous) 39 - 1 # TMAG5273_DT_OPER_MODE_STANDBY (standby) 49 - 0 # TMAG5273_DT_AXIS_NONE 50 - 1 # TMAG5273_DT_AXIS_X [all …]
|
/Zephyr-latest/drivers/sensor/st/lis2dw12/ |
D | Kconfig | 1 # ST Microelectronics LIS2DW12 3-axis accelerometer driver 4 # SPDX-License-Identifier: Apache-2.0 31 depends on $(dt_compat_any_has_prop,$(DT_COMPAT_ST_LIS2DW12),irq-gpios) 37 depends on $(dt_compat_any_has_prop,$(DT_COMPAT_ST_LIS2DW12),irq-gpios) 62 bool "Tap and Tap-Tap detection" 69 bool "Sleep mode" 71 Enable sleep (inactivity) mode with ODR change when detected 74 bool "Wakeup detection (via interrupt)" 76 Enable the wakeup detection feature. 77 The wake-up interrupt signal is generated if a certain number of [all …]
|
/Zephyr-latest/samples/boards/ti/cc13x2_cc26x2/system_off/ |
D | README.rst | 1 .. zephyr:code-sample:: ti_cc13x2_cc26x2_system_off 4 Exercise the various sleep modes on TI CC13x2/CC26x2 platforms. 9 This sample can be used for basic power measurement and as an example of 10 the various sleep modes on TI CC13x2/CC26x2 platforms. The functional 13 * Busy-wait for 5 seconds 14 * Sleep for 2 milliseconds (Idle mode) 15 * Sleep for 3 seconds (Standby mode) 16 * Turn the system off after enabling wakeup through a button press 27 Building, Flashing and Running 30 .. zephyr-app-commands:: [all …]
|
/Zephyr-latest/tests/kernel/sleep/src/ |
D | main.c | 4 * SPDX-License-Identifier: Apache-2.0 20 #define TEST_THREAD_PRIORITY -4 21 #define HELPER_THREAD_PRIORITY -10 54 * @brief Test sleep and wakeup APIs 56 * @defgroup kernel_sleep_tests Sleep Tests 60 * This module tests the following sleep and wakeup scenarios: 65 * 5. k_sleep() - no cancellation exists 89 /* Shouldn't ever sleep for less than requested time, but allow for 1 90 * tick of "too long" slop for aliasing between wakeup and 96 uint32_t dt = end - start; in sleep_time_valid() [all …]
|
/Zephyr-latest/drivers/timer/ |
D | mcux_os_timer.c | 4 * SPDX-License-Identifier: Apache-2.0 26 #define MAX_TICKS ((MAX_CYC - CYC_PER_TICK) / CYC_PER_TICK) 34 /* Total cycles of the timer compensated to include the time lost in "sleep/deep sleep" modes. 36 * certain deep sleep modes and the time elapsed when it is powered off. 54 uint32_t dticks = (uint32_t)((now - last_count) / CYC_PER_TICK); in mcux_lpc_ostick_isr() 57 base->OSEVENT_CTRL &= ~OSTIMER_OSEVENT_CTRL_OSTIMER_INTENA_MASK; in mcux_lpc_ostick_isr() 64 if ((int64_t)(next - now) < MIN_DELAY) { in mcux_lpc_ostick_isr() 76 /* The OS Timer is disabled in certain low power modes and cannot wakeup the system 78 * OS Timer to save off the count if needed and also start a wakeup counter 79 * that would wakeup the system from deep power down modes. [all …]
|
D | smartbond_timer.c | 4 * SPDX-License-Identifier: Apache-2.0 21 #define MAX_TICKS (((COUNTER_SPAN / 2) - CYC_PER_TICK) / (CYC_PER_TICK)) 49 TIMER2->TIMER2_RELOAD_REG = val & TIMER2_TIMER2_RELOAD_REG_TIM_RELOAD_Msk; in set_reload() 57 timer_val_reg = TIMER2->TIMER2_TIMER_VAL_REG & in timer_val_32() 74 timer_val_reg = TIMER2->TIMER2_TIMER_VAL_REG & in timer_val_32_noupdate() 100 * Watchdog default reload value is 0x1FFF (~82s for RC32K and 172s for RCX). in sys_clock_set_timeout() 104 * system never goes to sleep for longer time that watchdog reload value. in sys_clock_set_timeout() 109 if (CRG_TOP->CLK_RCX_REG & CRG_TOP_CLK_RCX_REG_RCX_ENABLE_Msk) { in sys_clock_set_timeout() 114 watchdog_expire_ticks = SYS_WDOG->WATCHDOG_REG * 320; in sys_clock_set_timeout() 119 * ticks must be calculated according to XTAL32K frequency and in sys_clock_set_timeout() [all …]
|
/Zephyr-latest/soc/nxp/imxrt/imxrt10xx/ |
D | power.c | 4 * SPDX-License-Identifier: Apache-2.0 7 * sleep mode must be defined within this file, or linked to RAM. 28 * normal/full speed mode, low speed mode, and low power mode. 35 __ASSERT_NO_MSG(callbacks && callbacks->clock_set_run && callbacks->clock_set_low_power); in imxrt_clock_pm_callbacks_register() 36 lpm_clock_hooks.clock_set_run = callbacks->clock_set_run; in imxrt_clock_pm_callbacks_register() 37 lpm_clock_hooks.clock_set_low_power = callbacks->clock_set_low_power; in imxrt_clock_pm_callbacks_register() 38 if (callbacks->clock_lpm_init) { in imxrt_clock_pm_callbacks_register() 39 lpm_clock_hooks.clock_lpm_init = callbacks->clock_lpm_init; in imxrt_clock_pm_callbacks_register() 47 /* Set GPC wakeup config to GPT timer interrupt */ in lpm_set_sleep_mode_config() 50 * ERR050143: CCM: When improper low-power sequence is used, in lpm_set_sleep_mode_config() [all …]
|
/Zephyr-latest/tests/subsys/pm/device_wakeup_api/src/ |
D | main.c | 4 * SPDX-License-Identifier: Apache-2.0 34 /* Enable wakeup source. Next time the system is called in pm_state_set() 35 * to sleep, this device will still be active. in pm_state_set() 43 * and devices were suspended. in pm_state_set() 86 zassert_true(ret, "Could not enable wakeup source"); in ZTEST() 89 zassert_true(ret, "Wakeup source not enabled"); in ZTEST() 92 zassert_true(ret, "Could not disable wakeup source"); in ZTEST() 95 zassert_false(ret, "Wakeup source is enabled"); in ZTEST() 102 * PM_STATE_SUSPEND_TO_RAM and then the PM subsystem will in ZTEST() 103 * suspend all devices. As gpio is wakeup capability is not in ZTEST()
|
/Zephyr-latest/dts/bindings/timer/ |
D | nxp,os-timer.yaml | 2 # SPDX-License-Identifier: Apache-2.0 4 description: NXP OS Timer on i.MX-RT5xx/6xx 6 compatible: "nxp,os-timer" 17 deep-sleep-counter: 22 counter to wakeup and also to keep track of system time.
|
/Zephyr-latest/samples/boards/nxp/mimxrt1060_evk/system_off/ |
D | README.rst | 1 .. zephyr:code-sample:: mimxrt1060_evk_system_off 3 :relevant-api: sys_poweroff 5 Use soft-off on MIMXRT1060-EVK. 10 This sample can be used for basic power measurement and as an example of 13 * Busy-wait for 2 seconds 14 * Turn the system off after enabling wakeup through a button press, and 24 Building, Flashing and Running 27 .. zephyr-app-commands:: 28 :zephyr-app: samples/boards/nxp/mimxrt1060_evk/system_off 37 3. Device will turn on and idle for 2 seconds [all …]
|
/Zephyr-latest/tests/kernel/sched/preempt/src/ |
D | main.c | 4 * SPDX-License-Identifier: Apache-2.0 13 * to sleep. Then one is woken up (from a low priority manager 14 * thread) and arranges to wake up one other thread and validate that 18 * The wakeup test is repeated for all four combinations of threads 19 * either holding or not holding the scheduler lock, and by a 24 #error Preemption test requires single-CPU operation 73 /* Command to worker: use irq_offload() to indirect the wakeup? */ 76 /* Command to worker: sleep after wakeup? */ 79 /* Command to worker: yield after wakeup? */ 92 * path and always returns back into the calling context, so in wakeup_src_thread() [all …]
|
/Zephyr-latest/soc/nordic/nrf54l/ |
D | Kconfig | 4 # SPDX-License-Identifier: Apache-2.0 52 The CPU runs with the default, hardware-selected frequency. 70 bool "Force constant-latency mode" 72 In constant latency mode the CPU wakeup latency and the PPI task response 73 will be constant and kept at a minimum. This is secured by forcing a set 74 of base resources on while in sleep. The advantage of having a constant 75 and predictable latency will be at the cost of having increased power consumption.
|
/Zephyr-latest/samples/boards/st/power_mgmt/standby_shutdown/ |
D | README.rst | 1 .. zephyr:code-sample:: stm32_pm_shutdown 3 :relevant-api: sys_poweroff subsys_pm_sys 5 Enter and exit Standby/Shutdown mode on STM32. 10 This sample is a minimum application to demonstrate basic power management of Standby mode and 13 Press and hold the user button: 18 .. _stm32-pm-standby_shutdown-sample-requirements: 25 in core sleep states, as LPTIM (:dtcompatible:`st,stm32-lptim`). 26 For another board than nucleo_L476RG please adjust wakeup pin into config_wakeup_features(). 28 Building and Running 31 Build and flash standby_shutdown as follows, changing ``nucleo_L476RG`` for your board: [all …]
|
/Zephyr-latest/doc/services/pm/ |
D | device.rst | 15 - :ref:`Device Runtime Power Management <pm-device-runtime-pm>` 16 - :ref:`System-Managed Device Power Management <pm-device-system-pm>` 18 .. _pm-device-runtime-pm: 24 device drivers, subsystems, and applications. While device drivers 29 Each layer—device drivers, subsystems, and applications—can operate 34 - **Device drivers** are responsible for managing the 36 put devices into low-power states (suspend) when they are not in 37 use, and bring them back (resume) when needed. Drivers should use the 41 - **Subsystems**, such as sensors, file systems, 42 and network, can also influence device power management. [all …]
|
/Zephyr-latest/soc/ite/ec/it8xxx2/ |
D | soc.c | 4 * SPDX-License-Identifier: Apache-2.0 15 #include <zephyr/dt-bindings/interrupt-controller/ite-intc.h> 19 * ITE EC chip from dtsi (include status disable). Both it81202 and 34 /* PLL Frequency Auto-Calibration Control 0 Register */ 44 /* PLL Frequency Auto-Calibration Control 2 Register */ 79 return -ERANGE; in chip_get_pll_freq() 91 * for deep doze / sleep mode in chip_pll_ctrl() 180 /* Enable HW timer to wakeup chip from the sleep mode */ in chip_run_pll_sequence() 186 * into wakeup from the sleep mode. in chip_run_pll_sequence() 188 * enter sleep mode, and wait HW timer to wakeup chip to in chip_run_pll_sequence() [all …]
|
/Zephyr-latest/tests/subsys/pm/power_mgmt_soc/src/ |
D | power_mgmt.c | 4 * SPDX-License-Identifier: Apache-2.0 19 /* Sleep time should be lower than SUSPEND_TO_IDLE */ 26 /* Sleep some extra time than minimum residency: 27 * - for light it should be very little so that we get only into light sleep 28 * and not accidentally into a deep sleep. 29 * - for deep sleep it can be very long as we want to ensure that we enter 30 * the deepest sleep state possible. 52 /* Track entry/exit to sleep */ 65 latency = k_uptime_get() - trigger_time; in pm_latency_check() 70 "Sleep entry latency is too high: %d.%03d s.", in pm_latency_check() [all …]
|
/Zephyr-latest/samples/boards/nxp/mimxrt1060_evk/system_off/src/ |
D | main.c | 4 * SPDX-License-Identifier: Apache-2.0 39 printk("Error: button device %s is not ready\n", button.port->name); in main() 43 /* Configure to generate PORT event (wakeup) on button press. */ in main() 44 /* No external pull-up on the user button, so configure one here */ in main() 48 printk("Error %d: failed to configure %s pin %d\n", ret, button.port->name, in main() 56 button.port->name, button.pin); in main() 60 printk("Busy-wait %u s\n", BUSY_WAIT_S); in main() 63 printk("Sleep %u s\n", SLEEP_S); in main() 83 printk("RTC Alarm set for %llu seconds to wake from soft-off.\n", in main() 85 printk("Entering system off; press %s to restart sooner\n", button.port->name); in main() [all …]
|
/Zephyr-latest/tests/kernel/sched/schedule_api/src/ |
D | test_sched_timeslice_and_lock.c | 4 * SPDX-License-Identifier: Apache-2.0 42 tdata[i].priority = init_prio - 1; in setup_threads() 95 * @details Create 3 threads of priority -2, -1 and 0. 103 init_prio = -1; in ZTEST() 120 * @details Create 3 threads of priority -2, -1 and 0. Put the main 129 init_prio = -1; in ZTEST() 146 init_prio = -1; in ZTEST() 163 * and other threads with -1, 0 ,+1 priority. Now -1 priority 164 * thread gets executed and it is made to sleep for 10 sec. 165 * Now, wake up the -1 priority thread and check if it starts [all …]
|