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
.. zephyr:code-sample:: settings
:name: Settings API
:relevant-api: settings settings_rt settings_name_proc
Load and save configuration values using the settings API.
Overview
********
This is a simple application demonstrating use of the settings runtime
configuration module. In this ap... | /content/code_sandbox/samples/subsys/settings/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 647 |
```unknown
CONFIG_HEAP_MEM_POOL_SIZE=256
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
``` | /content/code_sandbox/samples/subsys/settings/socs/esp32c3.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```yaml
sample:
name: Settings Sample
tests:
sample.subsys.settings:
tags: settings
timeout: 10
platform_allow:
- qemu_x86
- native_posix
- native_posix/native/64
- native_sim
- native_sim/native/64
- mr_canhubk3
- nrf54l15pdk/nrf54l15/cpuapp
- nrf54h20dk... | /content/code_sandbox/samples/subsys/settings/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 413 |
```unknown
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
``` | /content/code_sandbox/samples/subsys/settings/boards/nrf54h20dk_nrf54h20_cpuapp.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 12 |
```unknown
# Enable the LittleFS file system.
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y
CONFIG_SETTINGS_FILE=y
CONFIG_SETTINGS_FILE_PATH="/ff/settings/run"
``` | /content/code_sandbox/samples/subsys/settings/boards/native_sim_native_64.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```unknown
/*
*
*/
#include "native_posix.overlay"
``` | /content/code_sandbox/samples/subsys/settings/boards/native_posix_native_64.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 11 |
```unknown
/*
*
*/
#include "native_sim.overlay"
``` | /content/code_sandbox/samples/subsys/settings/boards/native_sim_native_64.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 10 |
```unknown
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
``` | /content/code_sandbox/samples/subsys/settings/boards/nrf54l15pdk_nrf54l15_cpuapp.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 12 |
```unknown
# Enable the LittleFS file system.
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y
CONFIG_SETTINGS_FILE=y
CONFIG_SETTINGS_FILE_PATH="/ff/settings/run"
``` | /content/code_sandbox/samples/subsys/settings/boards/native_sim.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```unknown
CONFIG_HEAP_MEM_POOL_SIZE=256
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
``` | /content/code_sandbox/samples/subsys/settings/boards/esp32s2_saola.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```unknown
CONFIG_HEAP_MEM_POOL_SIZE=256
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
``` | /content/code_sandbox/samples/subsys/settings/boards/esp32s3_luatos_core_procpu.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```unknown
CONFIG_HEAP_MEM_POOL_SIZE=256
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
``` | /content/code_sandbox/samples/subsys/settings/boards/esp32s3_luatos_core_procpu_usb.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```unknown
# Enable the LittleFS file system.
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y
CONFIG_SETTINGS_FILE=y
CONFIG_SETTINGS_FILE_PATH="/ff/settings/run"
``` | /content/code_sandbox/samples/subsys/settings/boards/native_posix.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```unknown
CONFIG_HEAP_MEM_POOL_SIZE=256
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
``` | /content/code_sandbox/samples/subsys/settings/boards/esp32_devkitc_wroom_procpu.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```unknown
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
``` | /content/code_sandbox/samples/subsys/settings/boards/qemu_x86.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 12 |
```unknown
CONFIG_HEAP_MEM_POOL_SIZE=256
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
``` | /content/code_sandbox/samples/subsys/settings/boards/yd_esp32_procpu.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```unknown
/*
*
*/
/delete-node/ &storage_partition;
/delete-node/ &scratch_partition;
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
storage_partition: partition@70000 {
label = "storage";
reg = <0x00070000 0x8000>;
};
};
};
``` | /content/code_sandbox/samples/subsys/settings/boards/native_sim.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 91 |
```unknown
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_ARM_MPU=n
``` | /content/code_sandbox/samples/subsys/settings/boards/nrf52dk_nrf52832.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 18 |
```unknown
#include "native_sim.overlay"
``` | /content/code_sandbox/samples/subsys/settings/boards/native_posix.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 7 |
```unknown
CONFIG_HEAP_MEM_POOL_SIZE=256
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
``` | /content/code_sandbox/samples/subsys/settings/boards/esp32s3_devkitm_procpu.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```unknown
CONFIG_NVS=y
CONFIG_SETTINGS_NVS=y
CONFIG_ARM_MPU=n
``` | /content/code_sandbox/samples/subsys/settings/boards/nrf52840dk_nrf52840.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 18 |
```unknown
# Enable the LittleFS file system.
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y
CONFIG_SETTINGS_FILE=y
CONFIG_SETTINGS_FILE_PATH="/ff/settings/run"
``` | /content/code_sandbox/samples/subsys/settings/boards/native_posix_native_64.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```unknown
# Use LittleFS file system as Settings backend
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y
CONFIG_SETTINGS_FILE=y
CONFIG_SETTINGS_FILE_PATH="/ff/settings/run"
``` | /content/code_sandbox/samples/subsys/settings/boards/mr_canhubk3.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 39 |
```restructuredtext
.. _input-samples:
Input Samples
#############
.. toctree::
:maxdepth: 1
:glob:
**/*
``` | /content/code_sandbox/samples/subsys/input/input.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 32 |
```restructuredtext
.. zephyr:code-sample:: input-dump
:name: Input dump
:relevant-api: input_events
Print all input events.
Overview
********
The Input Dump sample prints any input event using the :ref:`input` APIs.
Requirements
************
The samples works on any board with an input driver defined in ... | /content/code_sandbox/samples/subsys/input/input_dump/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 165 |
```unknown
configdefault INPUT_SHELL
default y
configdefault INPUT_SHELL_KBD_MATRIX_STATE
default y
source "Kconfig.zephyr"
``` | /content/code_sandbox/samples/subsys/input/input_dump/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 32 |
```unknown
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
CONFIG_INPUT=y
CONFIG_INPUT_EVENT_DUMP=y
``` | /content/code_sandbox/samples/subsys/input/input_dump/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 22 |
```yaml
sample:
name: Input Dump
common:
tags: input
build_only: true
integration_platforms:
- native_sim
tests:
sample.input.input_dump: {}
sample.input.input_dump_shell:
extra_configs:
- CONFIG_SHELL=y
``` | /content/code_sandbox/samples/subsys/input/input_dump/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 59 |
```c
/*
*
*/
#include <stdio.h>
int main(void)
{
printf("Input sample started\n");
return 0;
}
``` | /content/code_sandbox/samples/subsys/input/input_dump/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 26 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/input/esp32-touch-sensor-input.h>
&touch {
status = "okay";
touch_sensor_set: touch_sensor_0 {
channel-num = <9>;
channel-sens = <20>;
zephyr,code = <INPUT_KEY_0>;
};
touch_sensor_play: touch_sensor_1... | /content/code_sandbox/samples/subsys/input/input_dump/boards/esp32_devkitc_wroom_procpu.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 210 |
```c
/*
*
*/
#include <stdio.h>
#include <string.h>
#include <zephyr/settings/settings.h>
#include <errno.h>
#include <zephyr/sys/printk.h>
#if defined(CONFIG_SETTINGS_FILE)
#include <zephyr/fs/fs.h>
#include <zephyr/fs/littlefs.h>
#endif
#define STORAGE_PARTITION storage_partition
#define STORAGE_PARTITION_ID F... | /content/code_sandbox/samples/subsys/settings/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 3,728 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/input/esp32-touch-sensor-input.h>
&touch {
status = "okay";
touch_sensor_set: touch_sensor_0 {
channel-num = <9>;
channel-sens = <20>;
zephyr,code = <INPUT_KEY_0>;
};
touch_sensor_play: touch_sensor_1... | /content/code_sandbox/samples/subsys/input/input_dump/boards/esp32s3_devkitm_procpu.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 210 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/input/esp32-touch-sensor-input.h>
&touch {
status = "okay";
touch_sensor_set: touch_sensor_0 {
channel-num = <9>;
channel-sens = <20>;
zephyr,code = <INPUT_KEY_0>;
};
touch_sensor_play: touch_sensor_1... | /content/code_sandbox/samples/subsys/input/input_dump/boards/esp32s2_saola.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 210 |
```restructuredtext
.. _usbc-samples:
USB-C device support samples
############################
.. toctree::
:maxdepth: 1
:glob:
**/*
``` | /content/code_sandbox/samples/subsys/usb_c/usbc.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/input/esp32-touch-sensor-input.h>
&touch {
status = "okay";
touch_sensor_set: touch_sensor_0 {
channel-num = <9>;
channel-sens = <20>;
zephyr,code = <INPUT_KEY_0>;
};
touch_sensor_play: touch_sensor_1... | /content/code_sandbox/samples/subsys/input/input_dump/boards/esp32_devkitc_wrover_procpu.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 210 |
```unknown
CONFIG_USBC_STACK=y
CONFIG_USBC_CSM_SOURCE_ONLY=y
CONFIG_USBC_THREAD_PRIORITY=10
CONFIG_ADC=y
CONFIG_PWM=y
CONFIG_LOG=y
``` | /content/code_sandbox/samples/subsys/usb_c/source/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```yaml
sample:
name: USB-C SOURCE
tests:
sample.usbc.source:
depends_on: tcpc
tags: usbc
platform_allow: stm32g081b_eval
harness: console
harness_config:
type: one_line
regex:
- "Unattached.SRC"
``` | /content/code_sandbox/samples/subsys/usb_c/source/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 68 |
```restructuredtext
.. zephyr:code-sample:: usb-c-source
:name: Basic USB-C Source
:relevant-api: _usbc_device_api
Implement a USB-C Power Delivery application in the form of a USB-C Source.
Overview
********
This example demonstrates how to create a USB-C Power Delivery application
using the USB-C subsyste... | /content/code_sandbox/samples/subsys/usb_c/source/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 614 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/adc.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/init.h>
#include <zephyr/usb_c/usbc.h>
#include <zephyr/drivers/pwm.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(power_ctrl, L... | /content/code_sandbox/samples/subsys/usb_c/source/src/power_ctrl.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,296 |
```objective-c
/*
*
*/
#ifndef _POWER_CTRL_H_
#define _POWER_CTRL_H_
/**
* @brief VBUS levels
*/
enum source_t {
/* VBUS off */
SOURCE_0V,
/* VBUS at default */
SOURCE_5V,
/* VBUS at 9V */
SOURCE_9V,
/* VBUS at 15V */
SOURCE_15V
};
/**
* @brief VCONN control
*/
enum vconn_t {
/* VCONN OFF */
VCONN_OF... | /content/code_sandbox/samples/subsys/usb_c/source/src/power_ctrl.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 182 |
```unknown
/*
*
*
*/
#include <dt-bindings/usb-c/pd.h>
/ {
aliases {
usbc-port0 = &port1;
};
pwmleds {
compatible = "pwm-leds";
pwm_ctl: g0 {
pwms = <&pwm15 1 PWM_USEC(50) PWM_POLARITY_INVERTED>;
label = "PWM CTL";
};
};
pwrctrl {
compatible = "gpio-leds";
/* Pin D3 is used to enable VBUS... | /content/code_sandbox/samples/subsys/usb_c/source/boards/stm32g081b_eval.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 594 |
```xml
<?xml version='1.0' encoding='utf-8'?>
<vif:VIF xmlns:vif="path_to_url">
<vif:Vendor_Name>Zephyr</vif:Vendor_Name>
<vif:Model_Part_Number>Sink</vif:Model_Part_Number>
<vif:Product_Revision>1</vif:Product_Revision>
<vif:TID>0</vif:TID>
<vif:VIF_Product_Type value="0">Port Product</vif:VIF_Product_Type>
... | /content/code_sandbox/samples/subsys/usb_c/sink/vif.xml | xml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 149 |
```restructuredtext
.. zephyr:code-sample:: usb-c-sink
:name: Basic USB-C Sink
:relevant-api: _usbc_device_api
Implement a USB-C Power Delivery application in the form of a USB-C Sink.
Overview
********
This example demonstrates how to create a USB-C Power Delivery application and
how to generate USB VIF po... | /content/code_sandbox/samples/subsys/usb_c/sink/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 865 |
```unknown
CONFIG_USBC_STACK=y
CONFIG_USBC_CSM_SINK_ONLY=y
CONFIG_USBC_THREAD_PRIORITY=10
CONFIG_ADC=y
CONFIG_LOG=y
CONFIG_BUILD_OUTPUT_VIF=y
``` | /content/code_sandbox/samples/subsys/usb_c/sink/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 40 |
```yaml
sample:
name: USB-C SINK
tests:
sample.usbc.sink:
depends_on: tcpc
tags: usbc
platform_allow: b_g474e_dpow1
integration_platforms:
- b_g474e_dpow1
harness: console
harness_config:
type: one_line
regex:
- "Unattached.SNK"
``` | /content/code_sandbox/samples/subsys/usb_c/sink/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 86 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/usb_c/usbc.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(main, LOG_LEVEL_DBG);
#include "power_ctrl.h"
#define USBC_PORT0_NODE DT_ALIAS(usbc_port0)
#define ... | /content/code_sandbox/samples/subsys/usb_c/source/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 2,889 |
```unknown
#include <dt-bindings/usb-c/pd.h>
/ {
aliases {
usbc-port0 = &port0;
};
ports {
#address-cells = <1>;
#size-cells = <0>;
port0: usbc-port@0 {
compatible = "usb-c-connector";
reg = <0>;
tcpc = <&tcpc0>;
vbus = <&vbus0>;
ppc = <&ppc0>;
power-role = "sink";
sink-pdos = <PDO_F... | /content/code_sandbox/samples/subsys/usb_c/sink/boards/numaker_m2l31ki.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 635 |
```unknown
/*
*
*
*/
#include <dt-bindings/usb-c/pd.h>
/ {
aliases {
usbc-port0 = &port1;
};
/* usbc.rst vbus-voltage-divider-adc start */
vbus1: vbus {
compatible = "zephyr,usb-c-vbus-adc";
io-channels = <&adc2 8>;
output-ohms = <49900>;
full-ohms = <(330000 + 49900)>;
};
/* usbc.rst vbus-voltage... | /content/code_sandbox/samples/subsys/usb_c/sink/boards/b_g474e_dpow1.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 265 |
```unknown
/*
*
*
*/
#include <dt-bindings/usb-c/pd.h>
/ {
aliases {
usbc-port0 = &port1;
};
vbus1: vbus {
compatible = "zephyr,usb-c-vbus-adc";
io-channels = <&adc1 9>;
output-ohms = <49900>;
full-ohms = <(330000 + 49900)>;
/* Pin B13 is used to control VBUS Discharge for Port1 */
discharge-gpi... | /content/code_sandbox/samples/subsys/usb_c/sink/boards/stm32g081b_eval.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 246 |
```unknown
CONFIG_USBC_PPC_DRIVER=y
``` | /content/code_sandbox/samples/subsys/usb_c/sink/boards/numaker_m2l31ki.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 9 |
```unknown
/*
*
*
*/
#include <dt-bindings/usb-c/pd.h>
&adc2 {
status = "okay";
};
&vbus1 {
status = "okay";
};
&usbc1 {
status = "okay";
};
&clk_hsi {
/* The HSI is used by ucpd1 */
status = "okay";
};
&ucpd1 {
status = "okay";
dead-battery;
};
``` | /content/code_sandbox/samples/subsys/usb_c/sink/boards/weact_stm32g431_core.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 89 |
```unknown
CONFIG_IDLE_STACK_SIZE=4096
CONFIG_TRACING=y
CONFIG_TRACING_TEST=y
CONFIG_TRACING_BACKEND_UART=y
CONFIG_TRACING_BUFFER_SIZE=4096
``` | /content/code_sandbox/samples/subsys/tracing/prj_uart.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```unknown
CONFIG_GPIO=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_VID=0x2FE9
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
CONFIG_TRACING=y
CONFIG_TRACING_TEST=y
CONFIG_TRACING_BACKEND_USB=y
CONFIG_TRACING_BUFFER_SIZE=4096
CONFIG_TRACING_HANDLE_HOST_CMD=y
``` | /content/code_sandbox/samples/subsys/tracing/prj_usb.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 67 |
```unknown
CONFIG_TRACING=y
CONFIG_TRACING_CTF=y
CONFIG_TRACING_SYNC=y
CONFIG_TRACING_BACKEND_POSIX=y
CONFIG_TRACING_PACKET_MAX_SIZE=64
``` | /content/code_sandbox/samples/subsys/tracing/prj_native_ctf.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/usb_c/usbc.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(main, LOG_LEVEL_DBG);
#define USBC_PORT0_NODE DT_ALIAS(usbc_port0)
#define USBC_PORT0_POWER_ROLE DT_... | /content/code_sandbox/samples/subsys/usb_c/sink/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 2,645 |
```unknown
CONFIG_GPIO=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_VID=0x2FE9
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
CONFIG_TRACING=y
CONFIG_TRACING_CTF=y
CONFIG_TRACING_ASYNC=y
CONFIG_TRACING_BACKEND_USB=y
CONFIG_TRACING_HANDLE_HOST_CMD=y
CONFIG_TRACING_BUFFER_SIZE=4096
``` | /content/code_sandbox/samples/subsys/tracing/prj_usb_ctf.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 74 |
```unknown
CONFIG_TRACING=y
CONFIG_TRACING_CTF=y
CONFIG_TRACING_BACKEND_UART=y
CONFIG_TRACING_BUFFER_SIZE=4096
``` | /content/code_sandbox/samples/subsys/tracing/prj_uart_ctf.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 29 |
```unknown
CONFIG_TRACING=y
CONFIG_TRACING_USER=y
CONFIG_IDLE_STACK_SIZE=2048
``` | /content/code_sandbox/samples/subsys/tracing/prj_user.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 20 |
```unknown
CONFIG_TRACING=y
CONFIG_SEGGER_SYSTEMVIEW=y
CONFIG_IDLE_STACK_SIZE=2048
CONFIG_SEGGER_SYSTEMVIEW_BOOT_ENABLE=n
CONFIG_SEGGER_SYSVIEW_POST_MORTEM_MODE=n
``` | /content/code_sandbox/samples/subsys/tracing/prj_sysview.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 42 |
```unknown
# enable to use thread names
CONFIG_THREAD_NAME=y
CONFIG_MP_MAX_NUM_CPUS=1
CONFIG_DEBUG_THREAD_INFO=y
CONFIG_PERCEPIO_TRACERECORDER=y
CONFIG_TRACING=y
``` | /content/code_sandbox/samples/subsys/tracing/prj_percepio.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 44 |
```unknown
# enable to use thread names
CONFIG_THREAD_NAME=y
CONFIG_MP_MAX_NUM_CPUS=1
# Debugging
CONFIG_DEBUG_OPTIMIZATIONS=n
CONFIG_DEBUG_THREAD_INFO=y
``` | /content/code_sandbox/samples/subsys/tracing/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 40 |
```restructuredtext
.. zephyr:code-sample:: tracing
:name: Tracing
Send tracing formatted packet to the host with supported backends.
This application can be used to demonstrate the tracing feature. The tracing
formatted packet will be sent to the host with the currently supported tracing
backend under tracing ... | /content/code_sandbox/samples/subsys/tracing/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 752 |
```yaml
common:
tags:
- tracing
- debug
harness: console
harness_config:
type: multi_line
regex:
- "thread_a: Hello World from (.*)!"
- "thread_b: Hello World from (.*)!"
tests:
sample.tracing.user:
extra_args: CONF_FILE="prj_user.conf"
integration_platforms:
- qemu_x86... | /content/code_sandbox/samples/subsys/tracing/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 610 |
```c
/*
*
*/
#include <tracing_user.h>
static int nested_interrupts[CONFIG_MP_MAX_NUM_CPUS];
void sys_trace_thread_switched_in_user(void)
{
unsigned int key = irq_lock();
__ASSERT_NO_MSG(nested_interrupts[_current_cpu->id] == 0);
/* Can't use k_current_get as thread base and z_tls_current might be incorrect */... | /content/code_sandbox/samples/subsys/tracing/src/tracing_user.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 322 |
```unknown
/ {
chosen {
zephyr,tracing-uart = &uart1;
};
};
``` | /content/code_sandbox/samples/subsys/tracing/boards/qemu_x86_64.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 23 |
```unknown
/ {
chosen {
zephyr,tracing-uart = &uart1;
};
};
``` | /content/code_sandbox/samples/subsys/tracing/boards/mps2_an521_cpu0.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 23 |
```unknown
CONFIG_TRACING=y
CONFIG_TRACING_TEST=y
CONFIG_TRACING_SYNC=y
CONFIG_TRACING_BACKEND_POSIX=y
CONFIG_TRACING_PACKET_MAX_SIZE=64
``` | /content/code_sandbox/samples/subsys/tracing/boards/native_sim.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 35 |
```unknown
/ {
chosen {
zephyr,tracing-uart = &uart1;
};
};
``` | /content/code_sandbox/samples/subsys/tracing/boards/qemu_x86.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 23 |
```unknown
CONFIG_TRACING=y
CONFIG_TRACING_TEST=y
CONFIG_TRACING_SYNC=y
CONFIG_TRACING_BACKEND_POSIX=y
CONFIG_TRACING_PACKET_MAX_SIZE=64
``` | /content/code_sandbox/samples/subsys/tracing/boards/native_posix.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 35 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/logging/log.h>
#include <zephyr/usb/usb_device.h>
/*
* The hello world 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 stat... | /content/code_sandbox/samples/subsys/tracing/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 715 |
```restructuredtext
.. _smf-samples:
State Machine Framework Samples
###############################
.. toctree::
:maxdepth: 1
:glob:
**/*
``` | /content/code_sandbox/samples/subsys/smf/smf.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 35 |
```unknown
CONFIG_DEBUG=y
CONFIG_LOG=y
CONFIG_SHELL=y
# Needed for boards that enable RTT backends for logging
# e.g. nrf52840dk/nrf52840 and any others that enable it
CONFIG_LOG_BACKEND_RTT=n
# Enable the state machine framework
CONFIG_SMF=y
CONFIG_SMF_ANCESTOR_SUPPORT=y
CONFIG_SMF_INITIAL_TRANSITION=y
# Enable flo... | /content/code_sandbox/samples/subsys/smf/smf_calculator/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 249 |
```yaml
sample:
description: SMF Calculator GUI Application
name: smf_calculator
tests:
sample.smf.smf_calculator:
filter: dt_chosen_enabled("zephyr,display")
# Sample takes ~300k on disco_l475_iot1 board, add 50k just in case.
# Ram usage is 70k on disco_l475_iot1 board with adafruit_2_8_tft_touch_v2... | /content/code_sandbox/samples/subsys/smf/smf_calculator/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 193 |
```objective-c
/*
*
*/
#ifndef SMF_CALCULATOR_THREAD_H_
#define SMF_CALCULATOR_THREAD_H_
#include <zephyr/kernel.h>
#define SMF_THREAD_STACK_SIZE 1024
#define SMF_THREAD_PRIORITY 7
#define CALCULATOR_MAX_DIGITS 15
/* Add one byte for '-' sign, one for trailing '\0' */
#define CALCULATOR_STRING_LENGTH (CALCULAT... | /content/code_sandbox/samples/subsys/smf/smf_calculator/src/smf_calculator_thread.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 187 |
```restructuredtext
.. zephyr:code-sample:: smf_calculator
:name: SMF Calculator
:relevant-api: smf
Create a simple desk calculator using the State Machine Framework.
Overview
********
This sample creates a basic desk calculator driven by a state machine written
with the :ref:`State Machine Framework <smf>`... | /content/code_sandbox/samples/subsys/smf/smf_calculator/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 931 |
```objective-c
/*
*
*/
/* Constants for control sizes as a percentage of screen size. */
#define CALC_BTN_WIDTH_PCT 90
#define CALC_BTN_HEIGHT_PCT 80
#define CALC_RESULT_WIDTH_PCT 70
#define CALC_RESULT_OFFSET_PCT 10
void update_display(const char *output);
``` | /content/code_sandbox/samples/subsys/smf/smf_calculator/src/main.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 64 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/shell/shell.h>
#include "smf_calculator_thread.h"
#include <stdlib.h>
static int cmd_smf_key(const struct shell *sh, size_t argc, char **argv)
{
struct calculator_event event;
char c = argv[1][0];
event.operand = c;
if ((c >= '1') && (c <= '9')) {
eve... | /content/code_sandbox/samples/subsys/smf/smf_calculator/src/smf_console_cmds.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 396 |
```c
/*
*
*/
#include "main.h"
#include <zephyr/kernel.h>
#include "smf_calculator_thread.h"
#include <zephyr/drivers/display.h>
#include <lvgl.h>
#include <stdio.h>
#include <string.h>
#include <lvgl_input_device.h>
#include <zephyr/logging/log.h>
#define LOG_LEVEL CONFIG_LOG_DEFAULT_LEVEL
LOG_MODULE_REGISTER(main... | /content/code_sandbox/samples/subsys/smf/smf_calculator/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,694 |
```restructuredtext
.. zephyr:code-sample:: smf_hsm_psicc2
:name: Hierarchical State Machine Demo based on example from PSiCC2
:relevant-api: smf
Implement an event-driven hierarchical state machine using State Machine Framework (SMF).
Overview
********
This sample demonstrates the :ref:`State Machine Frame... | /content/code_sandbox/samples/subsys/smf/hsm_psicc2/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 523 |
```unknown
CONFIG_LOG=y
CONFIG_SHELL=y
# Needed for boards that enable RTT backends for logging
# e.g. nrf52840dk/nrf52840 and any others that enable it
CONFIG_LOG_BACKEND_RTT=n
# Enable the state machine framework
CONFIG_SMF=y
CONFIG_SMF_ANCESTOR_SUPPORT=y
CONFIG_SMF_INITIAL_TRANSITION=y
``` | /content/code_sandbox/samples/subsys/smf/hsm_psicc2/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 80 |
```yaml
sample:
name: SMF HSM PSiCC2 Demo
common:
tags:
- smf
integration_platforms:
- native_sim
harness: console
harness_config:
type: multi_line
ordered: true
regex:
- ".*<inf> hsm_psicc2_thread: initial_entry.*"
- ".*<inf> hsm_psicc2_thread: s_entry.*"
- ".*<inf> hsm_... | /content/code_sandbox/samples/subsys/smf/hsm_psicc2/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 165 |
```objective-c
/*
* State Machine example copyright (c) Miro Samek
*
* Implementation of the statechart in Figure 2.11 of
* Practical UML Statecharts in C/C++, 2nd Edition by Miro Samek
* path_to_url
* Used with permission of the author.
*
*/
#ifndef _HSM_PSICC2_THREAD_H
#define _HSM_PSICC2_THREAD_H
#define H... | /content/code_sandbox/samples/subsys/smf/hsm_psicc2/src/hsm_psicc2_thread.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 278 |
```c
/*
* State Machine example copyright (c) Miro Samek
*
* Implementation of the statechart in Figure 2.11 of
* Practical UML Statecharts in C/C++, 2nd Edition by Miro Samek
* path_to_url
* Used with permission of the author.
*
*/
#include <zephyr/kernel.h>
#include <zephyr/smf.h>
#include <stdbool.h>
#inclu... | /content/code_sandbox/samples/subsys/smf/hsm_psicc2/src/hsm_psicc2_thread.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 2,339 |
```c
/*
* State Machine example copyright (c) Miro Samek
*
* Implementation of the statechart in Figure 2.11 of
* Practical UML Statecharts in C/C++, 2nd Edition by Miro Samek
* path_to_url
* Used with permission of the author.
*
*/
#include <zephyr/kernel.h>
#include "hsm_psicc2_thread.h"
int main(void)
{
p... | /content/code_sandbox/samples/subsys/smf/hsm_psicc2/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 133 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/smf.h>
#include <stdbool.h>
#include "smf_calculator_thread.h"
#include <zephyr/logging/log.h>
#include <string.h>
#include <stdlib.h>
#include "main.h"
#include <stdio.h>
LOG_MODULE_REGISTER(smf_thread, LOG_LEVEL_DBG);
K_MSGQ_DEFINE(event_msgq, sizeof(struc... | /content/code_sandbox/samples/subsys/smf/smf_calculator/src/smf_calculator_thread.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 4,903 |
```c
/*
* State Machine example copyright (c) Miro Samek
*
* Implementation of the statechart in Figure 2.11 of
* Practical UML Statecharts in C/C++, 2nd Edition by Miro Samek
* path_to_url
* Used with permission of the author.
*
*/
#include <zephyr/kernel.h>
#include <zephyr/shell/shell.h>
#include "hsm_psicc... | /content/code_sandbox/samples/subsys/smf/hsm_psicc2/src/hsm_psicc2_console_cmds.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 647 |
```unknown
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
CONFIG_RTIO=y
CONFIG_RTIO_SYS_MEM_BLOCKS=y
``` | /content/code_sandbox/samples/subsys/rtio/sensor_batch_processing/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 25 |
```unknown
/*
*
*/
/ {
app {
#address-cells = <1>;
#size-cells = <0>;
vsensor0: sensor@0 {
compatible = "vnd,sensor";
reg = <0>;
sample-period = <100>;
sample-size = <16>;
max-msgs = <8>;
status = "okay";
};
vsensor1: sensor@1 {
compatible = "vnd,sensor";
reg = <1>;
sample-per... | /content/code_sandbox/samples/subsys/rtio/sensor_batch_processing/app.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 147 |
```yaml
sample:
name: RTIO sample
tests:
sample.rtio.sensor_batch_processing:
tags: rtio
integration_platforms:
- native_sim
harness: console
harness_config:
type: multi_line
regex:
- "(.*)Submitting (.*) read requests"
- "(.*)Start processing (.*) samples"
... | /content/code_sandbox/samples/subsys/rtio/sensor_batch_processing/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 84 |
```yaml
#
description: Sensor
include: base.yaml
compatible: "vnd,sensor"
properties:
sample-period:
type: int
required: true
sample-size:
type: int
required: true
max-msgs:
type: int
required: true
``` | /content/code_sandbox/samples/subsys/rtio/sensor_batch_processing/dts/bindings/vnd,sensor.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 64 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/rtio/rtio.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(main, LOG_LEVEL_DBG);
#define N (8)
#define M (N/2)
#define SQ_SZ (N)
#define CQ_SZ (N)
#define NODE_ID DT_COMPAT_GET_ANY_STATUS_OKAY(vnd_sensor)
#define SAMPLE_PERIOD DT_PROP(NODE_ID, sa... | /content/code_sandbox/samples/subsys/rtio/sensor_batch_processing/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 748 |
```restructuredtext
.. _testsuite-samples:
Testsuite samples
#################
.. toctree::
:maxdepth: 1
:glob:
**/README
``` | /content/code_sandbox/samples/subsys/testsuite/testsuite.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```yaml
tests:
sample.pytest.shell:
filter: CONFIG_SERIAL and dt_chosen_enabled("zephyr,shell-uart")
min_ram: 40
harness: pytest
extra_configs:
- arch:posix:CONFIG_NATIVE_UART_0_ON_STDINOUT=y
integration_platforms:
- native_sim
- qemu_cortex_m3
tags:
- test_framework
... | /content/code_sandbox/samples/subsys/testsuite/pytest/shell/testcase.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 95 |
```c
/*
*
*/
#define DT_DRV_COMPAT vnd_sensor
#include <zephyr/kernel.h>
#include <zephyr/rtio/rtio.h>
#include <zephyr/logging/log.h>
#include <zephyr/sys/util.h>
LOG_MODULE_REGISTER(vnd_sensor, LOG_LEVEL_DBG);
struct vnd_sensor_config {
uint32_t sample_period;
size_t sample_size;
};
struct vnd_sensor_data {
... | /content/code_sandbox/samples/subsys/rtio/sensor_batch_processing/src/vnd_sensor.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,088 |
```unknown
CONFIG_PRINTK=y
CONFIG_SHELL=y
CONFIG_LOG=y
CONFIG_SHELL_BACKEND_SERIAL=y
CONFIG_KERNEL_SHELL=y
``` | /content/code_sandbox/samples/subsys/testsuite/pytest/shell/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```python
#
import logging
from twister_harness import Shell
logger = logging.getLogger(__name__)
def test_shell_print_help(shell: Shell):
logger.info('send "help" command')
lines = shell.exec_command('help')
assert 'Available commands:' in lines, 'expected response not found'
logger.info('response... | /content/code_sandbox/samples/subsys/testsuite/pytest/shell/pytest/test_shell.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 131 |
```restructuredtext
.. zephyr:code-sample:: pytest_shell
:name: Pytest shell application testing
Execute pytest tests against the Zephyr shell.
Overview
********
The sample project illustrates usage of pytest framework integrated with
Twister test runner.
A simple application provides basic Zephyr shell inter... | /content/code_sandbox/samples/subsys/testsuite/pytest/shell/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 722 |
```c
/*
*
*/
int main(void)
{
/* Shell application source code is injected by applied Kconfg SHELL
* options, no more "extra" functionalities are required for exemplary
* pytest test.
*/
return 0;
}
``` | /content/code_sandbox/samples/subsys/testsuite/pytest/shell/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 52 |
```unknown
CONFIG_ZTEST=y
CONFIG_IDLE_STACK_SIZE=4096
``` | /content/code_sandbox/samples/subsys/testsuite/pytest/basic/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 14 |
```yaml
tests:
sample.twister.pytest:
platform_allow:
- native_posix
- native_sim
harness: pytest
harness_config:
pytest_args: ["--custom-pytest-arg", "foo", "--cmdopt", "."]
tags:
- test_framework
- pytest
integration_platforms:
- native_sim
``` | /content/code_sandbox/samples/subsys/testsuite/pytest/basic/testcase.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 78 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.