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 CONFIG_X86_MMU=n ```
/content/code_sandbox/samples/basic/minimal/x86.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
8
```unknown # config SAMPLE_DO_OUTPUT bool "Do print from the main thread which can be checked" source "Kconfig.zephyr" ```
/content/code_sandbox/samples/basic/minimal/Kconfig
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
28
```restructuredtext .. zephyr:code-sample:: minimal :name: Minimal footprint Measure Zephyr's minimal ROM footprint in different configurations. Overview ******** This sample provides an empty ``main()`` and various configuration files that can be used to measure Zephyr's minimal ROM footprint in different con...
/content/code_sandbox/samples/basic/minimal/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
662
```unknown # empty config ```
/content/code_sandbox/samples/basic/minimal/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
5
```unknown CONFIG_MULTITHREADING=y CONFIG_NUM_COOP_PRIORITIES=16 CONFIG_NUM_METAIRQ_PRIORITIES=0 CONFIG_ERRNO=n CONFIG_SCHED_DUMB=y CONFIG_WAITQ_DUMB=y ```
/content/code_sandbox/samples/basic/minimal/mt.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
45
```c /* * */ #include <zephyr/kernel.h> int main(void) { #ifdef CONFIG_SAMPLE_DO_OUTPUT printk("Hello World from minimal!\n"); #endif return 0; } ```
/content/code_sandbox/samples/basic/minimal/src/main.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
39
```yaml sample: description: minimal sample, the smallest possible Zephyr application name: minimal common: tags: footprint harness: console harness_config: type: one_line regex: - "Hello World from minimal!" tests: sample.minimal.mt.arm: extra_args: CONF_FILE='common.conf;mt.conf;arm.conf...
/content/code_sandbox/samples/basic/minimal/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
874
```restructuredtext .. zephyr:code-sample:: gpio-custom-dts-binding :name: GPIO with custom Devicetree binding :relevant-api: gpio_interface devicetree-generic-id devicetree-generic-exist Use custom Devicetree binding to control a GPIO. Overview ******** In Zephyr, all hardware-specific configuration is des...
/content/code_sandbox/samples/basic/custom_dts_binding/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
449
```unknown CONFIG_GPIO=y ```
/content/code_sandbox/samples/basic/custom_dts_binding/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
5
```yaml description: GPIO pin to switch a power output on or off compatible: "power-switch" properties: gpios: type: phandle-array required: true description: | The GPIO connected to the gate driver for the MOSFET. ```
/content/code_sandbox/samples/basic/custom_dts_binding/dts/bindings/power-switch.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
57
```yaml sample: name: GPIO with custom devicetree binding tests: sample.basic.custom_dts_binding: tags: - gpio - devicetree platform_allow: nucleo_l073rz integration_platforms: - nucleo_l073rz depends_on: gpio harness: console harness_config: type: multi_line re...
/content/code_sandbox/samples/basic/custom_dts_binding/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
111
```unknown /* * */ / { load_switch: load_switch { compatible = "power-switch"; /* using built-in LED pin for demonstration */ gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>; }; }; ```
/content/code_sandbox/samples/basic/custom_dts_binding/boards/nucleo_l073rz.overlay
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
48
```c /* * */ #include <stdio.h> #include <zephyr/devicetree.h> #include <zephyr/drivers/gpio.h> #include <zephyr/kernel.h> #if !DT_NODE_EXISTS(DT_NODELABEL(load_switch)) #error "Overlay for power output node not properly defined." #endif static const struct gpio_dt_spec load_switch = GPIO_DT_SPEC_GET_OR(DT_NODEL...
/content/code_sandbox/samples/basic/custom_dts_binding/src/main.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
255
```unknown CONFIG_PRINTK=y CONFIG_PWM=y CONFIG_LOG=y CONFIG_PWM_LOG_LEVEL_DBG=y ```
/content/code_sandbox/samples/basic/fade_led/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
21
```restructuredtext .. zephyr:code-sample:: fade-led :name: Fade LED :relevant-api: pwm_interface Fade an LED using the PWM API. Overview ******** This application "fades" a LED using the :ref:`PWM API <pwm_api>`. The LED starts off increases its brightness until it is fully or nearly fully on. The brightn...
/content/code_sandbox/samples/basic/fade_led/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
287
```yaml sample: name: Fade LED tests: sample.basic.fade_led: tags: - drivers - pwm depends_on: pwm filter: dt_alias_exists("pwm-led0") and dt_compat_enabled("pwm-leds") integration_platforms: - nrf51dk/nrf51822 harness: console harness_config: type: multi_line o...
/content/code_sandbox/samples/basic/fade_led/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
127
```unknown &pwm { status = "okay"; divider-int-4 = <255>; }; ```
/content/code_sandbox/samples/basic/fade_led/boards/rpi_pico.overlay
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
19
```unknown &pwm { status = "okay"; divider-int-4 = <255>; }; ```
/content/code_sandbox/samples/basic/fade_led/boards/xiao_rp2040.overlay
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
19
```unknown /* * */ &ftm0 { clock-source = "fixed"; clocks = <&clock NXP_S32_RTC_CLK>; prescaler = <1>; }; ```
/content/code_sandbox/samples/basic/fade_led/boards/ucans32k1sic.overlay
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
36
```c /* * */ /** * @file Sample app to demonstrate PWM-based LED fade */ #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 NUM_STEPS 50U #define SLEEP_MSEC 2...
/content/code_sandbox/samples/basic/fade_led/src/main.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
370
```restructuredtext .. zephyr:code-sample:: sys-heap :name: System heap Print system heap usage to the console. Overview ******** A simple sample that can be used with any :ref:`supported board <boards>` and prints system heap usage to the console. Building ******** This application can be built on :ref:`nat...
/content/code_sandbox/samples/basic/sys_heap/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
250
```unknown CONFIG_SYS_HEAP_RUNTIME_STATS=y ```
/content/code_sandbox/samples/basic/sys_heap/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
8
```yaml sample: description: System heap sample showing how to use sys_heap functions name: Basic system heap sample common: integration_platforms: - native_sim harness: console harness_config: type: multi_line ordered: true regex: - ".*allocated 15.,.*" - ".*allocated 10.,.*" ...
/content/code_sandbox/samples/basic/sys_heap/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
123
```c /* * */ #include <zephyr/kernel.h> #include <zephyr/sys/sys_heap.h> #define HEAP_SIZE 256 static char heap_mem[HEAP_SIZE]; static struct sys_heap heap; static void print_sys_memory_stats(void); int main(void) { void *p; printk("System heap sample\n\n"); sys_heap_init(&heap, heap_mem, HEAP_SIZE); print...
/content/code_sandbox/samples/basic/sys_heap/src/main.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
205
```unknown CONFIG_PRINTK=y CONFIG_PWM=y CONFIG_LOG=y ```
/content/code_sandbox/samples/basic/rgb_led/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
14
```yaml sample: name: RGB LED tests: sample.basic.rgb_led: filter: dt_alias_exists("red-pwm-led") and dt_alias_exists("green-pwm-led") and dt_alias_exists("blue-pwm-led") tags: - drivers - pwm depends_on: pwm harness: led integration_platforms: - nrf52840_mdk ```
/content/code_sandbox/samples/basic/rgb_led/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
86
```restructuredtext .. zephyr:code-sample:: rgb-led :name: PWM RGB LED :relevant-api: pwm_interface Drive an RGB LED using the PWM API. Overview ******** This is a sample app which drives an RGB LED using the :ref:`PWM API <pwm_api>`. There are three single-color component LEDs in an RGB LED. Each componen...
/content/code_sandbox/samples/basic/rgb_led/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
523
```unknown /* * */ &ftm0 { clock-source = "fixed"; clocks = <&clock NXP_S32_RTC_CLK>; prescaler = <1>; }; ```
/content/code_sandbox/samples/basic/rgb_led/boards/ucans32k1sic.overlay
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
36
```restructuredtext .. _posix-samples: POSIX API Samples ################# .. toctree:: :maxdepth: 1 :glob: **/* ```
/content/code_sandbox/samples/posix/posix.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
34
```c /* * */ /** * @file Sample app to demonstrate PWM-based RGB LED 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 red_pwm_led = PWM_DT_SPEC_GET(DT_ALIAS(red_pwm_led)); static const struct pwm_dt_sp...
/content/code_sandbox/samples/basic/rgb_led/src/main.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
484
```unknown CONFIG_POSIX_API=y CONFIG_SHELL=y CONFIG_POSIX_UNAME_SHELL=y CONFIG_MP_MAX_NUM_CPUS=1 ```
/content/code_sandbox/samples/posix/uname/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
30
```restructuredtext .. _posix-uname-sample: POSIX uname() ############# Overview ******** In this sample application, the POSIX `uname()`_ function is used to acquire system information and it is output to the console. Additionally, uname is added as a shell command and system information is displayed according to t...
/content/code_sandbox/samples/posix/uname/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
391
```yaml sample: description: posix uname sample name: posix uname common: tags: posix platform_exclude: - native_posix - native_posix/native/64 integration_platforms: - native_sim - qemu_riscv64 harness: console harness_config: type: multi_line ordered: true regex: - "sys...
/content/code_sandbox/samples/posix/uname/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
174
```unknown # This makefile builds the sample for a POSIX system, like Linux uname: src/main.c mkdir -p build $(CC) $^ -o build/$@ ```
/content/code_sandbox/samples/posix/uname/Makefile.host
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
38
```c /* * */ #include <stdio.h> #include <sys/utsname.h> int main(void) { struct utsname info; uname(&info); printf("\nPrinting everything in utsname...\n"); printf("sysname[%zu]: %s\n", sizeof(info.sysname), info.sysname); printf("nodename[%zu]: %s\n", sizeof(info.nodename), info.nodename); printf("release...
/content/code_sandbox/samples/posix/uname/src/main.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
143
```restructuredtext .. _posix-gettimeofday-sample: POSIX gettimeofday() with clock initialization over SNTP ######################################################## Overview ******** This sample application demonstrates using the POSIX `gettimeofday()`_ function to display the absolute wall clock time and local time...
/content/code_sandbox/samples/posix/gettimeofday/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
294
```unknown # General config CONFIG_MAIN_STACK_SIZE=2048 CONFIG_REQUIRES_FULL_LIBC=y CONFIG_POSIX_API=y CONFIG_SNTP=y CONFIG_NET_CONFIG_CLOCK_SNTP_INIT=y CONFIG_NET_CONFIG_SNTP_INIT_SERVER="time.nist.gov" # Networking config CONFIG_NETWORKING=y CONFIG_NET_IPV4=y CONFIG_NET_IPV6=y CONFIG_NET_TCP=y CONFIG_NET_SOCKETS=y ...
/content/code_sandbox/samples/posix/gettimeofday/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
208
```unknown # This makefile builds the sample for a POSIX system, like Linux gettimeofday: src/main.c mkdir -p build $(CC) $^ -o build/$@ ```
/content/code_sandbox/samples/posix/gettimeofday/Makefile.host
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
39
```yaml sample: description: POSIX API gettimeofday() example (with SNTP) name: gettimeofday common: filter: ( CONFIG_FULL_LIBC_SUPPORTED and not CONFIG_NATIVE_LIBC and not CONFIG_SOC_FAMILY_INTEL_ADSP ) harness: net min_ram: 32 min_flash: 96 tags: - posix - net platform_exclude: - nativ...
/content/code_sandbox/samples/posix/gettimeofday/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
113
```c /* * */ #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <sys/time.h> #include <time.h> #include <unistd.h> int main(void) { struct timeval tv; while (1) { int res = gettimeofday(&tv, NULL); time_t now = time(NULL); struct tm tm; localtime_r(&now, &tm); if (res < 0) { printf(...
/content/code_sandbox/samples/posix/gettimeofday/src/main.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
186
```unknown # config SAMPLE_ERROR_CHECKING bool "Perform error checking" config SAMPLE_DEBUG_PRINTF bool "Print debug information" default y config SAMPLE_SAME_PRIO bool "Print debug information" default n source "Kconfig.zephyr" ```
/content/code_sandbox/samples/posix/philosophers/Kconfig
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
52
```restructuredtext .. _posix-philosophers-sample: POSIX Philosophers ################## Overview ******** This sample implements Zephyr's :ref:`Dining Philosophers Sample <dining-philosophers-sample>` using the :ref:`POSIX API <posix_support>`. The source code for this sample can be found under :file:`samples/posix...
/content/code_sandbox/samples/posix/philosophers/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
406
```unknown CONFIG_STDOUT_CONSOLE=n CONFIG_MP_MAX_NUM_CPUS=1 CONFIG_POSIX_API=y CONFIG_THREAD_STACK_INFO=y CONFIG_DYNAMIC_THREAD=y CONFIG_DYNAMIC_THREAD_POOL_SIZE=6 CONFIG_POSIX_THREAD_THREADS_MAX=6 CONFIG_MAX_PTHREAD_MUTEX_COUNT=6 #Enable thread awareness for debugging tools supporting it CONFIG_DEBUG_THREAD_INFO=y ...
/content/code_sandbox/samples/posix/philosophers/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
75
```yaml sample: name: POSIX Philosophers common: tags: - introduction - posix harness: console min_ram: 16 integration_platforms: - native_sim filter: not CONFIG_NATIVE_APPLICATION harness_config: type: multi_line ordered: false regex: - ".*STARVING.*" - ".*DROPPED ONE ...
/content/code_sandbox/samples/posix/philosophers/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
121
```restructuredtext .. _posix-env-sample: POSIX Environment Variables ########################### Overview ******** In this sample application, the POSIX :c:func:`setenv`, function is used to populate several environment variables in C. Then, all environment variables are then printed. If the user sets a new value ...
/content/code_sandbox/samples/posix/env/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
493
```unknown CONFIG_POSIX_API=y CONFIG_SHELL=y CONFIG_POSIX_ENV_SHELL=y CONFIG_DYNAMIC_THREAD=y CONFIG_DYNAMIC_THREAD_POOL_SIZE=1 CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=256 ```
/content/code_sandbox/samples/posix/env/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
45
```yaml sample: description: posix env sample name: posix env common: tags: posix env platform_exclude: - native_posix - native_posix/native/64 integration_platforms: - native_sim harness: console harness_config: type: multi_line regex: - "BOARD=.*" - "BUILD_VERSION=.*" ...
/content/code_sandbox/samples/posix/env/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
101
```c /* * */ #include <pthread.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <zephyr/sys/util.h> #include <zephyr/kernel.h> #include <zephyr/version.h> #ifdef BUILD_VERSION #define VERSION_BUILD STRINGIFY(BUILD_VERSION) #else #define VERSION_BUILD K...
/content/code_sandbox/samples/posix/env/src/main.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
351
```restructuredtext .. _posix-eventfd-sample: POSIX eventfd() ############### Overview ******** This sample application demonstrates using the POSIX eventfd() function to create a file descriptor, which can be used for event notification. The returned file descriptor is used with write/read calls and write/read valu...
/content/code_sandbox/samples/posix/eventfd/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
262
```c /* * */ #include "posix_internal.h" #include <pthread.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <zephyr/sys/util.h> #include <zephyr/logging/log.h> #ifdef CONFIG_THREAD_NAME #define MAX_NAME_LEN CONFIG_THREAD_MAX_NAME_LEN #else #define MAX_NAME_LEN 1 #endif #define NUM_PHIL ...
/content/code_sandbox/samples/posix/philosophers/src/main.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
1,774
```unknown # General config CONFIG_REQUIRES_FULL_LIBC=y CONFIG_POSIX_API=y CONFIG_EVENTFD=y # eventfd() implementation currently depends on some networking APIs, # so provide reasonable defaults so it can be built. CONFIG_NETWORKING=y CONFIG_NET_TEST=y CONFIG_TEST_RANDOM_GENERATOR=y ```
/content/code_sandbox/samples/posix/eventfd/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
64
```unknown # This makefile builds the sample for a POSIX system, like Linux eventfd: src/main.c mkdir -p build $(CC) $^ -o build/$@ ```
/content/code_sandbox/samples/posix/eventfd/Makefile.host
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
39
```yaml sample: description: Extended POSIX (Linux) API eventfd() example name: eventfd common: filter: CONFIG_FULL_LIBC_SUPPORTED and not CONFIG_NATIVE_LIBC tags: posix platform_exclude: m2gl025_miv integration_platforms: - mps2/an385 tests: sample.posix.eventfd: min_ram: 32 tags: posix h...
/content/code_sandbox/samples/posix/eventfd/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
188
```unknown CONFIG_STDOUT_CONSOLE=n CONFIG_ASSERT=y CONFIG_ASSERT_LEVEL=2 CONFIG_NUM_COOP_PRIORITIES=29 CONFIG_NUM_PREEMPT_PRIORITIES=40 CONFIG_PM=y CONFIG_TICKLESS_KERNEL=y CONFIG_MP_MAX_NUM_CPUS=1 #Enable thread awareness for debugging tools supporting it CONFIG_DEBUG_THREAD_INFO=y ```
/content/code_sandbox/samples/philosophers/prj_tickless.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
73
```c /* * * * This sample application is roughly based on the sample code in Linux * manpage for eventfd(). */ #include <sys/eventfd.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <stdint.h> #define fatal(msg) \ do { perror(msg); exit(EXIT_FAILURE); } while (0) /* As Zephyr doesn't provi...
/content/code_sandbox/samples/posix/eventfd/src/main.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
440
```unknown CONFIG_STDOUT_CONSOLE=n CONFIG_MP_MAX_NUM_CPUS=1 #Enable thread awareness for debugging tools supporting it CONFIG_DEBUG_THREAD_INFO=y ```
/content/code_sandbox/samples/philosophers/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
32
```yaml sample: name: Dining Philosophers common: extra_args: DEBUG_PRINTF=1 tags: - introduction - kernel harness: console min_ram: 16 integration_platforms: - native_sim harness_config: type: multi_line ordered: false regex: - ".*STARVING.*" - ".*DROPPED ONE FORK.*" ...
/content/code_sandbox/samples/philosophers/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
333
```restructuredtext .. _dining-philosophers-sample: Dining Philosophers ################### Overview ******** An implementation of a solution to the Dining Philosophers problem (a classic multi-thread synchronization problem). This particular implementation demonstrates the usage of multiple preemptible and coopera...
/content/code_sandbox/samples/philosophers/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
1,902
```objective-c /* * */ /** * @file * * Object type abstraction. * * Each object type that can be used as a "fork" provides: * * - a definition for fork_t (a reference to a fork) and fork_obj_t (an * instance of the fork object) * - a 'fork_init' function that initializes the object * - a 'take' function ...
/content/code_sandbox/samples/philosophers/src/phil_obj_abstract.h
objective-c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
1,337
```restructuredtext .. _hello_world: Hello World ########### Overview ******** A simple sample that can be used with any :ref:`supported board <boards>` and prints "Hello World" to the console. Building and Running ******************** This application can be built and executed on QEMU as follows: .. zephyr-app-c...
/content/code_sandbox/samples/hello_world/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
161
```unknown # nothing here ```
/content/code_sandbox/samples/hello_world/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
5
```yaml sample: description: Hello World sample, the simplest Zephyr application name: hello world common: tags: introduction integration_platforms: - native_sim harness: console harness_config: type: one_line regex: - "Hello World! (.*)" tests: sample.basic.helloworld: tags: int...
/content/code_sandbox/samples/hello_world/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
82
```c /* * */ #include <stdio.h> int main(void) { printf("Hello World! %s\n", CONFIG_BOARD_TARGET); return 0; } ```
/content/code_sandbox/samples/hello_world/src/main.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
32
```restructuredtext .. _application-development-samples: Application development samples ############################### For application development you should also consider looking at `example-application`_. Among others, you will find on it out of tree driver or board examples. .. toctree:: :maxdepth: 1 :glo...
/content/code_sandbox/samples/application_development/application_development.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
75
```restructuredtext .. _external_library: External Library ################# Overview ******** A simple example that demonstrates how to include an external static library into the Zephyr build system. The demonstrates both how to build the external library using a different build system and how to include the built...
/content/code_sandbox/samples/application_development/external_lib/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
199
```unknown CONFIG_STDOUT_CONSOLE=y ```
/content/code_sandbox/samples/application_development/external_lib/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
7
```yaml sample: name: External Library tests: sample.app_dev.external_lib: integration_platforms: - native_sim tags: external harness: console harness_config: type: multi_line regex: - "Hello World!" - "mylib says: Hello World!" ```
/content/code_sandbox/samples/application_development/external_lib/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
67
```c /* * */ /* hello world example: calling functions from a static library */ #include <zephyr/kernel.h> #include <stdio.h> #include <mylib.h> int main(void) { printf("Hello World!\n"); mylib_hello_world(); return 0; } ```
/content/code_sandbox/samples/application_development/external_lib/src/main.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
57
```c /* * */ /** * @file * * Dining philosophers demo * * The demo can be configured to use different object types for its * synchronization: SEMAPHORES, MUTEXES, STACKS, FIFOS and LIFOS. To configure * a specific object, set the value of FORKS to one of these. * * By default, the demo uses MUTEXES. * * T...
/content/code_sandbox/samples/philosophers/src/main.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
1,706
```unknown # # # PREFIX ?= . OBJ_DIR ?= $(PREFIX)/obj LIB_DIR ?= $(PREFIX)/lib ifeq ($(findstring Windows, $(OS)),Windows) DEL := rmdir /S /Q MKDIR := mkdir else DEL := rm -rf MKDIR := mkdir -p endif all: -$(MKDIR) "$(OBJ_DIR)" -$(MKDIR) "$(LIB_DIR)" $(CC) -c $(CFLAGS) -MD -Iinclude src/mylib.c -o $(OBJ_DIR)/...
/content/code_sandbox/samples/application_development/external_lib/mylib/Makefile
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
161
```c /* * */ #include "mylib.h" #include <stdio.h> int mylib_hello_world(void) { printf("mylib says: Hello World!\n"); return 0; } ```
/content/code_sandbox/samples/application_development/external_lib/mylib/src/mylib.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
39
```objective-c /* * */ #ifndef _MYLIB_H_ #define _MYLIB_H_ int mylib_hello_world(void); #endif ```
/content/code_sandbox/samples/application_development/external_lib/mylib/include/mylib.h
objective-c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
25
```linker script /* * */ /** * @file * @brief Linker command/script file * * Linker script for the Cortex-M platforms. */ #include <zephyr/linker/sections.h> #include <zephyr/devicetree.h> #include <zephyr/linker/linker-defs.h> #include <zephyr/linker/linker-tool.h> #if defined(CONFIG_NORDIC_QSPI_NOR) && def...
/content/code_sandbox/samples/application_development/code_relocation_nocopy/linker_arm_nocopy.ld
linker script
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
647
```restructuredtext .. _code_relocation_nocopy: Code relocation nocopy ###################### Overview ******** A simple example that demonstrates how relocation of code, data or bss sections using a custom linker script. Differently from the code relocation sample, this sample is relocating the content of the ext_c...
/content/code_sandbox/samples/application_development/code_relocation_nocopy/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
544
```unknown CONFIG_CODE_DATA_RELOCATION=y CONFIG_HAVE_CUSTOM_LINKER_SCRIPT=y CONFIG_CUSTOM_LINKER_SCRIPT="linker_arm_nocopy.ld" CONFIG_BUILD_NO_GAP_FILL=y CONFIG_COVERAGE=n CONFIG_XIP=y CONFIG_LOG=y ```
/content/code_sandbox/samples/application_development/code_relocation_nocopy/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
51
```yaml sample: description: Code data relocation nocopy Sample name: code relocation nocopy tests: sample.application_development.code_relocation_nocopy: platform_allow: - qemu_cortex_m3 - nrf5340dk/nrf5340/cpuapp - stm32f769i_disco - stm32h7b3i_dk - stm32h573i_dk - b_u585...
/content/code_sandbox/samples/application_development/code_relocation_nocopy/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
187
```c /* * */ #include <zephyr/kernel.h> #include <zephyr/sys/printk.h> uint32_t var_sram_data = 10U; void function_in_sram(void) { printk("Address of %s %p\n", __func__, &function_in_sram); printk("Address of var_sram_data %p (%d)\n", &var_sram_data, var_sram_data); } ```
/content/code_sandbox/samples/application_development/code_relocation_nocopy/src/sram_code.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
88
```c /* * */ #include <zephyr/kernel.h> #include <zephyr/sys/printk.h> /* * This function will allow execute from sram region. This is needed only for * this sample because by default all soc will disable the execute from SRAM. * An application that requires that the code be executed from SRAM will have * to c...
/content/code_sandbox/samples/application_development/code_relocation_nocopy/src/main.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
393
```c /* * */ #include <zephyr/kernel.h> #include <zephyr/sys/printk.h> uint32_t var_ext_sram_data = 10U; void function_in_ext_flash(void) { printk("Address of %s %p\n", __func__, &function_in_ext_flash); printk("Address of var_ext_sram_data %p (%d)\n", &var_ext_sram_data, var_ext_sram_data); } ```
/content/code_sandbox/samples/application_development/code_relocation_nocopy/src/ext_code.c
c
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
92
```unknown CONFIG_FLASH=y CONFIG_NORDIC_QSPI_NOR=y CONFIG_NORDIC_QSPI_NOR_XIP=y ```
/content/code_sandbox/samples/application_development/code_relocation_nocopy/boards/nrf5340dk_nrf5340_cpuapp.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
27
```unknown CONFIG_FLASH=y CONFIG_STM32_MEMMAP=y ```
/content/code_sandbox/samples/application_development/code_relocation_nocopy/boards/stm32h750b_dk.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
13
```unknown CONFIG_FLASH=y CONFIG_STM32_MEMMAP=y ```
/content/code_sandbox/samples/application_development/code_relocation_nocopy/boards/stm32h747i_disco_m7.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
13
```unknown CONFIG_FLASH=y CONFIG_STM32_MEMMAP=y ```
/content/code_sandbox/samples/application_development/code_relocation_nocopy/boards/stm32h573i_dk.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
13
```unknown CONFIG_FLASH=y CONFIG_STM32_MEMMAP=y ```
/content/code_sandbox/samples/application_development/code_relocation_nocopy/boards/stm32h745i_disco_m7.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
13
```unknown CONFIG_FLASH=y CONFIG_STM32_MEMMAP=y ```
/content/code_sandbox/samples/application_development/code_relocation_nocopy/boards/b_u585i_iot02a.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
13
```unknown CONFIG_FLASH=y CONFIG_STM32_MEMMAP=y ```
/content/code_sandbox/samples/application_development/code_relocation_nocopy/boards/stm32f769i_disco.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
13
```unknown CONFIG_FLASH=y CONFIG_STM32_MEMMAP=y ```
/content/code_sandbox/samples/application_development/code_relocation_nocopy/boards/stm32h7b3i_dk.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
13
```restructuredtext .. _fs-samples: FS Samples ########## .. toctree:: :maxdepth: 1 :glob: **/* ```
/content/code_sandbox/samples/subsys/fs/fs.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
32
```restructuredtext .. _subsystem-samples: Various Subsystems Samples ########################## .. toctree:: :titlesonly: :maxdepth: 2 :glob: */* ```
/content/code_sandbox/samples/subsys/subsys.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
40
```unknown CONFIG_LOG=y CONFIG_LOG_MODE_IMMEDIATE=y CONFIG_MAIN_STACK_SIZE=2048 CONFIG_FILE_SYSTEM=y CONFIG_FILE_SYSTEM_EXT2=y # Enable to allow formatting # CONFIG_FILE_SYSTEM_MKFS=y # CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_DISK_ACCESS=y CONFIG_DISK_DRIVER_SDMMC=y # First block of first partition after GPT CONFIG...
/content/code_sandbox/samples/subsys/fs/fs_sample/prj_ext.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
90
```unknown # # # mainmenu "Filesystems Sample Application" config FS_SAMPLE_CREATE_SOME_ENTRIES bool "When no files are found on mounted partition create some" default y help In case when no files could be listed, because there are none, "some.dir" directory and "other.txt" file will be created and list w...
/content/code_sandbox/samples/subsys/fs/fs_sample/Kconfig
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
133
```unknown CONFIG_DISK_ACCESS=y CONFIG_LOG=y CONFIG_FILE_SYSTEM=y CONFIG_FAT_FILESYSTEM_ELM=y CONFIG_PRINTK=y CONFIG_MAIN_STACK_SIZE=2048 ```
/content/code_sandbox/samples/subsys/fs/fs_sample/prj.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
37
```restructuredtext .. zephyr:code-sample:: fs :name: File system manipulation :relevant-api: file_system_api disk_access_interface Use file system API with various filesystems and storage devices. Overview ******** This sample app demonstrates use of the file system API and uses the FAT or Ext2 file system...
/content/code_sandbox/samples/subsys/fs/fs_sample/README.rst
restructuredtext
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
866
```yaml sample: name: Filesystems sample common: tags: filesystem modules: - fatfs tests: sample.filesystem.fat_fs: depends_on: sdhc harness: console harness_config: fixture: fixture_sdhc sample.filesystem.fat_fs.overlay: platform_allow: nrf52840_blip sample.filesystem.fat_fs.adafr...
/content/code_sandbox/samples/subsys/fs/fs_sample/sample.yaml
yaml
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
699
```unknown # # # CONFIG_DISK_DRIVERS=y CONFIG_DISK_DRIVER_RAM=y CONFIG_DISK_DRIVER_FLASH=n # There may be no files on internal SoC flash, so this Kconfig # options has ben enabled to create some if listing does not # find in the first place. CONFIG_FS_SAMPLE_CREATE_SOME_ENTRIES=y ```
/content/code_sandbox/samples/subsys/fs/fs_sample/boards/nrf52840dk_nrf52840_ram_disk.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
68
```unknown /* * */ /* Note that default partition layout, provided by board DTS, is not * altered here as external_partition used by the disk is defined * over QSPI device and does not collide with any other partition * definition. */ &mx25r64 { partitions { compatible = "fixed-partitions"; #address-cells ...
/content/code_sandbox/samples/subsys/fs/fs_sample/boards/nrf52840dk_nrf52840_qspi.overlay
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
194
```unknown /* * */ &spi1 { status = "okay"; cs-gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>; sdhc0: sdhc@0 { compatible = "zephyr,sdhc-spi-slot"; reg = <0>; status = "okay"; mmc { compatible = "zephyr,sdmmc-disk"; status = "okay"; }; spi-max-frequency = <24000000>; }; }; ```
/content/code_sandbox/samples/subsys/fs/fs_sample/boards/nrf52840_blip.overlay
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
105
```unknown /* * */ /* Because FAT FS needs at least 64kiB partition and default * storage_partition is 32kiB for that board, we need to reorgatnize * partitions to get at least 64KiB. * This overlay removes image slot partitions and strips each of 64kiB, * and removes the storage partition to add the additional ...
/content/code_sandbox/samples/subsys/fs/fs_sample/boards/nrf52840dk_nrf52840.overlay
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
308
```unknown # # # CONFIG_DISK_DRIVERS=y CONFIG_DISK_DRIVER_FLASH=y # There may be no files on internal SoC flash, so this Kconfig # options has ben enabled to create some if listing does not # find in the first place. CONFIG_FS_SAMPLE_CREATE_SOME_ENTRIES=y ```
/content/code_sandbox/samples/subsys/fs/fs_sample/boards/nrf54l15pdk_nrf54l15_cpuapp.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
62
```unknown CONFIG_SPI=y CONFIG_DISK_DRIVER_SDMMC=y ```
/content/code_sandbox/samples/subsys/fs/fs_sample/boards/nucleo_f429zi.conf
unknown
2016-05-26T17:54:19
2024-08-16T18:09:06
zephyr
zephyrproject-rtos/zephyr
10,307
12