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 |
|---|---|---|---|---|---|---|---|---|
```unknown
/*
*/
&uart120 {
status = "reserved";
interrupt-parent = <&cpuflpr_clic>;
};
``` | /content/code_sandbox/snippets/nordic-flpr/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 25 |
```unknown
/*
*/
/ {
soc {
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
cpuflpr_code_partition: image@165000 {
/* FLPR core code partition */
reg = <0x165000 DT_SIZE_K(96)>;
};
};
cpuflpr_sram_code_data: memory@20028000 {
compatible = "mmio-sram";
reg = <0x20028000 DT_S... | /content/code_sandbox/snippets/nordic-flpr/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 260 |
```yaml
name: nordic-ppr-xip
append:
EXTRA_DTC_OVERLAY_FILE: nordic-ppr-xip.overlay
boards:
nrf54h20dk/nrf54h20/cpuapp:
append:
EXTRA_DTC_OVERLAY_FILE: boards/nrf54h20dk_nrf54h20_cpuapp.overlay
``` | /content/code_sandbox/snippets/nordic-ppr-xip/snippet.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 74 |
```restructuredtext
.. _nordic-ppr-xip:
Nordic boot PPR snippet with execution in place (nordic-ppr-xip)
################################################################
Overview
********
This snippet allows users to build Zephyr with the capability to boot Nordic PPR
(Peripheral Processor) from another core. PPR co... | /content/code_sandbox/snippets/nordic-ppr-xip/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 107 |
```unknown
/*
*/
&cpuppr_vpr {
status = "okay";
};
``` | /content/code_sandbox/snippets/nordic-ppr-xip/nordic-ppr-xip.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 16 |
```restructuredtext
.. _nordic-ppr:
Nordic PPR snippet (nordic-ppr)
###############################
Overview
********
This snippet allows users to build Zephyr with the capability to boot Nordic PPR
(Peripheral Processor) from another core.
``` | /content/code_sandbox/snippets/nordic-ppr/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 56 |
```unknown
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_UART_CONSOLE=n
``` | /content/code_sandbox/snippets/rtt-console/rtt-console.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 20 |
```yaml
name: rtt-console
append:
EXTRA_CONF_FILE: rtt-console.conf
``` | /content/code_sandbox/snippets/rtt-console/snippet.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 19 |
```restructuredtext
.. _snippet-rtt-console:
RTT Console Snippet (rtt-console)
#########################################
.. code-block:: console
west build -S rtt-console [...]
Overview
********
This snippet redirects serial console output to SEGGER RTT.
Requirements
************
Hardware support for:
- :kco... | /content/code_sandbox/snippets/rtt-console/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 84 |
```yaml
#
#
#
name: ram-console
append:
EXTRA_CONF_FILE: ram-console.conf
boards:
imx8mm_evk/mimx8mm6/a53:
append:
EXTRA_DTC_OVERLAY_FILE: boards/imx8mm_evk_mimx8mm6_a53.overlay
imx8mm_evk/mimx8mm6/a53/smp:
append:
EXTRA_DTC_OVERLAY_FILE: boards/imx8mm_evk_mimx8mm6_a53.overlay
imx8mn_evk/m... | /content/code_sandbox/snippets/ram-console/snippet.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 332 |
```restructuredtext
.. _snippet-ram-console:
RAM Console Snippet (ram-console)
#################################
.. code-block:: console
west build -S ram-console [...]
Overview
********
This snippet redirects console output to a RAM buffer. The RAM console
buffer is a global array located in RAM region by defa... | /content/code_sandbox/snippets/ram-console/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 231 |
```unknown
#
#
# Disable UART Console
CONFIG_UART_CONSOLE=n
# Enable RAM Console
CONFIG_RAM_CONSOLE=y
``` | /content/code_sandbox/snippets/ram-console/ram-console.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 23 |
```unknown
/*
*
*/
/ {
chosen {
zephyr,ram-console = &snippet_ram_console;
};
snippet_ram_console: memory@c0100000 {
compatible = "zephyr,memory-region";
reg = <0xc0100000 DT_SIZE_K(4)>;
zephyr,memory-region = "RAM_CONSOLE";
};
};
``` | /content/code_sandbox/snippets/ram-console/boards/imx8mp_evk_mimx8ml8_a53.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 78 |
```unknown
/*
*
*/
/ {
chosen {
zephyr,ram-console = &snippet_ram_console;
};
snippet_ram_console: memory@93d00000 {
compatible = "zephyr,memory-region";
reg = <0x93d00000 DT_SIZE_K(4)>;
zephyr,memory-region = "RAM_CONSOLE";
};
};
``` | /content/code_sandbox/snippets/ram-console/boards/imx8mn_evk_mimx8mn6_a53.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 80 |
```unknown
/*
*
*/
/ {
chosen {
zephyr,ram-console = &snippet_ram_console;
};
snippet_ram_console: memory@93d00000 {
compatible = "zephyr,memory-region";
reg = <0x93d00000 DT_SIZE_K(4)>;
zephyr,memory-region = "RAM_CONSOLE";
};
};
``` | /content/code_sandbox/snippets/ram-console/boards/imx8mm_evk_mimx8mm6_a53.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 80 |
```unknown
/*
*
*/
/ {
chosen {
zephyr,ram-console = &snippet_ram_console;
};
snippet_ram_console: memory@d0100000 {
compatible = "zephyr,memory-region";
reg = <0xd0100000 DT_SIZE_K(4)>;
zephyr,memory-region = "RAM_CONSOLE";
};
};
``` | /content/code_sandbox/snippets/ram-console/boards/imx93_evk_mimx9352_a55.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 78 |
```yaml
name: cdc-acm-console
append:
EXTRA_CONF_FILE: cdc-acm-console.conf
EXTRA_DTC_OVERLAY_FILE: cdc-acm-console.overlay
``` | /content/code_sandbox/snippets/cdc-acm-console/snippet.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 38 |
```unknown
/*
*
*/
/ {
chosen {
zephyr,console = &snippet_cdc_acm_console_uart;
zephyr,shell-uart = &snippet_cdc_acm_console_uart;
};
};
&zephyr_udc0 {
snippet_cdc_acm_console_uart: snippet_cdc_acm_console_uart {
compatible = "zephyr,cdc-acm-uart";
};
};
``` | /content/code_sandbox/snippets/cdc-acm-console/cdc-acm-console.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 89 |
```unknown
/*
*/
&cpuppr_ram3x_region {
status = "okay";
};
&cpuppr_vpr {
execution-memory = <&cpuppr_code_partition>;
/delete-property/ source-memory;
};
&uart135 {
status = "reserved";
};
``` | /content/code_sandbox/snippets/nordic-ppr-xip/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 55 |
```unknown
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr USB console sample"
CONFIG_USB_DEVICE_PID=0x0004
CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_LINE_CTRL=y
``` | /content/code_sandbox/snippets/cdc-acm-console/cdc-acm-console.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 48 |
```restructuredtext
.. _snippet-cdc-acm-console:
CDC-ACM Console Snippet (cdc-acm-console)
#########################################
.. code-block:: console
west build -S cdc-acm-console [...]
Overview
********
This snippet redirects serial console output to a CDC ACM UART. The USB device
which should be used i... | /content/code_sandbox/snippets/cdc-acm-console/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 235 |
```restructuredtext
.. _samples-and-demos:
Samples and Demos
#################
.. toctree::
:titlesonly:
:maxdepth: 2
:glob:
sample_definition_and_criteria
classic
basic/*
userspace/*
sysbuild/*
subsys/subsys.rst
net/net.rst
bluetooth/bluetooth.rst
sensor/*
arch/*
boards/*
... | /content/code_sandbox/samples/index.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 155 |
```restructuredtext
.. _classic_samples:
Classic Samples
###############
The following are samples that can be run on any of the supported
platforms:
.. toctree::
:maxdepth: 1
:glob:
hello_world/*
synchronization/*
philosophers/*
``` | /content/code_sandbox/samples/classic.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 55 |
```restructuredtext
.. _cpp-samples:
C++ Samples
###########
.. toctree::
:maxdepth: 1
:glob:
**/*
``` | /content/code_sandbox/samples/cpp/cpp.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 33 |
```restructuredtext
.. _definition_and_criteria:
Sample Definition and Criteria
##############################
Definition
==========
A sample is a concise Zephyr application that provides an accessible overview of one or
more features, subsystems, or modules. This includes kernel services, drivers, protocols, etc.
S... | /content/code_sandbox/samples/sample_definition_and_criteria.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 825 |
```unknown
CONFIG_CPP=y
CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=128
``` | /content/code_sandbox/samples/cpp/cpp_synchronization/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 17 |
```restructuredtext
.. _cpp_synchronization:
C++ Synchronization
###################
Overview
********
The sample project illustrates usage of pure virtual class, member
functions with different types of arguments, global objects constructor
invocation.
A simple application demonstrates basic sanity of the kernel. ... | /content/code_sandbox/samples/cpp/cpp_synchronization/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 367 |
```yaml
sample:
name: Syncronisation (C++)
tests:
sample.cpp.synchronization:
tags: cpp
toolchain_exclude:
- issm
- xcc
integration_platforms:
- qemu_x86
harness: console
harness_config:
type: multi_line
regex:
- "Create semaphore (.*)"
- "main: Hell... | /content/code_sandbox/samples/cpp/cpp_synchronization/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 203 |
```restructuredtext
.. _hello_cpp_world:
Hello C++ World
###############
Overview
********
A simple :ref:`C++ <language_cpp>` sample that can be used with many supported board and prints
"Hello, C++ world!" to the console.
Building and Running
********************
This configuration can be built and executed on QE... | /content/code_sandbox/samples/cpp/hello_world/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 175 |
```unknown
CONFIG_CPP=y
CONFIG_REQUIRES_FULL_LIBCPP=y
``` | /content/code_sandbox/samples/cpp/hello_world/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 13 |
```yaml
sample:
description: Hello World C++ sample, the simplest C++ Zephyr application
name: hello cpp world
common:
tags: introduction
integration_platforms:
- qemu_riscv32
harness: console
harness_config:
type: one_line
regex:
- "Hello, C\\+\\+ world! (.*)"
tests:
sample.cpp.hellowor... | /content/code_sandbox/samples/cpp/hello_world/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 173 |
```c++
/*
*
*/
#include <iostream>
int main(void)
{
std::cout << "Hello, C++ world! " << CONFIG_BOARD << std::endl;
return 0;
}
``` | /content/code_sandbox/samples/cpp/hello_world/src/main.cpp | c++ | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 38 |
```c++
/*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
/**
* @file C++ Synchronization demo. Uses basic C++ functionality.
*/
#include <stdio.h>
#include <zephyr/kernel.h>
#include ... | /content/code_sandbox/samples/cpp/cpp_synchronization/src/main.cpp | c++ | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 823 |
```unknown
CONFIG_STDOUT_CONSOLE=y
# enable to use thread names
CONFIG_THREAD_NAME=y
CONFIG_SCHED_CPU_MASK=y
``` | /content/code_sandbox/samples/synchronization/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 25 |
```restructuredtext
.. zephyr:code-sample:: synchronization
:name: Basic Synchronization
:relevant-api: thread_apis semaphore_apis
Manipulate basic kernel synchronization primitives.
Overview
********
A simple application that demonstrates basic sanity of the kernel.
Two threads (A and B) take turns printin... | /content/code_sandbox/samples/synchronization/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 278 |
```yaml
sample:
description: A simple application that demonstrates
basic sanity of the kernel.
name: Synchronization Sample
tests:
sample.kernel.synchronization:
tags: synchronization
build_on_all: true
harness: console
harness_config:
type: multi_line
regex:
- "thread_a: ... | /content/code_sandbox/samples/synchronization/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 88 |
```restructuredtext
.. _basic-sample:
Basic Samples
#############
.. toctree::
:maxdepth: 1
:glob:
**/*
``` | /content/code_sandbox/samples/basic/basic.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 31 |
```restructuredtext
.. zephyr:code-sample:: servo-motor
:name: Servomotor
:relevant-api: pwm_interface
Drive a servomotor using the PWM API.
Overview
********
This is a sample app which drives a servomotor using the :ref:`PWM API <pwm_api>`.
The sample rotates a servomotor back and forth in the 180 degree ... | /content/code_sandbox/samples/basic/servo_motor/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 494 |
```c
/* main.c - Synchronization demo */
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
/*
* The synchronization demo has two threads that utilize semaphores and sleeping
* to take turns printing a greeting message at a controlled rate. The demo
* shows both the static and dynamic approaches ... | /content/code_sandbox/samples/synchronization/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 896 |
```yaml
sample:
name: Servo Motor using PWM
tests:
sample.basic.servo_motor:
tags:
- drivers
- pwm
depends_on: pwm
harness: motor
filter: dt_compat_enabled("pwm-servo")
integration_platforms:
- bbc_microbit
``` | /content/code_sandbox/samples/basic/servo_motor/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 66 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_PRINTK=y
CONFIG_PWM=y
``` | /content/code_sandbox/samples/basic/servo_motor/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 16 |
```yaml
description: PWM-driven servo motor.
compatible: "pwm-servo"
include: base.yaml
properties:
pwms:
required: true
type: phandle-array
description: PWM specifier driving the servo motor.
min-pulse:
required: true
type: int
description: Minimum pulse width (nanoseconds).
max-pul... | /content/code_sandbox/samples/basic/servo_motor/dts/bindings/pwm-servo.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 100 |
```unknown
/ {
servo: servo {
compatible = "pwm-servo";
pwms = <&sw_pwm 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
min-pulse = <PWM_USEC(700)>;
max-pulse = <PWM_USEC(2500)>;
};
};
&sw_pwm {
status = "okay";
clock-prescaler = <3>;
channel-gpios = <&edge_connector 19 GPIO_ACTIVE_HIGH>;
};
``` | /content/code_sandbox/samples/basic/servo_motor/boards/bbc_microbit.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 101 |
```unknown
/ {
servo: servo {
compatible = "pwm-servo";
pwms = <&ftm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; /* FMU_CH1 */
/* <&ftm0 3 PWM_MSEC(20) PWM_POLARITY_NORMAL>,*/ /* FMU_CH2 */
/* <&ftm0 4 PWM_MSEC(20) PWM_POLARITY_NORMAL>, */ /* FMU_CH3 */
/* <&ftm0 5 PWM_MSEC(20) PWM_POLARITY_NORMA... | /content/code_sandbox/samples/basic/servo_motor/boards/rddrone_fmuk66.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 218 |
```c
/*
*
*/
/**
* @file Sample app to demonstrate PWM-based servomotor control
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/device.h>
#include <zephyr/drivers/pwm.h>
static const struct pwm_dt_spec servo = PWM_DT_SPEC_GET(DT_NODELABEL(servo));
static const uint32_t min_pulse = D... | /content/code_sandbox/samples/basic/servo_motor/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 355 |
```unknown
/ {
servo: servo {
compatible = "pwm-servo";
pwms = <&flexpwm2_pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; /* FMU_CH1 */
/* <&flexpwm2_pwm1 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>, */ /* FMU_CH2 */
/* <&flexpwm2_pwm2 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>, */ /* FMU_CH3 */
/* <&flexpwm... | /content/code_sandbox/samples/basic/servo_motor/boards/mimxrt1062_fmurt6.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 299 |
```unknown
CONFIG_GPIO=y
``` | /content/code_sandbox/samples/basic/blinky/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 5 |
```yaml
sample:
name: Blinky Sample
tests:
sample.basic.blinky:
tags:
- LED
- gpio
filter: dt_enabled_alias_with_parent_compat("led0", "gpio-leds")
depends_on: gpio
harness: led
integration_platforms:
- frdm_k64f
``` | /content/code_sandbox/samples/basic/blinky/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 71 |
```c
/*
*
*/
#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/drivers/gpio.h>
/* 1000 msec = 1 sec */
#define SLEEP_TIME_MS 1000
/* The devicetree node identifier for the "led0" alias. */
#define LED0_NODE DT_ALIAS(led0)
/*
* A build error on this line means your board is unsupported.
* See the ... | /content/code_sandbox/samples/basic/blinky/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 256 |
```restructuredtext
.. zephyr:code-sample:: blinky
:name: Blinky
:relevant-api: gpio_interface
Blink an LED forever using the GPIO API.
Overview
********
The Blinky sample blinks an LED forever using the :ref:`GPIO API <gpio_api>`.
The source code shows how to:
#. Get a pin specification from the :ref:`de... | /content/code_sandbox/samples/basic/blinky/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 726 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_PRINTK=y
CONFIG_PWM=y
CONFIG_LOG=y
CONFIG_LOG_PRINTK=y
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_PWM_LOG_LEVEL_DBG=y
``` | /content/code_sandbox/samples/basic/blinky_pwm/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 40 |
```yaml
sample:
name: Blink LED (PWM based)
tests:
sample.basic.blink_led:
filter: dt_alias_exists("pwm-led0") and dt_compat_enabled("pwm-leds")
tags:
- drivers
- pwm
depends_on: pwm
harness: console
harness_config:
type: multi_line
ordered: true
regex:
- "P... | /content/code_sandbox/samples/basic/blinky_pwm/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 152 |
```restructuredtext
.. zephyr:code-sample:: pwm-blinky
:name: PWM Blinky
:relevant-api: pwm_interface
Blink an LED using the PWM API.
Overview
********
This application blinks an LED using the :ref:`PWM API <pwm_api>`. See
:zephyr:code-sample:`blinky` for a GPIO-based sample.
The LED starts blinking at a 1... | /content/code_sandbox/samples/basic/blinky_pwm/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 685 |
```unknown
/*
*
*/
&pwmleds {
status = "okay";
};
&pwm2 {
status = "okay";
};
``` | /content/code_sandbox/samples/basic/blinky_pwm/boards/nucleo_f091rc.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 25 |
```c
/*
*
*/
/**
* @file Sample app to demonstrate PWM.
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/device.h>
#include <zephyr/drivers/pwm.h>
static const struct pwm_dt_spec pwm_led0 = PWM_DT_SPEC_GET(DT_ALIAS(pwm_led0));
#define MIN_PERIOD PWM_SEC(1U) / 128U
#define MAX_PERIOD... | /content/code_sandbox/samples/basic/blinky_pwm/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 536 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/pwm/pwm.h>
/ {
aliases {
pwm-0 = &ledc0;
pwm-led0 = &pwm_led_blue;
};
pwmleds {
compatible = "pwm-leds";
pwm_led_blue: pwm_led_gpio0_2 {
label = "PWM LED0";
pwms = <&ledc0 0 1000 PWM_POLARITY_NORMAL>;
};
};
};
&pinctrl {
ledc0_default: ledc0_def... | /content/code_sandbox/samples/basic/blinky_pwm/boards/esp32_devkitc_wroom_procpu.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 224 |
```unknown
/*
* (c) Meta Platforms, Inc. and affiliates.
*
*/
&leds {
status = "disabled";
};
&green_pwm_led {
pwms = <&ctimer2_pwm 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
label = "Green PWM LED";
status = "okay";
};
ctimer2_pwm: &ctimer2 {
compatible = "nxp,ctimer-pwm";
status = "okay";
clk-source = <5>;
... | /content/code_sandbox/samples/basic/blinky_pwm/boards/mimxrt685_evk_mimxrt685s_cm33.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 159 |
```unknown
/*
*
*/
&pwmleds {
status = "okay";
};
&pwm3 {
status = "okay";
};
``` | /content/code_sandbox/samples/basic/blinky_pwm/boards/stm32f072b_disco.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 25 |
```unknown
/*
*
*/
&pwmleds {
status = "okay";
};
&pwm2 {
status = "okay";
};
``` | /content/code_sandbox/samples/basic/blinky_pwm/boards/nucleo_l073rz.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 25 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/pwm/pwm.h>
/ {
aliases {
pwm-0 = &ledc0;
pwm-led0 = &pwm_led_blue;
};
pwmleds {
compatible = "pwm-leds";
pwm_led_blue: pwm_led_gpio0_10 {
label = "PWM LED0";
pwms = <&ledc0 0 1000 PWM_POLARITY_NORMAL>;
};
};
};
&pinctrl {
ledc0_default: ledc0_de... | /content/code_sandbox/samples/basic/blinky_pwm/boards/esp32s3_luatos_core_procpu.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 224 |
```unknown
/*
*
*/
/ {
pwmleds: pwmleds {
compatible = "pwm-leds";
status = "okay";
green_pwm_led: green_pwm_led {
pwms = <&pwm2 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
};
};
aliases {
pwm-led0 = &green_pwm_led;
};
};
&pwm2 {
status = "okay";
};
``` | /content/code_sandbox/samples/basic/blinky_pwm/boards/nucleo_l476rg.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 96 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/pwm/pwm.h>
/ {
aliases {
pwm-0 = &ledc0;
pwm-led0 = &pwm_led_blue;
};
pwmleds {
compatible = "pwm-leds";
pwm_led_blue: pwm_led_gpio0_2 {
label = "PWM LED0";
pwms = <&ledc0 0 1000 PWM_POLARITY_NORMAL>;
};
};
};
&pinctrl {
ledc0_default: ledc0_def... | /content/code_sandbox/samples/basic/blinky_pwm/boards/esp32c3_luatos_core.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 224 |
```unknown
&pwm0 {
status = "disabled";
};
&sw_pwm {
status = "okay";
channel-gpios = <&gpio0 13 PWM_POLARITY_INVERTED>;
};
&pwm_led0 {
pwms = <&sw_pwm 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
};
``` | /content/code_sandbox/samples/basic/blinky_pwm/boards/nrf52840dk_nrf52840.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 68 |
```unknown
/*
*
*/
&pwm_led1 {
status = "okay";
};
&pwm_ccu80 {
status = "okay";
};
``` | /content/code_sandbox/samples/basic/blinky_pwm/boards/xmc47_relax_kit.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 27 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/pwm/pwm.h>
/ {
aliases {
pwm-0 = &ledc0;
pwm-led0 = &pwm_led_blue;
};
pwmleds {
compatible = "pwm-leds";
pwm_led_blue: pwm_led_gpio0_10 {
label = "PWM LED0";
pwms = <&ledc0 0 1000 PWM_POLARITY_NORMAL>;
};
};
};
&pinctrl {
ledc0_default: ledc0_de... | /content/code_sandbox/samples/basic/blinky_pwm/boards/esp32s3_luatos_core_procpu_usb.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 224 |
```unknown
/*
*/
/{
aliases {
pwm-led0 = &pwm_led0;
};
pwmleds {
compatible = "pwm-leds";
pwm_led0: pwm_led_0 {
pwms = <&tcc1 3 PWM_MSEC(500)>;
label = "Blue PWM LED";
};
};
};
&tcc1 {
status = "okay";
compatible = "atmel,sam0-tcc-pwm";
prescaler = <4>;
#pwm-cells = <2>;
pinctrl-0 = <&pwm_de... | /content/code_sandbox/samples/basic/blinky_pwm/boards/wio_terminal.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 178 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/pwm/pwm.h>
/ {
aliases {
pwm-0 = &ledc0;
pwm-led0 = &pwm_led_blue;
};
pwmleds {
compatible = "pwm-leds";
pwm_led_blue: pwm_led_gpio0_2 {
label = "PWM LED0";
pwms = <&ledc0 0 1000 PWM_POLARITY_NORMAL>;
};
};
};
&pinctrl {
ledc0_default: ledc0_def... | /content/code_sandbox/samples/basic/blinky_pwm/boards/esp32s2_saola.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 224 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/pwm/pwm.h>
/ {
aliases {
pwm-0 = &ledc0;
pwm-led0 = &pwm_led_blue;
};
pwmleds {
compatible = "pwm-leds";
pwm_led_blue: pwm_led_gpio0_2 {
label = "PWM LED0";
pwms = <&ledc0 0 1000 PWM_POLARITY_NORMAL>;
};
};
};
&pinctrl {
ledc0_default: ledc0_def... | /content/code_sandbox/samples/basic/blinky_pwm/boards/esp32c3_devkitm.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 224 |
```unknown
&pwm0 {
status = "disabled";
};
&sw_pwm {
status = "okay";
channel-gpios = <&gpio0 2 PWM_POLARITY_INVERTED>;
};
&pwm_led0 {
pwms = <&sw_pwm 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
};
``` | /content/code_sandbox/samples/basic/blinky_pwm/boards/nrf9160dk_nrf9160.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 68 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/pwm/pwm.h>
/ {
aliases {
pwm-0 = &ledc0;
pwm-led0 = &pwm_led_blue;
};
pwmleds {
compatible = "pwm-leds";
pwm_led_blue: pwm_led_gpio0_21 {
label = "PWM LED0";
pwms = <&ledc0 0 1000 PWM_POLARITY_NORMAL>;
};
};
};
&pinctrl {
ledc0_default: ledc0_de... | /content/code_sandbox/samples/basic/blinky_pwm/boards/xiao_esp32s3_procpu.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 224 |
```unknown
/*
*
*/
&pwm_led1 {
status = "okay";
};
&pwm_ccu40 {
status = "okay";
};
``` | /content/code_sandbox/samples/basic/blinky_pwm/boards/xmc45_relax_kit.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 27 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/pwm/pwm.h>
/ {
aliases {
pwm-0 = &ledc0;
pwm-led0 = &pwm_led_blue;
};
pwmleds {
compatible = "pwm-leds";
pwm_led_blue: pwm_led_gpio0_2 {
label = "PWM LED0";
pwms = <&ledc0 0 1000 PWM_POLARITY_NORMAL>;
};
};
};
&pinctrl {
ledc0_default: ledc0_def... | /content/code_sandbox/samples/basic/blinky_pwm/boards/esp32c3_luatos_core_esp32c3_usb.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 224 |
```unknown
&pwm_led0 {
status = "okay";
};
&pwm {
status = "okay";
divider-frac-4 = <15>;
divider-int-4 = <255>;
};
``` | /content/code_sandbox/samples/basic/blinky_pwm/boards/rpi_pico.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 40 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/pwm/pwm.h>
/ {
aliases {
pwm-0 = &ledc0;
pwm-led0 = &pwm_led_blue;
};
pwmleds {
compatible = "pwm-leds";
pwm_led_blue: pwm_led_gpio0_2 {
label = "PWM LED0";
pwms = <&ledc0 0 1000 PWM_POLARITY_NORMAL>;
};
};
};
&pinctrl {
ledc0_default: ledc0_def... | /content/code_sandbox/samples/basic/blinky_pwm/boards/esp32s3_devkitm_procpu.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 224 |
```unknown
/*
*
*/
/ {
pwmleds {
compatible = "pwm-leds";
pwm_led_0: pwm_led_0 {
pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
label = "PWM LED 0";
};
};
aliases {
pwm-led0 = &pwm_led_0;
pwm-0 = &pwm0;
};
};
&pwm0 {
status = "okay";
};
``` | /content/code_sandbox/samples/basic/blinky_pwm/boards/rcar_h3ulcb_r8a77951_r7.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 110 |
```unknown
&{/pwm_leds} {
status = "okay";
};
&pwm_led0 {
status = "okay";
};
&pwm {
status = "okay";
divider-frac-4 = <15>;
divider-int-4 = <255>;
};
``` | /content/code_sandbox/samples/basic/blinky_pwm/boards/xiao_rp2040.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 54 |
```unknown
/*
*
*/
&ftm0 {
clock-source = "fixed";
clocks = <&clock NXP_S32_RTC_CLK>;
prescaler = <1>;
};
``` | /content/code_sandbox/samples/basic/blinky_pwm/boards/ucans32k1sic.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```unknown
/*
*
*/
&pwmleds {
status = "okay";
};
&pwm1 {
status = "okay";
};
``` | /content/code_sandbox/samples/basic/blinky_pwm/boards/nucleo_l4r5zi.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 25 |
```unknown
&pwm0 {
status = "disabled";
};
&sw_pwm {
status = "okay";
channel-gpios = <&gpio0 28 PWM_POLARITY_INVERTED>;
};
&pwm_led0 {
pwms = <&sw_pwm 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
};
``` | /content/code_sandbox/samples/basic/blinky_pwm/boards/nrf5340dk_nrf5340_cpuapp.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 68 |
```unknown
/*
*
*/
/ {
aliases {
pwm-led0 = &pwm_led0;
};
pwmleds {
compatible = "pwm-leds";
pwm_led0: pwm_led_0 {
pwms = <&pwm0 0 255 PWM_POLARITY_NORMAL>;
label = "PWM MB1";
};
};
};
&pinctrl {
pwm0_default: pwm0_default {
pinmux = <17 IOC_PORT_MCU_PORT_EVENT1>;
bias-disable;
drive-stren... | /content/code_sandbox/samples/basic/blinky_pwm/boards/beagleconnect_freedom.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 169 |
```unknown
#
config TEST_LIB_HASH_MAP_MAX_ENTRIES
int "Maximum number of Hashmap entries"
default 40
help
When benchmarking the performance of the Hashmap, it helps to be able
to vary the number of entries to insert or remove from the hash table
in a convenient way. This option translates to MANY in the te... | /content/code_sandbox/samples/basic/hash_map/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 161 |
```unknown
#
CONFIG_BOOT_BANNER=n
CONFIG_LOG=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_SYS_HASH_FUNC32=y
CONFIG_SYS_HASH_MAP=y
CONFIG_TEST_LIB_HASH_MAP_MAX_ENTRIES=40
``` | /content/code_sandbox/samples/basic/hash_map/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 42 |
```restructuredtext
.. zephyr:code-sample:: system_hashmap
:name: System hashmap
:relevant-api: hashmap_apis
Insert, replace, and remove entries in a hashmap.
Overview
********
This is a simple example that repeatedly:
* inserts up to ``CONFIG_TEST_LIB_HASH_MAP_MAX_ENTRIES``
* replaces up to the same numbe... | /content/code_sandbox/samples/basic/hash_map/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 374 |
```yaml
#
sample:
description: System Hashmap sample
name: System Hashmap sample
common:
min_ram: 24
integration_platforms:
- qemu_x86_64
- mps2/an385
harness: console
harness_config:
type: one_line
regex:
- .*success
tests:
# Minimal Libc
libraries.hash_map.minimal.separate_ch... | /content/code_sandbox/samples/basic/hash_map/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 617 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/sys/hash_map.h>
#include <zephyr/random/random.h>
LOG_MODULE_REGISTER(hashmap_sample);
SYS_HASHMAP_DEFINE_STATIC(map);
struct _stats {
uint64_t n_insert;
uint64_t n_remove;
uint64_t n_replace;
uint64_t n_error;
uint64_t ... | /content/code_sandbox/samples/basic/hash_map/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 650 |
```unknown
CONFIG_GPIO=y
``` | /content/code_sandbox/samples/basic/button/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 5 |
```yaml
sample:
name: Button Sample
tests:
sample.basic.button:
tags:
- button
- gpio
filter: dt_enabled_alias_with_parent_compat("sw0", "gpio-keys")
integration_platforms:
- nrf52833dk/nrf52820
depends_on: gpio
harness: button
``` | /content/code_sandbox/samples/basic/button/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 72 |
```restructuredtext
.. zephyr:code-sample:: button
:name: Button
:relevant-api: gpio_interface
Handle GPIO inputs with interrupts.
Overview
********
A simple button demo showcasing the use of GPIO input with interrupts.
The sample prints a message to the console each time a button is pressed.
.. NOTE:: If ... | /content/code_sandbox/samples/basic/button/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 887 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/printk.h>
#include <inttypes.h>
#define SLEEP_TIME_MS 1
/*
* Get button configuration from the devicetree sw0 alias. This is mandatory.
*/
#define SW0_NODE DT_ALIA... | /content/code_sandbox/samples/basic/button/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 703 |
```unknown
CONFIG_PRINTK=y
CONFIG_HEAP_MEM_POOL_SIZE=256
CONFIG_ASSERT=y
CONFIG_GPIO=y
``` | /content/code_sandbox/samples/basic/threads/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 22 |
```restructuredtext
.. zephyr:code-sample:: multi-thread-blinky
:name: Basic thread manipulation
:relevant-api: gpio_interface thread_apis
Spawn multiple threads that blink LEDs and print information to the console.
Overview
********
This example demonstrates spawning multiple threads using
:c:func:`K_THREA... | /content/code_sandbox/samples/basic/threads/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 462 |
```yaml
sample:
description: A basic demo to showcase multi-threading using K_THREAD_DEFINE
name: Basic Thread Demo
tests:
sample.basic.threads:
tags:
- kernel
- threads
- gpio
filter: dt_enabled_alias_with_parent_compat("led0", "gpio-leds") and
dt_enabled_alias_with_parent_c... | /content/code_sandbox/samples/basic/threads/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 155 |
```unknown
# Drivers and peripherals
CONFIG_I2C=n
CONFIG_WATCHDOG=n
CONFIG_GPIO=n
CONFIG_PINCTRL=n
CONFIG_SPI=n
CONFIG_SERIAL=n
CONFIG_FLASH=n
# Power management
CONFIG_PM=n
# Interrupts
CONFIG_DYNAMIC_INTERRUPTS=n
CONFIG_IRQ_OFFLOAD=n
# Memory protection
CONFIG_THREAD_STACK_INFO=n
CONFIG_THREAD_CUSTOM_DATA=n
CONFIG... | /content/code_sandbox/samples/basic/minimal/common.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 139 |
```unknown
CONFIG_NUM_PREEMPT_PRIORITIES=0
``` | /content/code_sandbox/samples/basic/minimal/no-preempt.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 12 |
```unknown
# Drivers and peripherals
CONFIG_I2C=n
CONFIG_WATCHDOG=n
CONFIG_GPIO=n
CONFIG_PINCTRL=n
CONFIG_SPI=n
CONFIG_FLASH=n
CONFIG_UART_USE_RUNTIME_CONFIGURE=n
CONFIG_UART_INTERRUPT_DRIVEN=n
# libs
CONFIG_MINIMAL_LIBC=y
CONFIG_CBPRINTF_NANO=y
CONFIG_CBPRINTF_REDUCED_INTEGRAL=y
CONFIG_CBPRINTF_LIBC_SUBSTS=n
# build... | /content/code_sandbox/samples/basic/minimal/common-runtime.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 117 |
```unknown
CONFIG_RISCV_PMP=n
``` | /content/code_sandbox/samples/basic/minimal/riscv.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 9 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/__assert.h>
#include <string.h>
/* size of stack area used by each thread */
#define STACKSIZE 1024
/* scheduling priority used by each thread */
#define PRIORITY ... | /content/code_sandbox/samples/basic/threads/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 723 |
```unknown
# No timer support in the kernel
CONFIG_SYS_CLOCK_EXISTS=n
``` | /content/code_sandbox/samples/basic/minimal/no-timers.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 15 |
```unknown
# Single-threaded, no timer support in the kernel
CONFIG_MULTITHREADING=n
CONFIG_KERNEL_MEM_POOL=n
``` | /content/code_sandbox/samples/basic/minimal/no-mt.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 25 |
```unknown
CONFIG_ARM_MPU=n
``` | /content/code_sandbox/samples/basic/minimal/arm.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.