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
/*
*
*/
&i2c0 {
led_ctrl1: is31fl3733@50 {
reg = <0x50>;
compatible = "issi,is31fl3733";
sdb-gpios = <&gpioc 2 GPIO_ACTIVE_HIGH>;
};
};
``` | /content/code_sandbox/samples/drivers/led_is31fl3733/boards/frdm_k22f.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 64 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_FLASH=y
CONFIG_SPI=y
``` | /content/code_sandbox/samples/drivers/spi_flash/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 15 |
```yaml
sample:
name: SPI Flash Sample
tests:
sample.drivers.spi.flash:
tags:
- spi
- flash
filter: dt_compat_enabled("jedec,spi-nor") or dt_compat_enabled("st,stm32-qspi-nor")
or dt_compat_enabled("st,stm32-ospi-nor") or dt_compat_enabled("st,stm32-xspi-nor")
or (dt_compat_enabled("... | /content/code_sandbox/samples/drivers/spi_flash/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 272 |
```restructuredtext
.. zephyr:code-sample:: spi-nor
:name: JEDEC SPI-NOR flash
:relevant-api: flash_interface
Use the flash API to interact with an SPI NOR serial flash memory device.
Overview
********
This sample demonstrates using the :ref:`flash API <flash_api>` on a SPI NOR serial flash
memory device. ... | /content/code_sandbox/samples/drivers/spi_flash/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 336 |
```unknown
#
#
#
CONFIG_SPI_NOR=y
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/emsdp_emsdp_em11d.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 10 |
```unknown
#
#
#
CONFIG_SPI=n
CONFIG_NORDIC_QSPI_NOR=y
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/nrf52840_mdk.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 18 |
```unknown
CONFIG_SPI=n
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/stm32h735g_disco.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 5 |
```unknown
/*
*
*/
&octospi2 {
/* channel 12-15 are for transfers to/from external memories */
dmas = <&gpdma1 12 41 0x10480>; /* request 41 for OCTOSPI2 */
dma-names = "tx_rx";
};
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/b_u585i_iot02a.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 63 |
```unknown
#
#
#
CONFIG_SPI=n
CONFIG_NORDIC_QSPI_NOR=y
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/nrf5340dk_nrf5340_cpuapp.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 18 |
```unknown
CONFIG_LOG=y
CONFIG_STM32_MEMMAP=y
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/stm32h573i_dk.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 13 |
```unknown
/*
*
*/
&octospi1 {
dmas = <&dma1 0 41 0x480>; /* request 41 for OCTOSPI1 */
dma-names = "tx_rx";
};
&dma1 {
status = "okay";
};
&dma2 {
status = "okay";
};
&dmamux1 {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/stm32l562e_dk.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 77 |
```unknown
/*
*
*/
&xspi1 {
/* request 57 for XSPI1 */
dmas = <&gpdma1 4 57 STM32_DMA_PERIPH_TX
&gpdma1 5 57 STM32_DMA_PERIPH_RX>;
dma-names = "tx", "rx";
};
&gpdma1 {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/stm32h573i_dk.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 80 |
```unknown
/*
*
*/
&spi0 {
status = "okay";
compatible = "microchip,xec-qmspi-ldma";
clock-frequency = <24000000>;
lines = <4>;
chip-select = <0>;
pinctrl-0 = < &shd_cs0_n_gpio055
&shd_clk_gpio056
&shd_io0_gpio223
&shd_io1_gpio224
&shd_io2_gpio227
&shd_io3_gpio016 >;
p... | /content/code_sandbox/samples/drivers/spi_flash/boards/mec172xevb_assy6906.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 225 |
```unknown
#
#
#
CONFIG_NORDIC_QSPI_NOR=y
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/adafruit_feather_nrf52840_sense.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 14 |
```unknown
/*
*
*/
&octospi1 {
dmas = <&dma1 1 0x16 0x480>; /* request for OCTOSPI1 fifo THreshold */
dma-names = "tx_rx";
};
&mdma {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/stm32h735g_disco.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 58 |
```unknown
#
#
#
CONFIG_SPI_NOR=y
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/mec172xevb_assy6906.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 10 |
```unknown
#
#
#
CONFIG_SPI_NOR=y
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/em_starterkit_emsk_em9d.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 10 |
```unknown
/*
*
*/
&spi0 {
cs-gpios = <&creg_gpio 5 GPIO_ACTIVE_HIGH>;
};
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/em_starterkit_emsk_em9d.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 24 |
```unknown
#
#
#
CONFIG_GPIO=y
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/gd32a503v_eval.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 8 |
```unknown
#
#
#
CONFIG_SPI_GD32_DMA=y
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/gd32f450i_eval.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 12 |
```unknown
#
#
#
CONFIG_NORDIC_QSPI_NOR=y
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/nrf52840dk_nrf52840.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 14 |
```unknown
CONFIG_SPI=n
``` | /content/code_sandbox/samples/drivers/spi_flash/boards/stm32h7b3i_dk.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 5 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/drivers/flash.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <stdio.h>
#include <string.h>
#if defined(CONFIG_BOARD_ADAFRUIT_FEATHER_STM32F405)
#define SPI_FLASH_TEST_REGION_OFFSET 0xf000
#elif defined(CONFIG_BOARD_ARTY_A7_DESIGNSTART_F... | /content/code_sandbox/samples/drivers/spi_flash/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,873 |
```unknown
CONFIG_PRINTK=y
CONFIG_EEPROM=y
``` | /content/code_sandbox/samples/drivers/eeprom/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 11 |
```yaml
sample:
name: EEPROM Sample
tests:
sample.drivers.eeprom:
tags: eeprom
platform_allow:
- gd32f450i_eval
- native_posix
- native_posix/native/64
- native_sim
- native_sim/native/64
integration_platforms:
- native_sim/native/64
harness: console
harness_... | /content/code_sandbox/samples/drivers/eeprom/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 306 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/eeprom.h>
#include <zephyr/device.h>
#define EEPROM_SAMPLE_OFFSET 0
#define EEPROM_SAMPLE_MAGIC 0xEE9703
struct perisistant_values {
uint32_t magic;
uint32_t boot_count;
};
/*
* Get a device structure from a device... | /content/code_sandbox/samples/drivers/eeprom/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 440 |
```unknown
CONFIG_EEPROM_INIT_PRIORITY=75
``` | /content/code_sandbox/samples/drivers/eeprom/boards/gd32e103v_eval.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 9 |
```unknown
CONFIG_EEPROM_INIT_PRIORITY=75
``` | /content/code_sandbox/samples/drivers/eeprom/boards/gd32f450i_eval.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 9 |
```yaml
sample:
name: UART Passthrough
tests:
sample.drivers.uart:
integration_platforms:
- qemu_x86
tags:
- serial
- uart
filter: CONFIG_SERIAL and
CONFIG_UART_INTERRUPT_DRIVEN and
dt_chosen_enabled("zephyr,console") and
dt_chosen_enabled("uart,pass... | /content/code_sandbox/samples/drivers/uart/passthrough/sample.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 86 |
```restructuredtext
.. zephyr:code-sample:: uart-passthrough
:name: UART Passthrough
:relevant-api: uart_interface
Pass data directly between the console and another UART interface.
Overview
********
This sample will virtually connect two UART interfaces together, as if Zephyr
and the processor were not pre... | /content/code_sandbox/samples/drivers/uart/passthrough/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 465 |
```unknown
CONFIG_SERIAL=y
CONFIG_RING_BUFFER=y
CONFIG_UART_INTERRUPT_DRIVEN=y
``` | /content/code_sandbox/samples/drivers/uart/passthrough/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 17 |
```restructuredtext
.. zephyr:code-sample:: eeprom
:name: EEPROM
:relevant-api: eeprom_interface
Store a boot count value in EEPROM.
Overview
********
This sample demonstrates the :ref:`EEPROM driver API <eeprom_api>` in a simple boot counter
application.
Building and Running
********************
In case ... | /content/code_sandbox/samples/drivers/eeprom/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 382 |
```unknown
/ {
chosen {
uart,passthrough = &uart4;
};
};
&uart4 {
pinctrl-0 = <&uart4_tx_pa0 &uart4_rx_pa1>;
pinctrl-names = "default";
current-speed = <9600>;
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/uart/passthrough/boards/nucleo_l476rg.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 65 |
```restructuredtext
.. zephyr:code-sample:: uart
:name: UART echo
:relevant-api: uart_interface
Read data from the console and echo it back.
Overview
********
This sample demonstrates how to use the UART serial driver with a simple
echo bot. It reads data from the console and echoes the characters back afte... | /content/code_sandbox/samples/drivers/uart/echo_bot/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 273 |
```unknown
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
``` | /content/code_sandbox/samples/drivers/uart/echo_bot/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 12 |
```yaml
sample:
name: UART driver sample
tests:
sample.drivers.uart:
integration_platforms:
- qemu_x86
tags:
- serial
- uart
filter: CONFIG_SERIAL and
CONFIG_UART_INTERRUPT_DRIVEN and
dt_chosen_enabled("zephyr,shell-uart")
harness: keyboard
``` | /content/code_sandbox/samples/drivers/uart/echo_bot/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 75 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/uart.h>
#include <zephyr/sys/ring_buffer.h>
#include <stdio.h>
#include <string.h>
struct patch_info {
const uint8_t * const name;
const struct device *rx_dev;
struct ring_buf *rx_ring_buf;
bool rx_error;
bool rx_over... | /content/code_sandbox/samples/drivers/uart/passthrough/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 877 |
```restructuredtext
.. zephyr:code-sample:: uart-native-tty
:name: Native TTY UART
:relevant-api: uart_interface
Use native TTY driver to send and receive data between two UART-to-USB bridge dongles.
Overview
********
This sample demonstrates the usage of the Native TTY UART driver. It uses two
UART to USB ... | /content/code_sandbox/samples/drivers/uart/native_tty/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,117 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/uart.h>
#include <string.h>
/* change this to any other UART peripheral if desired */
#define UART_DEVICE_NODE DT_CHOSEN(zephyr_shell_uart)
#define MSG_SIZE 32
/* queue to store up to 10 messages (aligned to 4-byte bounda... | /content/code_sandbox/samples/drivers/uart/echo_bot/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 703 |
```yaml
sample:
name: Native TTY sample
tests:
sample.drivers.uart.native_tty:
build_only: true
platform_allow:
- native_posix
- native_sim
tags:
- serial
- uart
``` | /content/code_sandbox/samples/drivers/uart/native_tty/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 55 |
```c
/*
* @brief Native TTY UART sample
*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/uart.h>
#include <stdio.h>
#include <string.h>
const struct device *uart0 = DEVICE_DT_GET(DT_NODELABEL(uart0));
const struct device *uart2 = DEVICE_DT_GET(DT_NODELABEL(uart2));
struct ua... | /content/code_sandbox/samples/drivers/uart/native_tty/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 603 |
```unknown
/ {
uart0: uart {
status = "okay";
compatible = "zephyr,native-tty-uart";
current-speed = <115200>;
serial-port = "/dev/ttyUSB0";
};
uart2: uart2 {
status = "okay";
compatible = "zephyr,native-tty-uart";
current-speed = <115200>;
serial-port = "/dev/ttyUSB1";
};
};
``` | /content/code_sandbox/samples/drivers/uart/native_tty/boards/native_sim.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 101 |
```unknown
#include "native_sim.overlay"
``` | /content/code_sandbox/samples/drivers/uart/native_tty/boards/native_posix.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 7 |
```unknown
CONFIG_SERIAL=y
CONFIG_UART_USE_RUNTIME_CONFIGURE=y
``` | /content/code_sandbox/samples/drivers/uart/native_tty/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 13 |
```restructuredtext
.. zephyr:code-sample:: lp5569
:name: LP5569 9-channel LED controller
:relevant-api: led_interface
Control 9 LEDs connected to an LP5569 driver chip.
Overview
********
This sample controls 9 LEDs connected to an LP5569 driver. The sample turns
all LEDs on and switches all LEDs off again ... | /content/code_sandbox/samples/drivers/led_lp5569/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 301 |
```unknown
CONFIG_LOG=y
CONFIG_LED=y
``` | /content/code_sandbox/samples/drivers/led_lp5569/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 9 |
```c
/*
*
*/
#include <zephyr/device.h>
#include <zephyr/drivers/led.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(app, CONFIG_LED_LOG_LEVEL);
#define NUM_LEDS 9
#define DELAY_TIME_ON K_MSEC(1000)
#define DELAY_TIME_BREATHING K_MSEC(20)
int main(void)
{
const struct device *c... | /content/code_sandbox/samples/drivers/led_lp5569/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 402 |
```yaml
sample:
description: Demonstration of the LP5569 LED driver
name: LP5569 sample
tests:
sample.drivers.led.lp5569:
platform_allow: nrf52840dk/nrf52840
tags: led
``` | /content/code_sandbox/samples/drivers/led_lp5569/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 55 |
```restructuredtext
.. zephyr:code-sample:: dmic
:name: Digital Microphone (DMIC)
:relevant-api: audio_dmic_interface
Perform PDM transfers using different configurations.
Overview
********
This is a very simple application intended to show how to use the :ref:`Audio DMIC
API <audio_dmic_api>` and also to b... | /content/code_sandbox/samples/drivers/audio/dmic/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 293 |
```unknown
&i2c0 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
lp5569@32 {
compatible = "ti,lp5569";
reg = <0x32>;
};
};
``` | /content/code_sandbox/samples/drivers/led_lp5569/boards/nrf52840dk_nrf52840.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 52 |
```yaml
sample:
name: DMIC sample
tests:
sample.drivers.audio.dmic:
tags: dmic
filter: dt_nodelabel_enabled("dmic_dev")
integration_platforms:
- nrf52840dk/nrf52840
- nrf5340dk/nrf5340/cpuapp
harness: console
harness_config:
type: multi_line
ordered: true
regex:
... | /content/code_sandbox/samples/drivers/audio/dmic/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 105 |
```unknown
CONFIG_AUDIO=y
CONFIG_AUDIO_DMIC=y
CONFIG_LOG=y
``` | /content/code_sandbox/samples/drivers/audio/dmic/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 15 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/audio/dmic.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(dmic_sample);
#define MAX_SAMPLE_RATE 16000
#define SAMPLE_BIT_WIDTH 16
#define BYTES_PER_SAMPLE sizeof(int16_t)
/* Milliseconds to wait for a block to be read. */
#define READ_TIMEOUT 10... | /content/code_sandbox/samples/drivers/audio/dmic/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 992 |
```unknown
/*
*/
/ {
msm261d3526hicpm-c-en {
regulator-boot-on;
};
};
dmic_dev: &pdm0 {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/audio/dmic/boards/xiao_ble_nrf52840_sense.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 40 |
```unknown
dmic_dev: &dmic0 {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/audio/dmic/boards/mimxrt595_evk_mimxrt595s_cm33.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 16 |
```unknown
dmic_dev: &dmic0 {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/audio/dmic/boards/rd_rw612_bga.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 16 |
```unknown
/*
*
*/
&clock {
hfclkaudio-frequency = <12288000>;
};
&pinctrl {
pdm0_default_alt: pdm0_default_alt {
group1 {
psels = <NRF_PSEL(PDM_CLK, 0, 25)>,
<NRF_PSEL(PDM_DIN, 0, 26)>;
};
};
};
dmic_dev: &pdm0 {
status = "okay";
pinctrl-0 = <&pdm0_default_alt>;
pinctrl-names = "default";
clock-... | /content/code_sandbox/samples/drivers/audio/dmic/boards/nrf5340dk_nrf5340_cpuapp.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 128 |
```restructuredtext
.. zephyr:code-sample:: lp5562
:name: LP5562 RGB LED
:relevant-api: led_interface
Control 4 RGB LEDs connected to an LP5562 driver chip.
Overview
********
This sample controls 4 LEDs connected to a TI LP5562 driver, using the
following pattern:
1. turn on LEDs to be red
2. turn on LED... | /content/code_sandbox/samples/drivers/led_lp5562/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 354 |
```unknown
CONFIG_LOG=y
CONFIG_LED=y
``` | /content/code_sandbox/samples/drivers/led_lp5562/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 9 |
```yaml
sample:
description: Demonstration of the LP5562 LED driver
name: LP5562 sample
tests:
sample.drivers.led.lp5562:
platform_allow: nrf52840dk/nrf52840
tags: led
harness: TBD
``` | /content/code_sandbox/samples/drivers/led_lp5562/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 60 |
```unknown
/*
*
*/
&pinctrl {
pdm0_default_alt: pdm0_default_alt {
group1 {
psels = <NRF_PSEL(PDM_CLK, 0, 30)>,
<NRF_PSEL(PDM_DIN, 0, 31)>;
};
};
};
dmic_dev: &pdm0 {
status = "okay";
pinctrl-0 = <&pdm0_default_alt>;
pinctrl-names = "default";
clock-source = "PCLK32M_HFXO";
};
``` | /content/code_sandbox/samples/drivers/audio/dmic/boards/nrf52840dk_nrf52840.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 117 |
```unknown
&i2c0 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
lp5562@30 {
compatible = "ti,lp5562";
reg = <0x30>;
};
};
``` | /content/code_sandbox/samples/drivers/led_lp5562/boards/nrf52840dk_nrf52840.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 52 |
```restructuredtext
.. zephyr:code-sample:: kscan
:name: KSCAN
:relevant-api: kscan_interface timer_apis
Use the KSCAN API to read key presses and releases on a keyboard matrix.
Overview
********
This sample demonstrates how to use the :ref:`KSCAN API <kscan_api>`.
Callbacks are registered that will write t... | /content/code_sandbox/samples/drivers/kscan/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 219 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_PRINTK=y
CONFIG_KSCAN=y
CONFIG_LOG=y
``` | /content/code_sandbox/samples/drivers/kscan/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 21 |
```yaml
sample:
name: KSCAN driver sample
tests:
sample.drivers.kscan:
tags:
- drivers
- kscan
harness: console
harness_config:
type: multi_line
ordered: true
regex:
- "kb data(.*)"
fixture: fixture_connect_keyboard
depends_on: kscan
filter: dt_chosen_... | /content/code_sandbox/samples/drivers/kscan/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 93 |
```c
/*
*
*/
#include <zephyr/device.h>
#include <errno.h>
#include <zephyr/drivers/led.h>
#include <zephyr/sys/util.h>
#include <zephyr/kernel.h>
#define LOG_LEVEL 4
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(main);
#define NUM_LEDS 4
#define BLINK_DELAY_ON 500
#define BLINK_DELAY_OFF 500
#define DELAY_T... | /content/code_sandbox/samples/drivers/led_lp5562/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,464 |
```unknown
CONFIG_CONSOLE=y
CONFIG_LOG=y
CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=100
``` | /content/code_sandbox/samples/drivers/kscan/boards/mec15xxevb_assy6853.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 18 |
```restructuredtext
.. zephyr:code-sample:: soc-flash-nrf
:name: nRF SoC Internal Storage
:relevant-api: flash_interface flash_area_api
Use the flash API to interact with the SoC flash.
Overview
********
This sample demonstrates using the :ref:`Flash API <flash_api>` on an SoC internal storage.
The sample u... | /content/code_sandbox/samples/drivers/soc_flash_nrf/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,204 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_FLASH=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_SOC_FLASH_NRF_EMULATE_ONE_BYTE_WRITE_ACCESS=y
CONFIG_FCB=y
CONFIG_FLASH_MAP=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_FCB=y
``` | /content/code_sandbox/samples/drivers/soc_flash_nrf/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 52 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/gpio.h>
#include <soc.h>
#include <zephyr/drivers/kscan.h>
#define LOG_LEVEL LOG_LEVEL_DBG
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(main);
const struct device *const kscan_dev = DEVICE_DT_GET(DT_CHOSEN(zephy... | /content/code_sandbox/samples/drivers/kscan/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 2,670 |
```yaml
sample:
name: SoC Flash on NRF52
tests:
sample.drivers.flash.soc_flash_nrf:
platform_allow:
- nrf52dk/nrf52832
- nrf9160dk/nrf9160
- nrf9160dk/nrf9160/ns
integration_platforms:
- nrf52dk/nrf52832
tags:
- flash
- drivers
harness: console
harness_config:... | /content/code_sandbox/samples/drivers/soc_flash_nrf/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 244 |
```restructuredtext
.. zephyr:code-sample:: charger
:name: Charger
:relevant-api: charger_interface
Charge a battery using the charger driver API.
Overview
********
This sample demonstrates how to use the :ref:`charger_api` API.
The sample application performs a simple charging task loop.
- The applicatio... | /content/code_sandbox/samples/drivers/charger/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 220 |
```unknown
# Private config options for charger sample app
mainmenu "Charger application"
if CHARGER_DISCHAGRE_CURRENT_NOTIFICATIONS
config APP_DISCHARGE_CURRENT_NOTIFICATION_THRESHOLD_UA
int "Discharge notification threshold in A"
config APP_DISCHARGE_CURRENT_NOTIFICATION_DURATION_US
int "Excess discharge durat... | /content/code_sandbox/samples/drivers/charger/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 118 |
```unknown
CONFIG_CHARGER=y
``` | /content/code_sandbox/samples/drivers/charger/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 6 |
```yaml
sample:
name: Generic charger
tests:
sample.drivers.charger:
tags: charger
depends_on: charger
``` | /content/code_sandbox/samples/drivers/charger/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 29 |
```c
/*
*
*/
#include "zephyr/sys/printk.h"
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/charger.h>
#include <sys/errno.h>
static const struct device *chgdev = DEVICE_DT_GET(DT_NODELABEL(charger));
int main(void)
{
union charger_propval val;
int re... | /content/code_sandbox/samples/drivers/charger/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 813 |
```c
/*
* 2016 Intel Corporation.
*
*/
#include <zephyr/kernel.h>
#include <zephyr/drivers/flash.h>
#include <zephyr/storage/flash_map.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <stdio.h>
#define TEST_PARTITION storage_partition
#define TEST_PARTITION_OFFSET FIXED_PARTITI... | /content/code_sandbox/samples/drivers/soc_flash_nrf/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,988 |
```unknown
CONFIG_LOG=y
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_WDT_LOG_LEVEL_DBG=y
CONFIG_WATCHDOG=y
CONFIG_WDT_DISABLE_AT_BOOT=n
``` | /content/code_sandbox/samples/drivers/watchdog/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 33 |
```restructuredtext
.. zephyr:code-sample:: watchdog
:name: Watchdog
:relevant-api: watchdog_interface
Use the watchdog driver API to reset the board when it gets stuck in an infinite loop.
Overview
********
This sample demonstrates how to use the watchdog driver API.
A typical use case for a watchdog is t... | /content/code_sandbox/samples/drivers/watchdog/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 377 |
```yaml
sample:
name: Watchdog Driver Sample
common:
tags:
- drivers
- watchdog
harness: console
harness_config:
type: multi_line
ordered: true
regex:
- "Watchdog sample application"
- "Feeding watchdog..."
- "Waiting for reset..."
- "Watchdog sample application"
de... | /content/code_sandbox/samples/drivers/watchdog/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,108 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/watchdog.h>
#include <zephyr/sys/printk.h>
#include <stdbool.h>
#define WDT_FEED_TRIES 5
/*
* To use this sample the devicetree's /aliases must have a 'watchdog0' property.
*/
#if DT_HAS_COMPAT_STATUS_OKAY(st_stm32_window... | /content/code_sandbox/samples/drivers/watchdog/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 996 |
```unknown
/*
*
*/
&rcc {
apb1-prescaler = <4>;
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/nucleo_f091rc.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 17 |
```unknown
/*
*
*/
/ {
aliases {
watchdog0 = &watchdog0;
};
};
&watchdog0 {
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL
IRQ_DEFAULT_PRIORITY>;
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/intel_socfpga_agilex_socdk.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 63 |
```unknown
/*
*
*/
&tco_wdt {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/up_squared_pro_7000.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 15 |
```unknown
&wdt0 {
/* uncomment to use Non-Maskable interrupt instead of the normal one */
/* interrupt-nmi; */
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/cc1352r1_sensortag.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 30 |
```unknown
/*
*
*/
&rcc {
apb1-prescaler = <8>;
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/stm32f3_disco.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 17 |
```unknown
/*
*
*/
&tco_wdt {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/intel_ehl_crb.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 15 |
```unknown
/*
*/
&wdt010 {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 14 |
```unknown
/*
*
*/
&tco_wdt {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/intel_rpl_p_crb.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 15 |
```unknown
/*
*
*/
/ {
aliases {
watchdog0 = &wdt;
};
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/adp_xc7k_ae350.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 22 |
```unknown
/*
*
*/
&wdt0 {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/xmc47_relax_kit.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 15 |
```unknown
&rcc {
apb1-prescaler = <16>;
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/disco_l475_iot1.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 14 |
```unknown
&wdt0 {
/* uncomment to use Non-Maskable interrupt instead of the normal one */
/* interrupt-nmi; */
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/cc26x2r1_launchxl.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 30 |
```unknown
/*
*/
&wdt31 {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/nrf54l15pdk_nrf54l15_cpuflpr_xip.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 14 |
```unknown
/*
*
*/
/ {
aliases {
watchdog0 = &iwdg;
};
};
&iwdg {
status = "okay";
};
&wwdg {
status = "disabled";
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/stm32_iwdg.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 44 |
```unknown
CONFIG_HEAP_MEM_POOL_SIZE=256
``` | /content/code_sandbox/samples/drivers/watchdog/boards/esp32s2_saola.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 9 |
```unknown
/*
*
*/
&tco_wdt {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/intel_rpl_s_crb.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 15 |
```unknown
/*
*/
&wdt31 {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 14 |
```unknown
/*
*
*/
/ {
aliases {
watchdog0 = &aontimer;
};
};
&aontimer {
status = "okay";
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/opentitan_earlgrey.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 33 |
```unknown
/*
*
*/
/ {
aliases {
watchdog0 = &wwdg;
};
};
&rcc {
d2ppre1 = <16>;
};
&wwdg {
status = "okay";
};
&iwdg {
status = "disabled";
};
``` | /content/code_sandbox/samples/drivers/watchdog/boards/stm32h7_wwdg.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 56 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.