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 |
|---|---|---|---|---|---|---|---|---|
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/edac.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(main, CONFIG_LOG_DEFAULT_LEVEL);
#define STACKSIZE 1024
#define PRIORITY 7
static atomic_t handled;
/**
* Callback called from I... | /content/code_sandbox/samples/subsys/edac/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 337 |
```unknown
CONFIG_USB_DEVICE_STACK_NEXT=y
CONFIG_USBD_HID_SUPPORT=y
CONFIG_LOG=y
CONFIG_USBD_LOG_LEVEL_WRN=y
CONFIG_USBD_HID_LOG_LEVEL_WRN=y
CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y
CONFIG_SAMPLE_USBD_PID=0x0007
CONFIG_GPIO=y
CONFIG_INPUT=y
``` | /content/code_sandbox/samples/subsys/usb/hid-mouse/usbd_next_prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 69 |
```restructuredtext
.. _usb-samples:
USB device support samples
##########################
.. toctree::
:maxdepth: 1
:glob:
**/README
``` | /content/code_sandbox/samples/subsys/usb/usb.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```unknown
/*
*
*/
/ {
hid_dev_0: hid_dev_0 {
compatible = "zephyr,hid-device";
interface-name = "HID0";
protocol-code = "none";
in-polling-period-us = <1000>;
in-report-size = <64>;
};
};
``` | /content/code_sandbox/samples/subsys/usb/hid-mouse/usbd_next.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 70 |
```unknown
# Source common USB sample options used to initialize new experimental USB
# device stack. The scope of these options is limited to USB samples in project
# tree, you cannot use them in your own application.
source "samples/subsys/usb/common/Kconfig.sample_usbd"
source "Kconfig.zephyr"
``` | /content/code_sandbox/samples/subsys/usb/hid-mouse/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 66 |
```unknown
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_HID=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr HID mouse sample"
CONFIG_USB_DEVICE_PID=0x0007
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
CONFIG_GPIO=y
CONFIG_INPUT=y
CONFIG_INPUT_MODE_SYNCHRONO... | /content/code_sandbox/samples/subsys/usb/hid-mouse/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 82 |
```yaml
sample:
name: USB HID mouse sample
common:
harness: button
filter: dt_alias_exists("sw0") and dt_alias_exists("led0")
depends_on:
- gpio
tests:
sample.usb.hid-mouse:
depends_on:
- usb_device
platform_exclude:
- frdm_mcxn947/mcxn947/cpu0
tags: usb
sample.usb_device_next.hi... | /content/code_sandbox/samples/subsys/usb/hid-mouse/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 229 |
```restructuredtext
.. zephyr:code-sample:: usb-hid-mouse
:name: USB HID mouse
:relevant-api: _usb_device_core_api usb_hid_device_api input_interface
Implement a basic HID mouse device.
Overview
********
This sample app demonstrates use of a USB Human Interface Device (HID) driver
by the Zephyr project. Thi... | /content/code_sandbox/samples/subsys/usb/hid-mouse/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,214 |
```unknown
/*
*
*/
#include <dt-bindings/usb/audio.h>
/ {
uac2_headphones: usb_audio2 {
compatible = "zephyr,uac2";
status = "okay";
audio-function = <AUDIO_FUNCTION_OTHER>;
uac_aclk: aclk {
compatible = "zephyr,uac2-clock-source";
clock-type = "internal-programmable";
frequency-control = "host-p... | /content/code_sandbox/samples/subsys/usb/uac2_explicit_feedback/app.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 279 |
```restructuredtext
.. zephyr:code-sample:: uac2-explicit-feedback
:name: USB Audio asynchronous explicit feedback sample
:relevant-api: usbd_api uac2_device i2s_interface
USB Audio 2 explicit feedback sample playing audio on I2S.
Overview
********
This sample demonstrates how to implement USB asynchronous ... | /content/code_sandbox/samples/subsys/usb/uac2_explicit_feedback/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 668 |
```c
/*
*
*/
#include <sample_usbd.h>
#include <string.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/input/input.h>
#include <zephyr/sys/util.h>
#include <zephyr/usb/usb_device.h>
#include <zephyr/usb/usbd.h>
#include <zephyr/usb/class/usb_hid.h>
#incl... | /content/code_sandbox/samples/subsys/usb/hid-mouse/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,166 |
```unknown
CONFIG_I2S=y
#USB related configs
CONFIG_USB_DEVICE_STACK_NEXT=y
CONFIG_USBD_AUDIO2_CLASS=y
CONFIG_SAMPLE_USBD_PID=0x000E
CONFIG_SAMPLE_USBD_PRODUCT="UAC2 explicit feedback sample"
#LOG subsystem related configs
CONFIG_LOG=y
CONFIG_USBD_LOG_LEVEL_WRN=y
CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y
``` | /content/code_sandbox/samples/subsys/usb/uac2_explicit_feedback/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 80 |
```unknown
menu "UAC2 external feedback sample options"
config APP_USE_I2S_LRCLK_EDGES_COUNTER
bool "Measure I2S LRCLK edges directly"
help
Use this to use I2S LRCLK edge counting for calculating feedback.
On nRF53 this option requires externally connecting I2S LRCLK back to
separate GPIOTE input pin (P1.0... | /content/code_sandbox/samples/subsys/usb/uac2_explicit_feedback/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 150 |
```yaml
sample:
name: USB Audio 2 asynchronous explicit feedback sample
tests:
sample.subsys.usb.uac2_explicit_feedback:
depends_on:
- usbd
- i2s
tags: usb i2s
platform_allow: nrf5340dk/nrf5340/cpuapp
harness: TBD
``` | /content/code_sandbox/samples/subsys/usb/uac2_explicit_feedback/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 74 |
```objective-c
/*
*
*/
#ifndef FEEDBACK_H_
#define FEEDBACK_H_
#include <stdint.h>
/* Nominal number of samples received on each SOF. This sample is currently
* supporting only 48 kHz sample rate.
*/
#define SAMPLES_PER_SOF 48
struct feedback_ctx *feedback_init(void);
void feedback_reset_ctx(struct feedback... | /content/code_sandbox/samples/subsys/usb/uac2_explicit_feedback/src/feedback.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 121 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include "feedback.h"
#warning "No target specific feedback code, overruns/underruns will occur"
#define FEEDBACK_K 10
struct feedback_ctx *feedback_init(void)
{
return NULL;
}
void feedback_process(struct feedback_ctx *ctx)
{
ARG_UNUSED(ctx);
}
void feedback_reset_ctx... | /content/code_sandbox/samples/subsys/usb/uac2_explicit_feedback/src/feedback_dummy.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 158 |
```c
/*
*
*/
#include <stdint.h>
#include <stdlib.h>
#include <sample_usbd.h>
#include "feedback.h"
#include <zephyr/cache.h>
#include <zephyr/device.h>
#include <zephyr/usb/usbd.h>
#include <zephyr/usb/class/usbd_uac2.h>
#include <zephyr/drivers/i2s.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(uac2_sam... | /content/code_sandbox/samples/subsys/usb/uac2_explicit_feedback/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 2,687 |
```unknown
#Enable timer for asynchronous feedback
CONFIG_NRFX_TIMER2=y
``` | /content/code_sandbox/samples/subsys/usb/uac2_explicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 15 |
```unknown
/*
*
*/
#include "../app.overlay"
&pinctrl {
i2s0_default_alt: i2s0_default_alt {
group1 {
psels = <NRF_PSEL(I2S_SCK_M, 1, 15)>,
<NRF_PSEL(I2S_LRCK_M, 1, 12)>,
<NRF_PSEL(I2S_SDOUT, 1, 13)>;
};
};
};
&clock {
hfclkaudio-frequency = <12288000>;
};
i2s_tx: &i2s0 {
status = "okay";
pinc... | /content/code_sandbox/samples/subsys/usb/uac2_explicit_feedback/boards/nrf5340dk_nrf5340_cpuapp.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 162 |
```unknown
CONFIG_USB_DEVICE_STACK_NEXT=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_LINE_CTRL=y
CONFIG_USBD_CDC_ACM_CLASS=y
CONFIG_LOG=y
CONFIG_USBD_LOG_LEVEL_WRN=y
CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y
CONFIG_SAMPLE_USBD_PID=0x0004
CONFIG_SAMPLE_USBD_PRODUCT="USBD console sample"
``` | /content/code_sandbox/samples/subsys/usb/console/usbd_next_prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 79 |
```unknown
/*
*
*/
/ {
chosen {
zephyr,console = &cdc_acm_uart0;
};
};
&zephyr_udc0 {
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
};
``` | /content/code_sandbox/samples/subsys/usb/console/app.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 66 |
```c
/*
*
*/
#include <stdlib.h>
#include <zephyr/logging/log.h>
#include "feedback.h"
#include <nrfx_dppi.h>
#include <nrfx_gpiote.h>
#include <nrfx_timer.h>
#include <hal/nrf_gpio.h>
#include <hal/nrf_usbd.h>
#include <hal/nrf_i2s.h>
#include <helpers/nrfx_gppi.h>
LOG_MODULE_REGISTER(feedback, LOG_LEVEL_INF);
s... | /content/code_sandbox/samples/subsys/usb/uac2_explicit_feedback/src/feedback_nrf53.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 3,707 |
```restructuredtext
.. zephyr:code-sample:: usb-cdc-acm-console
:name: Console over USB CDC ACM
:relevant-api: _usb_device_core_api usbd_api
Output "Hello World!" to the console over USB CDC ACM.
Overview
********
A simple Hello World sample, with console output coming via CDC ACM UART.
Primarily intended t... | /content/code_sandbox/samples/subsys/usb/console/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 293 |
```unknown
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr USB console sample"
CONFIG_USB_DEVICE_PID=0x0004
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_LINE_CTRL=y
``` | /content/code_sandbox/samples/subsys/usb/console/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 57 |
```unknown
# Source common USB sample options used to initialize new experimental USB
# device stack. The scope of these options is limited to USB samples in project
# tree, you cannot use them in your own application.
source "samples/subsys/usb/common/Kconfig.sample_usbd"
source "Kconfig.zephyr"
``` | /content/code_sandbox/samples/subsys/usb/console/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 66 |
```yaml
sample:
name: Console over USB
tests:
sample.usb.console:
depends_on:
- usb_device
tags: usb
harness: console
harness_config:
fixture: fixture_usb_cdc
``` | /content/code_sandbox/samples/subsys/usb/console/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 49 |
```unknown
CONFIG_UHC_DRIVER=y
CONFIG_USB_HOST_STACK=y
``` | /content/code_sandbox/samples/subsys/usb/shell/virtual.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 14 |
```unknown
/*
*
*/
/delete-node/ &zephyr_udc0;
/ {
zephyr_uhc0: uhc_vrt0 {
compatible = "zephyr,uhc-virtual";
zephyr_udc0: udc_vrt0 {
compatible = "zephyr,udc-virtual";
num-bidir-endpoints = <8>;
maximum-speed = "high-speed";
};
udc1: udc_vrt1 {
compatible = "zephyr,udc-virtual";
num-bidir... | /content/code_sandbox/samples/subsys/usb/shell/virtual.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 145 |
```c
/*
*
*/
#include <sample_usbd.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/usb/usb_device.h>
#include <zephyr/usb/usbd.h>
#include <zephyr/drivers/uart.h>
BUILD_ASSERT(DT_NODE_HAS_COMPAT(DT_CHOSEN(zephyr_console), zephyr_cdc_acm_uart),
"Console device is not ACM CDC UART... | /content/code_sandbox/samples/subsys/usb/console/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 353 |
```unknown
CONFIG_SHELL=y
CONFIG_USB_DEVICE_STACK_NEXT=y
CONFIG_USBD_SHELL=y
CONFIG_USB_HOST_STACK=y
CONFIG_USBH_SHELL=y
CONFIG_LOG=y
CONFIG_USBD_LOG_LEVEL_WRN=y
CONFIG_USBH_LOG_LEVEL_WRN=y
CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y
CONFIG_UHC_DRIVER_LOG_LEVEL_WRN=y
``` | /content/code_sandbox/samples/subsys/usb/shell/device_and_host_prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 75 |
```unknown
/*
*
*/
/delete-node/ &zephyr_udc0;
/ {
soc {
dwc2_fsotg0: usb@50000000 {
compatible = "st,stm32f4-fsotg", "snps,dwc2";
reg = <0x50000000 0x40000>;
interrupts = <67 0>;
interrupt-names = "fsotg";
clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00000080>,
<&rcc STM32_SRC_PLL_Q NO_SEL>;
num... | /content/code_sandbox/samples/subsys/usb/shell/nucleo_f413zh_dwc2.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 248 |
```unknown
CONFIG_SHELL=y
CONFIG_USB_DEVICE_STACK_NEXT=y
CONFIG_USBD_SHELL=y
CONFIG_USBD_LOOPBACK_CLASS=y
CONFIG_LOG=y
CONFIG_USBD_LOG_LEVEL_WRN=y
CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y
``` | /content/code_sandbox/samples/subsys/usb/shell/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 51 |
```restructuredtext
.. zephyr:code-sample:: usb-shell
:name: USB shell
:relevant-api: usbd_api
Use shell commands to interact with USB device stack.
Overview
********
The sample enables new experimental USB device support and the shell function.
It is primarily intended to aid in the development and testing... | /content/code_sandbox/samples/subsys/usb/shell/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 732 |
```c
/*
*
*/
#include <zephyr/kernel.h>
int main(void)
{
return 0;
}
``` | /content/code_sandbox/samples/subsys/usb/shell/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 22 |
```yaml
sample:
name: USB support shell sample
common:
depends_on:
- usbd
tests:
sample.usbd.shell:
integration_platforms:
- nrf52840dk/nrf52840
- nrf54h20dk/nrf54h20/cpuapp
- frdm_k64f
- mimxrt685_evk/mimxrt685s/cm33
- mimxrt1060_evk
harness: keyboard
tags: usb
sam... | /content/code_sandbox/samples/subsys/usb/shell/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 225 |
```unknown
/*
*
*/
/ {
zephyr_uhc0: uhc_vrt0 {
compatible = "zephyr,uhc-virtual";
zephyr_udc0: udc_vrt0 {
compatible = "zephyr,udc-virtual";
num-bidir-endpoints = <8>;
maximum-speed = "high-speed";
};
udc1: udc_vrt1 {
compatible = "zephyr,udc-virtual";
num-bidir-endpoints = <8>;
maximum-... | /content/code_sandbox/samples/subsys/usb/shell/boards/qemu_cortex_m3.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 134 |
```unknown
CONFIG_UHC_DRIVER=y
CONFIG_USB_HOST_STACK=y
``` | /content/code_sandbox/samples/subsys/usb/shell/boards/qemu_cortex_m3.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 14 |
```objective-c
/*
*
*/
#ifndef ZEPHYR_SAMPLES_SUBSYS_USB_COMMON_SAMPLE_USBD_H
#define ZEPHYR_SAMPLES_SUBSYS_USB_COMMON_SAMPLE_USBD_H
#include <stdint.h>
#include <zephyr/usb/usbd.h>
/*
* The scope of this header is limited to use in USB samples together with the
* new experimental USB device stack, you should no... | /content/code_sandbox/samples/subsys/usb/common/sample_usbd.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 240 |
```cmake
set(SAMPLE_USBD_DIR ${ZEPHYR_BASE}/samples/subsys/usb/common)
target_include_directories(app PRIVATE ${SAMPLE_USBD_DIR})
target_sources_ifdef(CONFIG_USB_DEVICE_STACK_NEXT app PRIVATE
${SAMPLE_USBD_DIR}/sample_usbd_init.c
)
``` | /content/code_sandbox/samples/subsys/usb/common/common.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 60 |
```unknown
# This file contains Kconfig options and defaults for configuring USB devices
# using the new experimental USB device support. The scope of these options is
# limited to USB samples in project tree, you cannot use them in your own
# application.
menu "USB sample options"
depends on USB_DEVICE_STACK_NEXT
... | /content/code_sandbox/samples/subsys/usb/common/Kconfig.sample_usbd | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 316 |
```restructuredtext
:orphan:
WebUSB HTML Demo App
====================
.. raw:: html
:file: index.html
``` | /content/code_sandbox/samples/subsys/usb/webusb/demo.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 26 |
```c
/*
*
*/
#include <stdint.h>
#include <zephyr/device.h>
#include <zephyr/usb/usbd.h>
#include <zephyr/usb/bos.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(usbd_sample_config);
#define ZEPHYR_PROJECT_USB_VID 0x2fe3
/* doc device instantiation start */
/*
* Instantiate a context named sample_usbd u... | /content/code_sandbox/samples/subsys/usb/common/sample_usbd_init.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,367 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_BOS=y
CONFIG_SERIAL=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr WebUSB sample"
CONFIG_USB_DEVICE_PID=0x000A
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_LINE_CTRL=y
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y... | /content/code_sandbox/samples/subsys/usb/webusb/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 88 |
```yaml
sample:
name: Web USB
tests:
sample.usb.webusb:
depends_on: usb_device
tags: usb
platform_exclude:
- native_posix
- native_posix/native/64
harness: TBD
``` | /content/code_sandbox/samples/subsys/usb/webusb/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 54 |
```restructuredtext
.. zephyr:code-sample:: webusb
:name: WebUSB
:relevant-api: _usb_device_core_api
Receive and echo data from a web page using WebUSB API.
For a deeper dive into the WebUSB, refer to
path_to_url
WebUSB API Specification:
path_to_url
Overview
********
This simple echo application demonstr... | /content/code_sandbox/samples/subsys/usb/webusb/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 648 |
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebUSB Serial Sample Application</title>
</head>
<body>
<script>
var serial = {};
(function() {
'use strict';
serial.getPorts = function() {
return navigator.usb.getDevices().then(devices => {
return devices.map(device => new serial.Port(... | /content/code_sandbox/samples/subsys/usb/webusb/index.html | html | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 789 |
```c
/*
*
*/
/**
* @file
* @brief WebUSB enabled custom class driver
*
* This is a modified version of CDC ACM class driver
* to support the WebUSB.
*/
#define LOG_LEVEL CONFIG_USB_DEVICE_LOG_LEVEL
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(webusb);
#include <zephyr/sys/byteorder.h>
#include <zephyr... | /content/code_sandbox/samples/subsys/usb/webusb/src/webusb.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,510 |
```objective-c
/*
*
*/
/**
* @file
* @brief WebUSB enabled custom class driver header file
*
* Header file for WebUSB enabled custom class driver
*/
#ifndef __WEBUSB_SERIAL_H__
#define __WEBUSB_SERIAL_H__
/**
* WebUSB request handlers
*/
struct webusb_req_handlers {
/* Handler for WebUSB Vendor specific co... | /content/code_sandbox/samples/subsys/usb/webusb/src/webusb.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 193 |
```unknown
/*
*
*/
/ {
hid_dev_0: hid_dev_0 {
compatible = "zephyr,hid-device";
interface-name = "HID0";
protocol-code = "keyboard";
in-report-size = <64>;
in-polling-period-us = <1000>;
};
};
``` | /content/code_sandbox/samples/subsys/usb/hid-keyboard/app.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 70 |
```unknown
/*
*
*/
/ {
hid_dev_0: hid_dev_0 {
compatible = "zephyr,hid-device";
interface-name = "HID0";
in-report-size = <256>;
in-polling-period-us = <1000>;
};
};
``` | /content/code_sandbox/samples/subsys/usb/hid-keyboard/large_in_report.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 62 |
```unknown
/*
*
*/
#include "app.overlay"
/ {
hid_dev_0: hid_dev_0 {
compatible = "zephyr,hid-device";
out-report-size = <64>;
out-polling-period-us = <16000>;
};
};
``` | /content/code_sandbox/samples/subsys/usb/hid-keyboard/out_report.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 57 |
```restructuredtext
.. zephyr:code-sample:: usb-hid-keyboard
:name: USB HID keyboard
:relevant-api: usbd_api usbd_hid_device input_interface
Implement a basic HID keyboard device.
Overview
********
This sample application demonstrates the HID keyboard implementation using the
new experimental USB device sta... | /content/code_sandbox/samples/subsys/usb/hid-keyboard/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 295 |
```unknown
# Source common USB sample options used to initialize new experimental USB
# device stack. The scope of these options is limited to USB samples in project
# tree, you cannot use them in your own application.
source "samples/subsys/usb/common/Kconfig.sample_usbd"
source "Kconfig.zephyr"
``` | /content/code_sandbox/samples/subsys/usb/hid-keyboard/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 66 |
```unknown
/*
*
*/
#include "large_in_report.overlay"
/ {
hid_dev_0: hid_dev_0 {
compatible = "zephyr,hid-device";
out-report-size = <128>;
out-polling-period-us = <16000>;
};
};
``` | /content/code_sandbox/samples/subsys/usb/hid-keyboard/large_out_report.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 59 |
```unknown
CONFIG_USB_DEVICE_STACK_NEXT=y
CONFIG_USBD_HID_SUPPORT=y
CONFIG_LOG=y
CONFIG_USBD_LOG_LEVEL_WRN=y
CONFIG_USBD_HID_LOG_LEVEL_WRN=y
CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y
CONFIG_SAMPLE_USBD_PID=0x0007
CONFIG_GPIO=y
CONFIG_INPUT=y
CONFIG_INPUT_MODE_SYNCHRONOUS=y
``` | /content/code_sandbox/samples/subsys/usb/hid-keyboard/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 78 |
```yaml
sample:
name: USB HID keyboard sample
common:
harness: button
filter: dt_alias_exists("sw0") and dt_alias_exists("led0")
depends_on:
- usbd
- gpio
integration_platforms:
- nrf52840dk/nrf52840
- nrf54h20dk/nrf54h20/cpuapp
- frdm_k64f
- stm32f723e_disco
- nucleo_f413zh
- ... | /content/code_sandbox/samples/subsys/usb/hid-keyboard/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 253 |
```c
/*
*
*/
/**
* @file
* @brief Sample app for WebUSB enabled custom class driver.
*
* Sample app for WebUSB enabled custom class driver. The received
* data is echoed back to the WebUSB based application running in
* the browser at host.
*/
#define LOG_LEVEL CONFIG_USB_DEVICE_LOG_LEVEL
#include <zephyr/lo... | /content/code_sandbox/samples/subsys/usb/webusb/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 3,597 |
```c
/*
*
*/
#include <sample_usbd.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/input/input.h>
#include <zephyr/usb/usbd.h>
#include <zephyr/usb/class/usbd_hid.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(main, LOG_LEVEL_INF);
static const u... | /content/code_sandbox/samples/subsys/usb/hid-keyboard/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,940 |
```unknown
; Windows 2000, XP, Vista, 7 and 8 (x32 and x64) driver for Zephyr CDC ACM
[Version]
Signature = "$Windows NT$"
Class = Ports
ClassGuid = {4D36E978-E325-11CE-BFC1-08002BE10318}
Provider = %Manufacturer%
DriverVer = 06/03/2019,1.0.0.0
CatalogFile = zephyr_cdc_acm.cat
;------------------------... | /content/code_sandbox/samples/subsys/usb/inf/zephyr_cdc_acm.inf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,102 |
```unknown
CONFIG_STDOUT_CONSOLE=y
#USB related configs
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr testusb sample"
CONFIG_USB_DEVICE_PID=0x0009
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_LOOPBACK=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
``` | /content/code_sandbox/samples/subsys/usb/testusb/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 76 |
```yaml
sample:
name: USB loopback sample
tests:
sample.usb.loopback:
depends_on: usb_device
tags: usb
platform_exclude:
- native_posix
- native_posix/native/64
harness: button
``` | /content/code_sandbox/samples/subsys/usb/testusb/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 56 |
```restructuredtext
.. zephyr:code-sample:: testusb-app
:name: USB testing application
:relevant-api: _usb_device_core_api
Test USB device drivers using a loopback function.
This sample implements a loopback function that can be used
to test USB device drivers and the device stack connected to a Linux host
a... | /content/code_sandbox/samples/subsys/usb/testusb/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,278 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/usb/usb_device.h>
LOG_MODULE_REGISTER(main);
int main(void)
{
int ret;
ret = usb_enable(NULL);
if (ret != 0) {
LOG_ERR("Failed to enable USB");
return 0;
}
LOG_INF("entered main.");
return 0;
}
``` | /content/code_sandbox/samples/subsys/usb/testusb/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 87 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_GPIO=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr DFU sample"
CONFIG_USB_DEVICE_PID=0x0005
CONFIG_USB_DFU_CLASS=y
CONFIG_USB_DFU_ENABLE_UPLOAD=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_STREAM_FLASH=y
CONFIG_IMG_MANAGER=y
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVE... | /content/code_sandbox/samples/subsys/usb/dfu/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 111 |
```yaml
sample:
name: USB DFU sample
common:
build_only: true
arch_exclude: posix
platform_exclude:
- mimxrt1010_evk
- mimxrt1050_evk@qspi
- mimxrt1020_evk
- mimxrt1015_evk
- mimxrt1060_evk
- sam4l_ek
- mimxrt1050_evk
- mimxrt1060_evk@hyperflash
- nucleo_f207zg
- teensy4... | /content/code_sandbox/samples/subsys/usb/dfu/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 322 |
```unknown
CONFIG_USB_DFU_REBOOT=y
CONFIG_USB_DFU_PERMANENT_DOWNLOAD=y
``` | /content/code_sandbox/samples/subsys/usb/dfu/overlay-permanent-download.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 19 |
```c
/*
*
*/
/* Sample app for USB DFU class driver. */
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/usb/usb_device.h>
LOG_MODULE_REGISTER(main);
int main(void)
{
int ret;
ret = usb_enable(NULL);
if (ret != 0) {
LOG_ERR("Failed to enable USB");
return 0;
}
LOG_INF("This de... | /content/code_sandbox/samples/subsys/usb/dfu/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 105 |
```unknown
/*
*
*/
&zephyr_udc0 {
hs_0 {
compatible = "usb-audio-hs";
mic-feature-mute;
mic-channel-l;
mic-channel-r;
hp-feature-mute;
hp-channel-l;
hp-channel-r;
hp-feature-volume;
volume-max = <0x0500>;
volume-min = <0xBA00>;
volume-res = <0x100>;
};
};
``` | /content/code_sandbox/samples/subsys/usb/audio/headset/app.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 105 |
```restructuredtext
.. zephyr:code-sample:: usb-dfu
:name: USB DFU (Device Firmware Upgrade)
:relevant-api: _usb_device_core_api
Implement device firmware upgrade using the USB DFU class driver.
Overview
********
This sample app demonstrates use of a USB DFU Class driver provided
by the Zephyr project.
Req... | /content/code_sandbox/samples/subsys/usb/dfu/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,650 |
```restructuredtext
.. zephyr:code-sample:: usb-audio-headset
:name: USB Audio headset
:relevant-api: _usb_device_core_api
Implement a USB Audio headset device with audio IN/OUT loopback.
Overview
********
This sample app demonstrates use of a USB Audio driver by the Zephyr
project. This very simple sample ... | /content/code_sandbox/samples/subsys/usb/audio/headset/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 268 |
```unknown
CONFIG_STDOUT_CONSOLE=y
#USB related configs
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr USB audio sample"
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
#LOG subsystem related configs
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
#net buf options
CONFIG_NET_BUF=... | /content/code_sandbox/samples/subsys/usb/audio/headset/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 87 |
```yaml
sample:
name: USB audio headset sample
tests:
sample.usb.audio.headset:
depends_on: usb_device
tags: usb
arch_exclude: posix
integration_platforms:
- nrf52840dk/nrf52840
- nrf5340dk/nrf5340/cpuapp
harness: console
harness_config:
type: multi_line
ordered: true... | /content/code_sandbox/samples/subsys/usb/audio/headset/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 114 |
```unknown
/*
*
*/
&zephyr_udc0 {
hp_0 {
compatible = "usb-audio-hp";
feature-mute;
channel-l;
channel-r;
feature-volume;
volume-max = <0x0500>;
volume-min = <0xBA00>;
volume-res = <0x100>;
};
mic_0 {
compatible = "usb-audio-mic";
feature-mute;
channel-l;
channel-r;
};
};
``` | /content/code_sandbox/samples/subsys/usb/audio/headphones_microphone/app.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 113 |
```c
/*
*
*/
/**
* @file
* @brief Sample app for Audio class
*/
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/usb/usb_device.h>
#include <zephyr/usb/class/usb_audio.h>
LOG_MODULE_REGISTER(main, LOG_LEVEL_INF);
static void data_received(const struct device *dev,
struct net_buf... | /content/code_sandbox/samples/subsys/usb/audio/headset/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 468 |
```unknown
CONFIG_STDOUT_CONSOLE=y
#USB related configs
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr USB audio sample"
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
#LOG subsystem related configs
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
#net buf options
CONFIG_NET_BUF=... | /content/code_sandbox/samples/subsys/usb/audio/headphones_microphone/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 87 |
```restructuredtext
.. zephyr:code-sample:: usb-audio-headphones-microphone
:name: USB Audio microphone & headphones
:relevant-api: _usb_device_core_api
Implement a USB Audio microphone + headphones device with audio IN/OUT loopback.
Overview
********
This sample app demonstrates use of a USB Audio driver b... | /content/code_sandbox/samples/subsys/usb/audio/headphones_microphone/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 293 |
```yaml
sample:
name: USB audio Headphones Microphone sample
tests:
sample.usb.audio.headphones_microphone:
depends_on: usb_device
tags: usb
arch_exclude: posix
integration_platforms:
- nrf52840dk/nrf52840
- nrf5340dk/nrf5340/cpuapp
harness: console
harness_config:
type: mu... | /content/code_sandbox/samples/subsys/usb/audio/headphones_microphone/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 128 |
```unknown
CONFIG_USB_DEVICE_STACK_NEXT=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_LINE_CTRL=y
CONFIG_USBD_MSC_CLASS=y
CONFIG_USBD_MSC_LUNS_PER_INSTANCE=3
CONFIG_LOG=y
CONFIG_USBD_LOG_LEVEL_WRN=y
CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y
CONFIG_SAMPLE_USBD_PID=0x0008
CONFIG_SAMPLE_USBD_PRODUCT="USBD MSC sample"
C... | /content/code_sandbox/samples/subsys/usb/mass/usbd_next_prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 97 |
```unknown
/*
*
*/
/ {
ramdisk0 {
compatible = "zephyr,ram-disk";
disk-name = "RAM";
sector-size = <512>;
sector-count = <192>;
};
};
``` | /content/code_sandbox/samples/subsys/usb/mass/ramdisk.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 51 |
```c
/*
*
*/
/**
* @file
* @brief Sample app for Audio class
*/
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/usb/usb_device.h>
#include <zephyr/usb/class/usb_audio.h>
LOG_MODULE_REGISTER(main, LOG_LEVEL_INF);
static const struct device *const mic_dev = DEVICE_DT_GET_ONE(usb_audio... | /content/code_sandbox/samples/subsys/usb/audio/headphones_microphone/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 560 |
```unknown
menu "MSC sample options"
config APP_WIPE_STORAGE
bool "Option to clear the flash area before mounting"
help
Use this to force an existing file system to be created.
choice
prompt "Storage and file system type used by the application"
default APP_MSC_STORAGE_NONE
help
Specify the type of storag... | /content/code_sandbox/samples/subsys/usb/mass/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 422 |
```unknown
CONFIG_STDOUT_CONSOLE=y
#USB related configs
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr MSC sample"
CONFIG_USB_DEVICE_PID=0x0008
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_MASS_STORAGE=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
CONFIG_USB_MASS_STORAGE_LOG_LEVEL_ERR=y
CONFIG_USB_DEVI... | /content/code_sandbox/samples/subsys/usb/mass/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 93 |
```yaml
sample:
name: Mass Storage
tests:
sample.usb.mass_ram_none:
min_ram: 128
depends_on: usb_device
arch_exclude: posix
extra_args:
- EXTRA_DTC_OVERLAY_FILE="ramdisk.overlay"
extra_configs:
- CONFIG_LOG_DEFAULT_LEVEL=3
tags:
- msd
- usb
harness: console
ha... | /content/code_sandbox/samples/subsys/usb/mass/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,341 |
```restructuredtext
.. zephyr:code-sample:: usb-mass
:name: USB Mass Storage
:relevant-api: usbd_api usbd_msc_device _usb_device_core_api file_system_api
Expose board's RAM or FLASH as a USB disk using USB Mass Storage driver.
Overview
********
This sample app demonstrates use of a USB Mass Storage driver b... | /content/code_sandbox/samples/subsys/usb/mass/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 3,213 |
```unknown
/*
*
*/
/delete-node/ &storage_partition;
&mx25r64 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
storage_partition: partition@0 {
label = "storage";
reg = <0x00000000 0x00020000>;
};
};
};
/ {
msc_disk0 {
compatible = "zephyr,flash-disk";
... | /content/code_sandbox/samples/subsys/usb/mass/boards/nrf52840dk_nrf52840.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 135 |
```unknown
/*
*
*/
/delete-node/ &storage_partition;
&gd25q16 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
storage_partition: partition@0 {
label = "storage";
reg = <0x00000000 0x00200000>;
};
};
};
/ {
msc_disk0 {
compatible = "zephyr,flash-disk";
... | /content/code_sandbox/samples/subsys/usb/mass/boards/adafruit_feather_nrf52840_sense.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 135 |
```unknown
#
#
#
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=8192
CONFIG_DISK_ACCESS=y
CONFIG_DISK_DRIVERS=y
CONFIG_DISK_DRIVER_SDMMC=y
CONFIG_FILE_SYSTEM=y
CONFIG_FAT_FILESYSTEM_ELM=y
CONFIG_APP_MSC_STORAGE_SDCARD=y
``` | /content/code_sandbox/samples/subsys/usb/mass/boards/sensortile_box_pro.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 67 |
```unknown
#
#
#
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=8192
CONFIG_DISK_ACCESS=y
CONFIG_DISK_DRIVERS=y
CONFIG_DISK_DRIVER_SDMMC=y
CONFIG_FILE_SYSTEM=y
CONFIG_FAT_FILESYSTEM_ELM=y
CONFIG_APP_MSC_STORAGE_SDCARD=y
CONFIG_SDMMC_STM32_HWFC=y
CONFIG_BUILD_WITH_TFM=y
CONFIG_TFM_PROFILE_TYPE_LARG... | /content/code_sandbox/samples/subsys/usb/mass/boards/stm32l562e_dk_stm32l562xx_ns.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 92 |
```unknown
/*
*
*/
/delete-node/ &code_partition;
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/*
* Usable flash. Starts at 0x100, after the bootloader. The partition
* size is 1MB minus the 0x100 bytes taken by the bootloader.
*/
code_partiti... | /content/code_sandbox/samples/subsys/usb/mass/boards/rpi_pico.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 220 |
```c
/*
*
*/
#include <sample_usbd.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/usb/usb_device.h>
#include <zephyr/usb/usbd.h>
#include <zephyr/usb/class/usbd_msc.h>
#include <zephyr/fs/fs.h>
#include <stdio.h>
LOG_MODULE_REGISTER(main);
#if CONFIG_DISK_DRIVER_FLASH
#include <zep... | /content/code_sandbox/samples/subsys/usb/mass/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,353 |
```unknown
/*
*
*/
/delete-node/ &storage_partition;
&mx25r64 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
storage_partition: partition@0 {
label = "storage";
reg = <0x00000000 0x00020000>;
};
};
};
/ {
msc_disk0 {
compatible = "zephyr,flash-disk";
... | /content/code_sandbox/samples/subsys/usb/mass/boards/nrf5340dk_nrf5340_cpuapp.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 135 |
```unknown
/*
*
*/
&zephyr_udc0 {
cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
};
``` | /content/code_sandbox/samples/subsys/usb/cdc_acm/app.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 37 |
```unknown
CONFIG_USB_DEVICE_STACK_NEXT=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_LINE_CTRL=y
CONFIG_USBD_CDC_ACM_CLASS=y
CONFIG_LOG=y
CONFIG_USBD_LOG_LEVEL_WRN=y
CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y
CONFIG_USBD_CDC_ACM_LOG_LEVEL_ERR=y
CONFIG_SAMPLE_USBD_PID=0x0001
CONFIG_SAMPLE_USBD_PRODUCT="USBD CDC ACM s... | /content/code_sandbox/samples/subsys/usb/cdc_acm/usbd_next_prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 92 |
```unknown
/*
*
*/
/delete-node/ &zephyr_udc0;
/ {
soc {
dwc2_fsotg0: usb@50000000 {
compatible = "st,stm32f4-fsotg", "snps,dwc2";
reg = <0x50000000 0x40000>;
interrupts = <67 0>;
interrupt-names = "fsotg";
clocks = <&rcc STM32_CLOCK_BUS_AHB2 0x00000080>,
<&rcc STM32_SRC_PLL_Q NO_SEL>;
num... | /content/code_sandbox/samples/subsys/usb/cdc_acm/nucleo_f413zh_dwc2.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 278 |
```unknown
# Source common USB sample options used to initialize new experimental USB
# device stack. The scope of these options is limited to USB samples in project
# tree, you cannot use them in your own application.
source "samples/subsys/usb/common/Kconfig.sample_usbd"
source "Kconfig.zephyr"
``` | /content/code_sandbox/samples/subsys/usb/cdc_acm/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 66 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC ACM sample"
CONFIG_USB_DEVICE_PID=0x0001
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_LINE_CTRL=y
CONFIG_USB_DEVICE_INITIALIZE... | /content/code_sandbox/samples/subsys/usb/cdc_acm/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 81 |
```restructuredtext
.. zephyr:code-sample:: usb-cdc-acm
:name: USB CDC-ACM
:relevant-api: usbd_api _usb_device_core_api uart_interface
Use USB CDC-ACM driver to implement a serial port echo.
Overview
********
This sample app demonstrates use of a USB Communication Device Class (CDC)
Abstract Control Model (... | /content/code_sandbox/samples/subsys/usb/cdc_acm/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 716 |
```yaml
sample:
name: CDC ACM USB
tests:
sample.usb.cdc-acm:
depends_on: usb_device
tags: usb
arch_exclude: posix
harness: console
harness_config:
type: one_line
regex:
- "Wait for DTR"
sample.usb_device_next.cdc-acm:
depends_on: usbd
tags: usb
extra_args: CONF_... | /content/code_sandbox/samples/subsys/usb/cdc_acm/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 259 |
```unknown
# Leverage PXP to mirror image by flipping
CONFIG_DMA=y
CONFIG_MCUX_ELCDIF_PXP=y
CONFIG_MCUX_ELCDIF_PXP_FLIP_HORIZONTAL=y
``` | /content/code_sandbox/samples/subsys/video/capture/boards/mimxrt1060_evkb.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 39 |
```unknown
# Leverage PXP to mirror image by flipping
CONFIG_DMA=y
CONFIG_MCUX_ELCDIF_PXP=y
CONFIG_MCUX_ELCDIF_PXP_FLIP_HORIZONTAL=y
``` | /content/code_sandbox/samples/subsys/video/capture/boards/mimxrt1064_evk.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 39 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.