text stringlengths 9 39.2M | dir stringlengths 25 226 | lang stringclasses 163
values | created_date timestamp[s] | updated_date timestamp[s] | repo_name stringclasses 751
values | repo_full_name stringclasses 752
values | star int64 1.01k 183k | len_tokens int64 1 18.5M |
|---|---|---|---|---|---|---|---|---|
```restructuredtext
.. _nrf-system-off-sample:
nRF5x System Off demo
#####################
Overview
********
This sample can be used for basic power measurement and as an example of
deep sleep on Nordic platforms.
RAM Retention
=============
This sample can also can demonstrate RAM retention. By selecting
``CONFIG... | /content/code_sandbox/samples/boards/nrf/system_off/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 230 |
```unknown
mainmenu "Nordic SYSTEM_OFF demo"
choice
prompt "Use retention"
optional
config APP_USE_NRF_RETENTION
bool "Use state retention in system off using nRF POWER"
depends on SOC_COMPATIBLE_NRF52X && CRC
help
On some Nordic chips this application supports retaining
memory while in system off using P... | /content/code_sandbox/samples/boards/nrf/system_off/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 125 |
```unknown
CONFIG_PM_DEVICE=y
CONFIG_GPIO=y
CONFIG_CRC=y
CONFIG_POWEROFF=y
``` | /content/code_sandbox/samples/boards/nrf/system_off/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 21 |
```yaml
sample:
name: Low Power State Sample for nRF5x
common:
tags: power
tests:
sample.boards.nrf.system_off:
build_only: true
integration_platforms:
- nrf52840dk/nrf52840
platform_allow:
- nrf54l15pdk/nrf54l15/cpuapp
- nrf52840dk/nrf52840
- nrf52dk/nrf52832
- nrf51dk/n... | /content/code_sandbox/samples/boards/nrf/system_off/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 281 |
```c
/*
*
*/
#include "retained.h"
#include <inttypes.h>
#include <stdio.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/kernel.h>
#include <zephyr/pm/device.h>
#include <zephyr/sys/poweroff.h>
#include <zephyr/sys/util.h>
static const struct gpio_dt_spec sw0 = GPIO_DT_SPEC_GET(DT_... | /content/code_sandbox/samples/boards/nrf/system_off/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 529 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/pinctrl.h>
#include <nrfx_spim.h>
#include <nrfx_uarte.h>
#include <drivers/src/prs/nrfx_prs.h>
#include <zephyr/irq.h>
#include <zephyr/sys/util.h>
#define TRANSFER_LENGTH 10
/* Devic... | /content/code_sandbox/samples/boards/nrf/nrfx_prs/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 3,157 |
```objective-c
/*
*
*/
#ifndef RETAINED_H_
#define RETAINED_H_
#include <stdbool.h>
#include <stdint.h>
/* Example of validatable retained data. */
struct retained_data {
/* The uptime from the current session the last time the
* retained data was updated.
*/
uint64_t uptime_latest;
/* Cumulative uptime fr... | /content/code_sandbox/samples/boards/nrf/system_off/src/retained.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 277 |
```unknown
/ {
cpuapp_sram@2002e000 {
compatible = "zephyr,memory-region", "mmio-sram";
reg = <0x2002e000 DT_SIZE_K(4)>;
zephyr,memory-region = "RetainedMem";
status = "okay";
retainedmem0: retainedmem {
compatible = "zephyr,retained-ram";
status = "okay";
};
};
aliases {
retainedmemdevice = &r... | /content/code_sandbox/samples/boards/nrf/system_off/boards/nrf54l15pdk_nrf54l15_cpuapp_retained_mem.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 176 |
```unknown
&timer0 {
status = "okay";
};
``` | /content/code_sandbox/samples/boards/nrf/clock_skew/app.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 11 |
```c
/*
*
*/
#include "retained.h"
#include <stdint.h>
#include <string.h>
#include <zephyr/kernel.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/retained_mem.h>
#include <zephyr/sys/byteorder.h>
#include <zephyr/sys/crc.h>
#if CONFIG_APP_USE_NRF_RETENTION
#include <hal/nrf_power.h>
/* nRF52 RAM (rea... | /content/code_sandbox/samples/boards/nrf/system_off/src/retained.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,526 |
```unknown
config APP_ENABLE_HFXO
bool "Use HFXO as HFCLK source"
help
Turn on the high-frequency clock, which means switching to the
crystal as a source rather than the internal oscillator.
source "Kconfig.zephyr"
``` | /content/code_sandbox/samples/boards/nrf/clock_skew/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 55 |
```unknown
CONFIG_COUNTER=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_REQUIRES_FLOAT_PRINTF=y
``` | /content/code_sandbox/samples/boards/nrf/clock_skew/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 20 |
```yaml
sample:
name: Clock Skew Sample for nRF
tests:
sample.boards.nrf.clock_skew:
build_only: true
platform_allow:
- nrf52840dk/nrf52840
- nrf52dk/nrf52832
- nrf51dk/nrf51822
tags: power
integration_platforms:
- nrf52840dk/nrf52840
``` | /content/code_sandbox/samples/boards/nrf/clock_skew/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 92 |
```restructuredtext
.. _nrf-clock-skew-sample:
nRF5x Clock Skew Demo
#####################
Overview
********
This sample uses the API for correlating time sources to measure the
skew between HFCLK (used for the CPU) and LFCLK (used for system time).
It also shows how to use this skew to correct durations measured in... | /content/code_sandbox/samples/boards/nrf/clock_skew/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 2,203 |
```restructuredtext
.. _nrf-ieee802154-rpmsg-sample:
nRF IEEE 802.15.4: Serialization RPMsg
######################################
Overview
********
This sample exposes IEEE 802.15.4 radio driver support
to another device or CPU using the RPMsg transport which is
a part of `OpenAMP <path_to_url`__.
Requirements
***... | /content/code_sandbox/samples/boards/nrf/ieee802154/802154_rpmsg/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 277 |
```unknown
## Disable serial and UART interface.
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_LOG=n
CONFIG_NRF_802154_SER_RADIO=y
``` | /content/code_sandbox/samples/boards/nrf/ieee802154/802154_rpmsg/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 31 |
```yaml
sample:
description: Allows Zephyr to provide 802.15.4 connectivity
for nRF devices via RPMsg.
name: 802.15.4 RPMsg serialization
tests:
sample.boards.nrf.802154_rpmsg:
build_only: true
platform_allow:
- nrf5340dk/nrf5340/cpunet
- nrf5340bsim/nrf5340/cpunet
``` | /content/code_sandbox/samples/boards/nrf/ieee802154/802154_rpmsg/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 97 |
```c
/*
*
*/
#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/timeutil.h>
#include <zephyr/drivers/clock_control.h>
#include <zephyr/drivers/clock_control/nrf_clock_control.h>
#include <zephyr/drivers/counter.h>
#include <nrfx_clock.h>
#define UPDATE_INTERVAL_S 10
static const struct device *cons... | /content/code_sandbox/samples/boards/nrf/clock_skew/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 2,088 |
```cmake
if("${SB_CONFIG_NET_CORE_BOARD}" STREQUAL "")
message(FATAL_ERROR
"Target ${BOARD} not supported for this sample. "
"There is no remote board selected in Kconfig.sysbuild")
endif()
set(REMOTE_APP net)
ExternalZephyrProject_Add(
APPLICATION ${REMOTE_APP}
SOURCE_DIR ${APP_DIR}/${REMOTE_APP}
BOARD ... | /content/code_sandbox/samples/boards/nrf/nrf53_sync_rtc/sysbuild.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 113 |
```c
/*
*
*/
#include <zephyr/sys/__assert.h>
#include <zephyr/kernel.h>
#include <nrf_802154_serialization_error.h>
void nrf_802154_serialization_error(const nrf_802154_ser_err_data_t *err)
{
(void)err;
__ASSERT(false, "802.15.4 serialization error");
k_oops();
}
void nrf_802154_sl_fault_handler(uint32_t id, ... | /content/code_sandbox/samples/boards/nrf/ieee802154/802154_rpmsg/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 137 |
```unknown
#
source "share/sysbuild/Kconfig"
config NET_CORE_BOARD
string
default "nrf5340dk/nrf5340/cpunet" if $(BOARD) = "nrf5340dk"
default "nrf5340bsim/nrf5340/cpunet" if $(BOARD_TARGET_STRING) = "NRF5340BSIM_NRF5340_CPUAPP"
``` | /content/code_sandbox/samples/boards/nrf/nrf53_sync_rtc/Kconfig.sysbuild | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 81 |
```unknown
CONFIG_SOC_NRF53_CPUNET_ENABLE=y
CONFIG_LOG=y
CONFIG_NRF53_SYNC_RTC=y
CONFIG_IPM=n
CONFIG_MBOX=y
``` | /content/code_sandbox/samples/boards/nrf/nrf53_sync_rtc/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 33 |
```yaml
sample:
description: This app shows how RTCs are synchronized
on nrf53 cores.
name: nRF53 Synchronized RTC sample
common:
sysbuild: true
tests:
sample.boards.nrf.nrf53_sync_rtc.real_hw:
platform_allow:
- nrf5340dk/nrf5340/cpuapp
integration_platforms:
- nrf5340dk/nrf5340/cpuapp... | /content/code_sandbox/samples/boards/nrf/nrf53_sync_rtc/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 209 |
```unknown
CONFIG_LOG=y
CONFIG_NRF53_SYNC_RTC=y
CONFIG_MBOX=y
CONFIG_IPM=n
``` | /content/code_sandbox/samples/boards/nrf/nrf53_sync_rtc/net/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 23 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/drivers/mbox.h>
#include <hal/nrf_ipc.h>
#include <zephyr/drivers/ipm.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/timer/nrf_rtc_timer.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(main);
#if (CONFIG_SOC_SERIES_BSIM_NRFXX)
extern uint32... | /content/code_sandbox/samples/boards/nrf/nrf53_sync_rtc/net/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 410 |
```unknown
CONFIG_BUILD_OUTPUT_EXE=n
``` | /content/code_sandbox/samples/boards/nrf/nrf53_sync_rtc/net/boards/nrf5340bsim_nrf5340_cpunet.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 8 |
```restructuredtext
.. _nrf53_sync_rtc_sample:
Synchronized RTC
################
Overview
********
Sample is showing how RTC clocks used for system clock on application and network
core are synchronized. The result of synchronization is an offset value on network
core which can be applied to the system tick for logg... | /content/code_sandbox/samples/boards/nrf/nrf53_sync_rtc/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,249 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <hal/nrf_ipc.h>
#include <zephyr/sys/printk.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(main);
#if (CONFIG_SOC_SERIES_BSIM_NRFXX)
#include "nsi_cpu_if.h"
/* For simulation, we can define shared memory variables linkable from
* ... | /content/code_sandbox/samples/boards/nrf/nrf53_sync_rtc/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 320 |
```unknown
CONFIG_LOG=y
CONFIG_PRINTK=y
CONFIG_SPI=y
CONFIG_I2C=y
CONFIG_GPIO=y
# config sensors
CONFIG_SENSOR=y
CONFIG_SENSOR_LOG_LEVEL_DBG=y
CONFIG_STTS22H_TRIGGER_NONE=y
CONFIG_IIS2MDC_TRIGGER_OWN_THREAD=y
CONFIG_IIS2DLPC_TRIGGER_OWN_THREAD=y
CONFIG_ISM330DHCX_TRIGGER_OWN_THREAD=y
CONFIG_IIS2ICLX_TRIGGER_OWN_THREAD... | /content/code_sandbox/samples/boards/steval_stwinbx1/sensors/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 105 |
```yaml
sample:
description: STWIN.box board testing
name: STWIN.box board test
tests:
sample.board.steval_stwinbx1.sensors:
harness: sensor
platform_allow: steval_stwinbx1
tags: sensors
depends_on:
- i2c
- spi
- gpio
``` | /content/code_sandbox/samples/boards/steval_stwinbx1/sensors/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 74 |
```restructuredtext
.. _steval_stwinbx1_sample_sensors:
STWIN.box on-board sensors test
###############################
Overview
********
This sample provides an example of how to read sensors data
from the STWIN.box board.
This sample enables all sensors of STWIN.box board, and then
periodically reads and displays ... | /content/code_sandbox/samples/boards/steval_stwinbx1/sensors/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 754 |
```unknown
/*
*
*/
&rtc {
status = "okay";
wakeup-source;
};
``` | /content/code_sandbox/samples/boards/mimxrt595_evk/system_off/app.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 17 |
```restructuredtext
.. _mimxrt595_evk-system-off-sample:
RT595 System Off demo
#####################
Overview
********
This sample can be used for basic power measurement and as an example of
soft off on NXP i.MX RT platforms. The functional behavior is:
* Busy-wait for 2 seconds
* Turn the system off after enablin... | /content/code_sandbox/samples/boards/mimxrt595_evk/system_off/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,407 |
```unknown
#
mainmenu "MIMXRT595_EVK_CM33 SYSTEM_OFF demo"
source "Kconfig.zephyr"
``` | /content/code_sandbox/samples/boards/mimxrt595_evk/system_off/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 26 |
```unknown
#
#
#
CONFIG_POWEROFF=y
# Enable the RTC
CONFIG_COUNTER=y
``` | /content/code_sandbox/samples/boards/mimxrt595_evk/system_off/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 20 |
```yaml
#
#
#
sample:
name: Deep Power Down State Sample for mimxrt595_evk
common:
tags: power
tests:
sample.boards.mimxrt595_evk.system_off:
build_only: true
platform_allow: mimxrt595_evk/mimxrt595s/cm33
``` | /content/code_sandbox/samples/boards/mimxrt595_evk/system_off/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 70 |
```c
/*
*
*/
#include <stdio.h>
#include <zephyr/drivers/counter.h>
#include <zephyr/sys/poweroff.h>
#include <zephyr/sys_clock.h>
int main(void)
{
int ret;
const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(rtc));
struct counter_alarm_cfg alarm_cfg = { 0 };
if (!device_is_ready(dev)) {
printf("Counter d... | /content/code_sandbox/samples/boards/mimxrt595_evk/system_off/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 226 |
```restructuredtext
.. _i2s_litex_example:
#####################
I2S example
#####################
Overview
********
This is a simple I2S audio transceiver example. You can plug any source of music and listen to it.
Audio Format
************
The driver requires and provides Audio data with the following parameters... | /content/code_sandbox/samples/boards/litex/i2s/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 156 |
```unknown
CONFIG_LOG=y
CONFIG_I2S=y
CONFIG_I2S_LITEX_RX_BLOCK_COUNT=500
CONFIG_I2S_LITEX_DATA_BIG_ENDIAN=n
CONFIG_ETH_LITEX_LITEETH=n
``` | /content/code_sandbox/samples/boards/litex/i2s/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 46 |
```yaml
sample:
description: I2S sample
name: i2s example
tests:
sample.drivers.i2s.litex:
tags: introduction
harness: console
platform_allow: litex_vexriscv
harness_config:
type: one_line
regex:
- "i2s example (.*)"
``` | /content/code_sandbox/samples/boards/litex/i2s/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 77 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/led.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/sensor.h>
#include <stdio.h>
#ifdef CONFIG_STTS22H_TRIGGER
static int stts22h_trig_cnt;
... | /content/code_sandbox/samples/boards/steval_stwinbx1/sensors/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 3,852 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/i2s.h>
#include <stdlib.h>
#include <string.h>
#define AUDIO_SAMPLE_FREQ (44100)
#define AUDIO_SAMPLES_PER_CH_PER_FRAME (128)
#define AUDIO_NUM_CHANNELS (2)
#define AUDIO_SAMPLES_PER_FRAME ... | /content/code_sandbox/samples/boards/litex/i2s/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,028 |
```unknown
CONFIG_POWEROFF=y
CONFIG_STM32_WKUP_PINS=y
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/wkup_pins/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 19 |
```restructuredtext
.. _gpio-as-a-wkup-pin-src-sample:
GPIO As A Wake-up Pin Source
############################
Overview
********
This sample is a minimum application to demonstrate using a wake-up pin with a GPIO as
a source to power on an STM32 SoC after Poweroff.
The system will power off automatically ``WAIT_T... | /content/code_sandbox/samples/boards/stm32/power_mgmt/wkup_pins/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 286 |
```yaml
sample:
name: GPIO As A Wake-up Pin Source
tests:
sample.boards.stm32.power_mgmt.wkup_pins:
build_only: true
filter: dt_enabled_alias_with_parent_compat("wkup-src",
"gpio-keys") and dt_compat_enabled("st,stm32-pwr")
platform_allow:
- nucleo_l4r5zi
- nucleo_u575zi_q
- nucl... | /content/code_sandbox/samples/boards/stm32/power_mgmt/wkup_pins/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 110 |
```unknown
/*
*
*/
/ {
aliases {
wkup-src = &user_button_1;
};
};
&pwr {
status = "okay";
};
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/wkup_pins/boards/nucleo_wl55jc.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 32 |
```unknown
/*
*
*/
/ {
aliases {
wkup-src = &user_button;
};
};
&pwr {
status = "okay";
};
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/wkup_pins/boards/nucleo_u575zi_q.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 30 |
```unknown
/*
*
*/
/ {
aliases {
wkup-src = &user_button;
};
};
&pwr {
status = "okay";
};
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/wkup_pins/boards/nucleo_u5a5zj_q.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 30 |
```unknown
/*
*
*/
/ {
aliases {
wkup-src = &user_button;
};
};
&pwr {
status = "okay";
};
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/wkup_pins/boards/nucleo_l4r5zi.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 30 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/poweroff.h>
#include <zephyr/dt-bindings/gpio/stm32-gpio.h>
#define WAIT_TIME_US 4000000
#define WKUP_SRC_NODE DT_ALIAS(wkup_src)
#i... | /content/code_sandbox/samples/boards/stm32/power_mgmt/wkup_pins/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 343 |
```unknown
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y
CONFIG_PM_DEVICE_SYSTEM_MANAGED=y
CONFIG_ASSERT=y
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/blinky/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```restructuredtext
.. _stm32-pm-blinky-sample:
STM32 PM Blinky
###############
Overview
********
This sample is a minimum application to demonstrate basic power management
behavior in a basic blinking LED set up using the :ref:`GPIO API <gpio_api>` in
low power context.
Note that lptim instance selected for the low... | /content/code_sandbox/samples/boards/stm32/power_mgmt/blinky/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 425 |
```yaml
sample:
name: STM32 GPIO Power Management
tests:
sample.boards.stm32.power_mgmt.blinky:
tags:
- LED
- power
harness: console
harness_config:
type: one_line
regex:
- "Device ready"
filter: dt_compat_enabled("zephyr,power-state") and
dt_enabled_alias... | /content/code_sandbox/samples/boards/stm32/power_mgmt/blinky/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 159 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/printk.h>
#define SLEEP_TIME_MS 2000
static const struct gpio_dt_spec led =
GPIO_DT_SPEC_GET(DT_ALIAS(led0), gpios);
int main(void)
{
bool led_is_on = true;
... | /content/code_sandbox/samples/boards/stm32/power_mgmt/blinky/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 251 |
```unknown
# Disable DEBUG in order to enter core low power states.
# WARNING: requires to erase the device (using STM32CubeProgrammer for instance)
# for next flashing actions
CONFIG_DEBUG=y
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/blinky/boards/stm32l562e_dk.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 41 |
```unknown
/*
* give a prescaler to the lptim clock : LSE / 16 = 2048Hz
* so that the sleep period is of 32s in the sample application
* with a LPTIM1 prescaler of <1> to <8>, CONFIG_SYS_CLOCK_TICKS_PER_SEC is 4096
* with a LPTIM1 prescaler >= <16>, CONFIG_SYS_CLOCK_TICKS_PER_SEC is LSE / prescaler
*/
&stm32... | /content/code_sandbox/samples/boards/stm32/power_mgmt/blinky/boards/b_u585i_iot02a.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 119 |
```unknown
# Increase IDLE stack for the IDLE timer
CONFIG_IDLE_STACK_SIZE=640
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/blinky/boards/nucleo_f429zi.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 19 |
```unknown
/*
*
*/
/ {
chosen {
zephyr,cortex-m-idle-timer = &rtc;
};
};
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/blinky/boards/nucleo_f429zi.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 27 |
```unknown
/*
* give a prescaler to the lptim clock : LSE / 32 = 1024Hz
* so that the sleep period is of 64s in the sample application
* with a LPTIM1 prescaler of <1> to <8>, CONFIG_SYS_CLOCK_TICKS_PER_SEC is 4096
* with a LPTIM1 prescaler >= <16>, CONFIG_SYS_CLOCK_TICKS_PER_SEC is LSE / prescaler
*/
&stm32... | /content/code_sandbox/samples/boards/stm32/power_mgmt/blinky/boards/nucleo_wb55rg.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 119 |
```restructuredtext
.. _stm32-pm-stop3:
STM32 PM STOP3 mode
###################
Overview
********
This sample is a minimum application to demonstrate basic power management
behavior in a basic blinking LED set up and STM32U5 STOP3 low power mode.
.. _stm32-pm-stop3-requirements:
Requirements
************
At the m... | /content/code_sandbox/samples/boards/stm32/power_mgmt/stop3/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 217 |
```unknown
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y
CONFIG_PM_DEVICE_SYSTEM_MANAGED=y
CONFIG_ASSERT=y
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/stop3/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/printk.h>
#include <stm32u5xx_ll_pwr.h>
#include <gpio/gpio_stm32.h>
#define SLEEP_TIME_MS 2000
static const struct gpio_dt_spec led =
GPIO_DT_SPEC_GET(DT_ALIAS... | /content/code_sandbox/samples/boards/stm32/power_mgmt/stop3/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 455 |
```yaml
sample:
name: STM32 STOP3 Power Management
tests:
sample.boards.stm32.power_mgmt.stop3:
tags:
- LED
- power
harness: console
platform_allow: nucleo_u575zi_q
harness_config:
type: one_line
regex:
- "Device ready"
extra_args: "CONFIG_DEBUG=y"
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/stop3/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 82 |
```unknown
/*
*
*/
/ {
chosen {
st,lptim-stdby-timer = &rtc;
};
};
&cpu0 {
cpu-power-states = <&stop0 &stop1 &stop2 &stop3>;
};
&rtc {
status = "okay";
clocks = <&rcc STM32_CLOCK_BUS_APB3 0x00200000>,
<&rcc STM32_SRC_LSI RTC_SEL(2)>;
prescaler = <32768>;
};
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/stop3/boards/nucleo_u575zi_q.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 102 |
```unknown
CONFIG_PM=y
CONFIG_PM_DEVICE=n
CONFIG_PM_DEVICE_RUNTIME=n
CONFIG_HWINFO=y
CONFIG_POWEROFF=y
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/standby_shutdown/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```restructuredtext
.. _stm32-pm-standby_shutdown-sample:
STM32 PM Standby shutdown
#########################
Overview
********
This sample is a minimum application to demonstrate basic power management of Standby mode and
shutdown mode
behavior in a basic blinking LED set up you can enter in shutdown mode or in sta... | /content/code_sandbox/samples/boards/stm32/power_mgmt/standby_shutdown/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 355 |
```yaml
sample:
name: STM32 GPIO Power Management
tests:
sample.boards.stm32.power_mgmt.standby_shutdown:
platform_allow:
- nucleo_l476rg
- disco_l475_iot1
tags:
- LED
- power
harness: console
harness_config:
type: multi_line
regex:
- "Reset cause: Reset p... | /content/code_sandbox/samples/boards/stm32/power_mgmt/standby_shutdown/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 185 |
```restructuredtext
.. _boards-stm32-power_mgmt-stm32wb_ble-sample:
STM32: PM BLE Power Management (STM32WB)
########################################
Overview
********
A simple application demonstrating the BLE operations (advertising) with
Zephyr power management enabled (:kconfig:option:`CONFIG_PM`).
After startu... | /content/code_sandbox/samples/boards/stm32/power_mgmt/stm32wb_ble/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 179 |
```unknown
CONFIG_BT=y
CONFIG_BT_DEVICE_NAME="Test beacon"
CONFIG_POWEROFF=y
CONFIG_PM=y
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/stm32wb_ble/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 24 |
```yaml
sample:
name: Bluetooth shutdown
tests:
sample.boards.stm32.pm.stm32wb_ble_pm:
harness: bluetooth
platform_allow: nucleo_wb55rg
tags:
- bluetooth
- pm
extra_args: "CONFIG_DEBUG=y"
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/stm32wb_ble/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 62 |
```c
/*
*
*/
#include <zephyr/drivers/hwinfo.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/printk.h>
#include <zephyr/pm/pm.h>
#include <zephyr/sys/poweroff.h>
#include <stm32_ll_pwr.h>
#if !defined(CONFIG_SOC_SERIES_STM... | /content/code_sandbox/samples/boards/stm32/power_mgmt/standby_shutdown/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,102 |
```c
/* main.c - Application main entry point */
/*
*
*/
#include <zephyr/types.h>
#include <zephyr/device.h>
#include <stddef.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/poweroff.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/hci.h>
#define DEVICE_NA... | /content/code_sandbox/samples/boards/stm32/power_mgmt/stm32wb_ble/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 933 |
```unknown
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y
CONFIG_PM_DEVICE_SYSTEM_MANAGED=n
CONFIG_SHELL=y
CONFIG_DEBUG=n
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/serial_wakeup/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 33 |
```yaml
sample:
name: STM32 Power Management Serial Wakeup
tests:
sample.boards.stm32.power_mgmt.serial_wakeup:
tags:
- UART
- power
harness: console
harness_config:
type: multi_line
regex:
- "Device is wakeup capable"
- "Wakeup source enable ok"
- "Wakeup... | /content/code_sandbox/samples/boards/stm32/power_mgmt/serial_wakeup/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 131 |
```restructuredtext
.. _stm32-pm-serial-wakeup-sample:
STM32 PM Serial wakeup
######################
Overview
********
This sample is a minimum application to demonstrate serial wakeup functionality
in low power context.
.. _stm32-pm-serial-wakeup-sample-requirements:
Requirements
************
1. The board should... | /content/code_sandbox/samples/boards/stm32/power_mgmt/serial_wakeup/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 667 |
```unknown
/*
*
*/
&cpu0{
/* USART Wakeup requires automatic HSI16 switch on in deepsleep mode
* which isn't possible in Stop Mode 2.
* Remove Stop Mode 2 from supported modes
*/
cpu-power-states = <&stop0 &stop1>;
};
&usart1 {
/* Set domain clock to HSI to allow wakeup from Stop mode */
clocks = <&rcc ST... | /content/code_sandbox/samples/boards/stm32/power_mgmt/serial_wakeup/boards/b_u585i_iot02a.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 241 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/pm/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/__assert.h>
int main(void)
{
const struct device *const dev =
DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
if (!device_is_ready(dev)) ... | /content/code_sandbox/samples/boards/stm32/power_mgmt/serial_wakeup/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 319 |
```unknown
/*
*
*/
&lpuart1 {
/* Set domain clock to LSE to allow wakeup from Stop mode */
clocks = <&rcc STM32_CLOCK_BUS_APB1_2 0x00000001>,
<&rcc STM32_SRC_LSE LPUART1_SEL(3)>;
/* LPUART1 clock source on LSE : set console at 9600 */
current-speed = <9600>;
/* Enable as wakeup source */
wakeup-source;
... | /content/code_sandbox/samples/boards/stm32/power_mgmt/serial_wakeup/boards/nucleo_wl55jc.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 141 |
```unknown
/*
*
*/
&cpu0{
/* USART Wakeup requires automatic HSI16 switch on in deepsleep mode
* which isn't possible in Stop Mode 2.
* Remove Stop Mode 2 from supported modes
*/
cpu-power-states = <&stop0 &stop1>;
};
&usart1 {
/* Set domain clock to HSI to allow wakeup from Stop mode */
clocks = <&rcc ST... | /content/code_sandbox/samples/boards/stm32/power_mgmt/serial_wakeup/boards/nucleo_wb55rg.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 240 |
```unknown
/ {
chosen {
/* Comment out these lines to use usart1 as console/shell */
zephyr,console = &lpuart1;
zephyr,shell-uart = &lpuart1;
};
};
&clk_lse {
status = "okay";
};
&clk_hsi {
/* Comment out this line to use HSI as clk source */
status = "disabled";
};
&lpuart1 {
pinctrl-0 = <&lpuart1_rx_pb... | /content/code_sandbox/samples/boards/stm32/power_mgmt/serial_wakeup/boards/stm32l562e_dk.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 361 |
```unknown
/*
*
*/
&usart3 {
/* Set domain clock to HSI to allow wakeup from Stop mode */
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00040000>,
<&rcc STM32_SRC_HSI USART3_SEL(3)>;
/* Configure device as wakeup source */
wakeup-source;
/* Enable FIFO to avoid losing chars on device wakeup */
fifo-enable;
/* C... | /content/code_sandbox/samples/boards/stm32/power_mgmt/serial_wakeup/boards/nucleo_h563zi.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 181 |
```unknown
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y
CONFIG_PM_DEVICE_SYSTEM_MANAGED=y
CONFIG_PM_S2RAM=y
CONFIG_ADC=y
CONFIG_ENTROPY_GENERATOR=y
CONFIG_SPI=y
CONFIG_SPI_STM32_DMA=y
CONFIG_SPI_STM32_INTERRUPT=n
CONFIG_SPI_ASYNC=n
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/suspend_to_ram/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 68 |
```yaml
sample:
name: STM32 PM Standby Power Management
tests:
sample.boards.stm32.power_mgmt.suspend_to_ram:
tags:
- power
harness: console
harness_config:
type: one_line
regex:
- "Exit Standby"
filter: dt_compat_enabled("zephyr,power-state") and
dt_enabled_ali... | /content/code_sandbox/samples/boards/stm32/power_mgmt/suspend_to_ram/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 131 |
```restructuredtext
.. _stm32-pm-suspend-to-ram-sample:
STM32 PM Suspend to RAM
#######################
Overview
********
This sample is a minimum application to demonstrate basic power management
behavior in a basic blinking LED set up using the :ref:`GPIO API <gpio_api>` in
low power context + ADC measurements and... | /content/code_sandbox/samples/boards/stm32/power_mgmt/suspend_to_ram/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 327 |
```yaml
#
#
#
description: |
This binding provides resources required to build and run an SPI
loopback test under power management conditions
compatible: "test-spi-loopback"
include: [spi-device.yaml]
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/suspend_to_ram/dts/bindings/test-spi-loopback.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 45 |
```unknown
/*
*
*/
/ {
/* Change min residency time to ease power consumption measurement */
cpus {
cpu0: cpu@0 {
cpu-power-states = <&stop0 &stop1 &standby>;
};
power-states {
stop0: state0 {
min-residency-us = <500000>;
exit-latency-us = <50>;
};
stop1: state1 {
min-residency-us = ... | /content/code_sandbox/samples/boards/stm32/power_mgmt/suspend_to_ram/boards/nucleo_wba55cg.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 411 |
```restructuredtext
.. _stm32-pm-adc-sample:
STM32 PM ADC
############
Overview
********
This sample is a minimum application to demonstrate basic power management
behavior in a basic ADC set up in low power context.
.. _stm32-pm-adc-sample-requirements:
Requirements
************
The board should support enabling... | /content/code_sandbox/samples/boards/stm32/power_mgmt/adc/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 312 |
```unknown
CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y
CONFIG_PM_DEVICE_SYSTEM_MANAGED=y
CONFIG_ADC=y
#CONFIG_DEBUG=y
``` | /content/code_sandbox/samples/boards/stm32/power_mgmt/adc/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 33 |
```yaml
sample:
name: STM32 ADC Power Management
tests:
sample.boards.stm32.power_mgmt.adc:
tags:
- adc
- power
harness: console
harness_config:
type: one_line
regex:
- "Device ready"
filter: dt_compat_enabled("zephyr,power-state") and
dt_compat_enabled("s... | /content/code_sandbox/samples/boards/stm32/power_mgmt/adc/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 124 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/adc.h>
#include <zephyr/sys/printk.h>
#define SLEEP_TIME_MS 2000
#if !DT_NODE_EXISTS(DT_PATH(zephyr_user)) || \
!DT_NODE_HAS_PROP(DT_PATH(zephyr_user), io_channels)
#error "No suitable devi... | /content/code_sandbox/samples/boards/stm32/power_mgmt/adc/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 698 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/printk.h>
#include <zephyr/pm/pm.h>
#include <zephyr/pm/device_runtime.h>
#include <zephyr/drivers/adc.h>
#include <zephyr/drivers/entropy.h>
#include <zephyr/driver... | /content/code_sandbox/samples/boards/stm32/power_mgmt/suspend_to_ram/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,767 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/adc/adc.h>
/ {
zephyr,user {
/* adjust channel number according to pinmux in board.dts */
io-channels = <&adc1 1>;
};
};
&adc1 {
#address-cells = <1>;
#size-cells = <0>;
channel@1 {
reg = <1>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_IN... | /content/code_sandbox/samples/boards/stm32/power_mgmt/adc/boards/nucleo_g474re.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 142 |
```unknown
/*
*
*/
/ {
zephyr,user {
/* adjust channel number according to pinmux in board.dts */
io-channels = <&adc1 3>;
};
};
&adc1 {
pinctrl-0 = <&adc1_in3_pc2>;
#address-cells = <1>;
#size-cells = <0>;
channel@3 {
reg = <3>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
... | /content/code_sandbox/samples/boards/stm32/power_mgmt/adc/boards/nucleo_wb55rg.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 142 |
```unknown
/*
*
*/
/ {
zephyr,user {
/* adjust channel number according to pinmux in board.dts */
io-channels = <&adc4 8>;
};
};
&adc4 {
pinctrl-0 = <&adc4_in8_pa1>;
#address-cells = <1>;
#size-cells = <0>;
channel@8 {
reg = <8>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
... | /content/code_sandbox/samples/boards/stm32/power_mgmt/adc/boards/nucleo_wba52cg.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 142 |
```unknown
# Set MCO1 source to desired clock.
CONFIG_CLOCK_STM32_MCO1_SRC_LSE=y
CONFIG_CLOCK_STM32_MCO1_DIV=1
``` | /content/code_sandbox/samples/boards/stm32/mco/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```restructuredtext
.. _samples_boards_stm32_mco:
STM32 MCO example
#################
Overview
********
This sample is a minimum application to demonstrate how to output one of the internal clocks for
external use by the application.
Requirements
************
The SoC should support MCO functionality and use a pin ... | /content/code_sandbox/samples/boards/stm32/mco/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 182 |
```yaml
sample:
name: STM32 microcontroller clock output (MCO) example
tests:
sample.board.stm32.mco:
platform_allow: nucleo_u5a5zj_q
tags: board
``` | /content/code_sandbox/samples/boards/stm32/mco/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 48 |
```unknown
/* The clock that is output must be enabled. */
&clk_lse {
status = "okay";
};
/ {
zephyr,user {
/* Select MCO pin to use. */
pinctrl-0 = <&rcc_mco_pa8>;
pinctrl-names = "default";
};
};
``` | /content/code_sandbox/samples/boards/stm32/mco/boards/nucleo_u5a5zj_q.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 69 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/drivers/pinctrl.h>
/* Define the pinctrl information for the MCO pin. */
PINCTRL_DT_DEFINE(DT_PATH(zephyr_user));
int main(void)
{
/* Configure the MCO pin using pinctrl in order to set the alternate function of the pin. */
const struct pinctrl_dev_config ... | /content/code_sandbox/samples/boards/stm32/mco/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 136 |
```unknown
CONFIG_I2C=y
CONFIG_I2C_STM32_V2_TIMING=y
CONFIG_LOG=y
CONFIG_I2C_LOG_LEVEL_INF=y
``` | /content/code_sandbox/samples/boards/stm32/i2c_timing/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 33 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.