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/drivers/uart.h>
int main(void)
{
char data;
const struct device *uart0 = DEVICE_DT_GET(DT_NODELABEL(pio1_uart0));
const struct device *uart1 = DEVICE_DT_GET(DT_NODELABEL(pio1_uart1));
if (!device_is_ready(uart0)) {
return 0;
... | /content/code_sandbox/samples/boards/rpi_pico/uart_pio/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 180 |
```unknown
&pinctrl {
pio1_uart0_default: pio1_uart0_default {
rx_pins {
pinmux = <PIO1_P1>;
input-enable;
bias-pull-up;
};
tx_pins {
pinmux = <PIO1_P0>;
};
};
pio1_uart1_default: pio1_uart1_default {
rx_pins {
pinmux = <PIO1_P2>;
input-enable;
bias-pull-up;
};
tx_pins {
pinmux... | /content/code_sandbox/samples/boards/rpi_pico/uart_pio/boards/rpi_pico.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 275 |
```restructuredtext
.. _microbit-samples:
BBC micro:bit Samples
#####################
.. toctree::
:maxdepth: 1
:glob:
**/*
``` | /content/code_sandbox/samples/boards/bbc_microbit/microbit.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 37 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/crypto/crypto.h>
#include <zephyr/crypto/hash.h>
#include <zephyr/sys/util.h>
#include <stdio.h>
#include <string.h>
#include <soc.h>
struct hash_tp {
enum hash_algo hash_id;
size_t msgsz;
const u... | /content/code_sandbox/samples/boards/mec172xevb_assy6906/rom_api/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 8,661 |
```unknown
CONFIG_GPIO=y
CONFIG_DISPLAY=y
CONFIG_MICROBIT_DISPLAY=y
CONFIG_PWM=y
``` | /content/code_sandbox/samples/boards/bbc_microbit/sound/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 20 |
```restructuredtext
.. _microbit_sound:
BBC micro:bit sound
###################
Overview
********
This sample demonstrates how to use a piezo buzzer connected
to port P0 on the edge connector of the **BBC micro:bit v1** or
using the on-board buzzer on the **BBC micro:bit v2**.
Requirements
************
Using **BBC... | /content/code_sandbox/samples/boards/bbc_microbit/sound/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 346 |
```yaml
sample:
name: BBC micro:bit Sound
tests:
sample.board.bbc_microbit.sound:
platform_allow:
- bbc_microbit
- bbc_microbit_v2
tags: sound
``` | /content/code_sandbox/samples/boards/bbc_microbit/sound/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 46 |
```unknown
/ {
zephyr,user {
/* period cell corresponds to initial period */
pwms = <&sw_pwm 0 PWM_USEC(1500) PWM_POLARITY_NORMAL>;
};
};
&sw_pwm {
status = "okay";
channel-gpios = <&edge_connector 0 GPIO_ACTIVE_HIGH>;
};
``` | /content/code_sandbox/samples/boards/bbc_microbit/sound/boards/bbc_microbit.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 68 |
```unknown
/ {
zephyr,user {
/* period cell corresponds to initial period */
pwms = <&pwm1 0 PWM_USEC(1500) PWM_POLARITY_NORMAL>;
};
};
``` | /content/code_sandbox/samples/boards/bbc_microbit/sound/boards/bbc_microbit_v2.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 45 |
```restructuredtext
.. _microbit_pong:
BBC micro:bit pong game
#######################
Overview
********
Play pong over as single player or Bluetooth between two micro:bit
devices.
The game works by controlling a paddle with the two buttons of the
micro:bit (labeled A and B). Initially the playing mode is selected:... | /content/code_sandbox/samples/boards/bbc_microbit/pong/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 230 |
```unknown
CONFIG_ISR_STACK_SIZE=1024
CONFIG_BT=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_DEVICE_NAME="Zephyr Pong"
CONFIG_GPIO=y
CONFIG_DISPLAY=y
CONFIG_MICROBIT_DISPLAY=y
CONFIG_PWM=y
CONFIG_PWM_NRF_SW=y
# This feature isn't needed as this sample is intended to be used
# between ... | /content/code_sandbox/samples/boards/bbc_microbit/pong/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 103 |
```yaml
sample:
name: Pong game using BBC Micro:bit
tests:
sample.board.bbc_microbit.pong:
platform_allow: bbc_microbit
tags:
- microbit
- mesh
- bluetooth
``` | /content/code_sandbox/samples/boards/bbc_microbit/pong/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 51 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/pwm.h>
#include <zephyr/device.h>
#include <zephyr/display/mb_display.h>
#define PERIOD_MIN PWM_USEC(50)
#define PERIOD_MAX PWM_USEC(3900)
#define BEEP_DURATION K_MSEC(60)
#de... | /content/code_sandbox/samples/boards/bbc_microbit/sound/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 800 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/device.h>
#include <string.h>
#include <zephyr/drivers/pwm.h>
#include <zephyr/debug/stack.h>
#include <zephyr/display/mb_display.h>
#include <zephyr/bluetooth/bluetooth.h>
#include "pong.h"
/... | /content/code_sandbox/samples/boards/bbc_microbit/pong/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 3,432 |
```objective-c
/*
*
*/
void pong_ball_received(int8_t x_pos, int8_t y_pos, int8_t x_vel, int8_t y_vel);
void pong_conn_ready(bool initiator);
void pong_remote_disconnected(void);
void pong_remote_lost(void);
void ble_send_ball(int8_t x_pos, int8_t y_pos, int8_t x_vel, int8_t y_vel);
void ble_send_lost(void);
void b... | /content/code_sandbox/samples/boards/bbc_microbit/pong/src/pong.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 102 |
```unknown
/ {
zephyr,user {
/* period is always set dynamically by the application */
pwms = <&sw_pwm 0 0 PWM_POLARITY_NORMAL>;
};
};
&sw_pwm {
status = "okay";
channel-gpios = <&edge_connector 0 GPIO_ACTIVE_HIGH>;
};
``` | /content/code_sandbox/samples/boards/bbc_microbit/pong/boards/bbc_microbit.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 65 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/device.h>
#include <string.h>
#include <zephyr/display/mb_display.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/uuid.h>
#include <zephyr/bluetooth/conn.h>
#include <zephy... | /content/code_sandbox/samples/boards/bbc_microbit/pong/src/ble.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 3,416 |
```unknown
# nothing here
CONFIG_GPIO=y
CONFIG_DISPLAY=y
CONFIG_MICROBIT_DISPLAY=y
``` | /content/code_sandbox/samples/boards/bbc_microbit/display/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 20 |
```yaml
sample:
name: BB micro:bit Display
tests:
sample.board.bbc_microbit.display:
platform_allow: bbc_microbit
tags: display
``` | /content/code_sandbox/samples/boards/bbc_microbit/display/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```restructuredtext
.. _microbit_display:
BBC micro:bit display
#####################
Overview
********
A simple example that demonstrates how to use the 5x5 LED matrix display
on the BBC micro:bit board.
Building
********
This project outputs various things on the BBC micro:bit display. It can
be built as follows:... | /content/code_sandbox/samples/boards/bbc_microbit/display/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 163 |
```restructuredtext
.. _microbit_line_follower_robot:
BBC micro:bit line-follower robot
#################################
Overview
********
This sample controls a stand-alone line-following DFRobot Maqueen
robot chassis containing a BBC micro:bit board.
Requirements
************
To build and run this sample you'll... | /content/code_sandbox/samples/boards/bbc_microbit/line_follower_robot/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 253 |
```unknown
CONFIG_GPIO=y
CONFIG_I2C=y
CONFIG_PRINTK=y
``` | /content/code_sandbox/samples/boards/bbc_microbit/line_follower_robot/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 16 |
```yaml
sample:
name: BBC micro:bit Line follower robot
tests:
sample.board.bbc_microbit.line_follower_robot:
platform_allow: bbc_microbit
tags:
- microbit
- line-follower
- robot
- car
``` | /content/code_sandbox/samples/boards/bbc_microbit/line_follower_robot/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 58 |
```yaml
description: Motor controller embedded in DFRobot Maqueen.
compatible: "motor-controller"
include: i2c-device.yaml
``` | /content/code_sandbox/samples/boards/bbc_microbit/line_follower_robot/dts/bindings/motor-controller.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/device.h>
#include <zephyr/display/mb_display.h>
static struct mb_image smiley = MB_IMAGE({ 0, 1, 0, 1, 0 },
{ 0, 1, 0, 1, 0 },
{ 0, 0, 0, 0, 0 },
{ 1, 0, 0, 0, 1 },
{ 0,... | /content/code_sandbox/samples/boards/bbc_microbit/display/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,188 |
```unknown
/*
*/
/ {
zephyr,user {
left-gpios = <&edge_connector 13 GPIO_ACTIVE_HIGH>;
right-gpios = <&edge_connector 14 GPIO_ACTIVE_HIGH>;
};
};
&i2c0 {
motorctl: motor-controller@10 {
compatible = "motor-controller";
reg = <0x10>;
};
};
``` | /content/code_sandbox/samples/boards/bbc_microbit/line_follower_robot/boards/bbc_microbit.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 77 |
```restructuredtext
.. _ti-cc13x2_cc26x2-system-off-sample:
cc13x2_cc26x2 System Off demo
#############################
Overview
********
This sample can be used for basic power measurement and as an example of
the various sleep modes on TI CC13x2/CC26x2 platforms. The functional
behavior is:
* Busy-wait for 5 sec... | /content/code_sandbox/samples/boards/ti/cc13x2_cc26x2/system_off/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 461 |
```unknown
CONFIG_GPIO=y
CONFIG_PM=y
CONFIG_POWEROFF=y
``` | /content/code_sandbox/samples/boards/ti/cc13x2_cc26x2/system_off/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 16 |
```yaml
sample:
name: Low Power State Sample for TI CC13x2/CC26x2
tests:
sample.boards.ti.cc13x2_cc26x2.system_off:
build_only: true
platform_allow: cc1352r1_launchxl
tags: power
``` | /content/code_sandbox/samples/boards/ti/cc13x2_cc26x2/system_off/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 64 |
```c
/*
* A Line follower robot program using DFRobot Maqueen Robot and microbit
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/device.h>
enum motor {
MOTOR_LEFT,
MOTOR_RIGHT,
};
static const struct gpio_dt_spec left_... | /content/code_sandbox/samples/boards/bbc_microbit/line_follower_robot/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 887 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <driverlib/cpu.h>
#define GPIO_PORT DT_NODELABEL(gpio0)
#define DIO8_PIN 8
#define DIO9_PIN 9
#define DIO10_PIN 10
#define DIO20_PIN 20
/*
* ======== CC1352R1_LAUNCHXL_sendExtFlashByte ========
*/
vo... | /content/code_sandbox/samples/boards/ti/cc13x2_cc26x2/system_off/src/ext_flash.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 806 |
```c
/*
*
*/
#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/init.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/poweroff.h>
#include <driverlib/ioc.h>
static const struct gpio_dt_spec sw0_gpio = GPIO_DT_SPEC_GET(DT_ALIAS(sw0), gpios);
#define BUSY_WAIT_S 5U
#de... | /content/code_sandbox/samples/boards/ti/cc13x2_cc26x2/system_off/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 413 |
```restructuredtext
.. _flexram_magic_addr:
FLEXRAM Magic Addr
##################
Overview
********
A sample that shows how to use RT11XX FLEXRAM Magic Addr functionality
Magic Addr is a feature of FlexRAM that allows user to configure an interrupt
on an arbitrary RAM/TCM address access. This sample shows how to us... | /content/code_sandbox/samples/boards/mimxrt1170_evk_cm7/magic_addr/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 97 |
```unknown
CONFIG_MEMC_NXP_FLEXRAM_MAGIC_ADDR_API=y
CONFIG_CONSOLE_SUBSYS=y
CONFIG_CONSOLE_GETCHAR=y
``` | /content/code_sandbox/samples/boards/mimxrt1170_evk_cm7/magic_addr/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 26 |
```yaml
sample:
description: RT1170 FLEXRAM Magic Addr example
name: magic addr
common:
integration_platforms:
- mimxrt1170_evk/mimxrt1176/cm7
- mimxrt1160_evk/mimxrt1166/cm7
tests:
sample.boards.mimxrt1170_evk.magic_addr:
platform_allow:
- mimxrt1170_evk/mimxrt1176/cm7
- mimxrt1160_evk/... | /content/code_sandbox/samples/boards/mimxrt1170_evk_cm7/magic_addr/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 122 |
```c
/*
*
*/
#include <stdio.h>
#include <zephyr/linker/section_tags.h>
#include "memc_nxp_flexram.h"
#include <zephyr/kernel.h>
#include <zephyr/console/console.h>
#include <zephyr/cache.h>
K_SEM_DEFINE(dtcm_magic, 0, 1);
__dtcm_bss_section uint8_t var;
int cnt;
void flexram_magic_addr_isr_cb(enum memc_flexram_i... | /content/code_sandbox/samples/boards/mimxrt1170_evk_cm7/magic_addr/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 327 |
```unknown
CONFIG_LOG=y
CONFIG_PRINTK=y
CONFIG_SPI=y
CONFIG_I2C=y
CONFIG_GPIO=y
# config sensors
CONFIG_SENSOR=y
CONFIG_SENSOR_LOG_LEVEL_DBG=y
CONFIG_LPS2XDF_TRIGGER_OWN_THREAD=y
CONFIG_LSM6DSV16X_TRIGGER_OWN_THREAD=y
CONFIG_LIS2MDL_TRIGGER_OWN_THREAD=y
CONFIG_LIS2DU12_TRIGGER_OWN_THREAD=y
CONFIG_CBPRINTF_FP_SUPPORT=... | /content/code_sandbox/samples/boards/sensortile_box_pro/sensors-on-board/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 96 |
```yaml
sample:
description: SensorTile.box Pro board testing
name: SensorTile.box Pro test
tests:
sample.board.sensortile_box_pro.sensors-on-board:
harness: sensor
platform_allow: sensortile_box_pro
tags: sensors
depends_on:
- i2c
- spi
- gpio
``` | /content/code_sandbox/samples/boards/sensortile_box_pro/sensors-on-board/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 76 |
```restructuredtext
.. _sensortile_box_pro_sample_sensors:
ST SensorTile.box Pro on-board sensors test
###########################################
Overview
********
This sample provides an example of how to read sensors data
from the SensorTile.box Pro board.
This sample enables all sensors of SensorTile.box Pro boa... | /content/code_sandbox/samples/boards/sensortile_box_pro/sensors-on-board/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 633 |
```unknown
CONFIG_SOC_FAMILY_NSIM_ARC_CLASSIC=y
CONFIG_SOC_NSIM_SEM=y
CONFIG_BOARD_NSIM=y
CONFIG_SYS_CLOCK_TICKS_PER_SEC=100
CONFIG_XIP=n
CONFIG_BUILD_OUTPUT_BIN=n
CONFIG_PRINTK=y
CONFIG_ARCV2_INTERRUPT_UNIT=y
CONFIG_ARCV2_TIMER=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_TRUSTED_EXECUTION_NONSECURE... | /content/code_sandbox/samples/boards/arc_secure_services/nsim_sem_normal_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 91 |
```unknown
/*
*
*/
/dts-v1/;
#include <mem.h>
#include <synopsys/emsk.dtsi>
#include "em_starterkit_r23.dtsi"
#include "board.dtsi"
/ {
model = "em_starterkit_em7d_normal";
compatible = "snps,em_starterkit_em7d_normal", "snps,em_starterkit";
aliases {
uart-0 = &uart0;
uart-1 = &uart1;
uart-2 = &uart2;
}... | /content/code_sandbox/samples/boards/arc_secure_services/em_starterkit_em7d_normal.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 256 |
```restructuredtext
.. _arc_secure_service:
ARC Secure Service
##################
Overview
********
This sample implements a simple secure service based on ARC SecureShield to
demonstrate how a secure zephyr application runs together with a normal
Zephyr application.
In this sample:
* Secure application will be in... | /content/code_sandbox/samples/boards/arc_secure_services/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 808 |
```unknown
/*
*
*/
/dts-v1/;
#include <mem.h>
/* must be before include of nsim_em.dtsi */
#define ICCM_ADDR 40000
#define ICCM_SIZE DT_SIZE_K(256)
#define DCCM_ADDR 80040000
#define DCCM_SIZE DT_SIZE_K(256)
#include "nsim_em.dtsi"
/ {
model = "nsim_sem_normal";
compatible = "snps,nsim_sem_normal";
chosen {... | /content/code_sandbox/samples/boards/arc_secure_services/nsim_sem_normal.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 116 |
```unknown
CONFIG_SOC_EMSK=y
CONFIG_SOC_EMSK_EM7D=y
CONFIG_BOARD_EM_STARTERKIT=y
CONFIG_SYS_CLOCK_TICKS_PER_SEC=100
CONFIG_XIP=n
CONFIG_BUILD_NO_GAP_FILL=y
CONFIG_BUILD_OUTPUT_BIN=n
CONFIG_PRINTK=y
CONFIG_ARCV2_INTERRUPT_UNIT=y
CONFIG_ARCV2_TIMER=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_INTE... | /content/code_sandbox/samples/boards/arc_secure_services/em_starterkit_em7d_normal_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 124 |
```unknown
# Empty file
``` | /content/code_sandbox/samples/boards/arc_secure_services/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 5 |
```yaml
sample:
description: Sample application to verify the secure monitor for Designware ARC
SecureShiled.
name: Designware ARC Secure monitor
tests:
sample.board.arc_secure_services:
# Requires multiple kernels in an AMP config. See README.rst
build_only: true
platform_allow:
- nsim/nsim... | /content/code_sandbox/samples/boards/arc_secure_services/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 195 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/devicetree.h>
#if defined(CONFIG_SOC_NSIM_SEM)
#define NORMAL_FIRMWARE_ENTRY 0x40000
#elif defined(CONFIG_SOC_EMSK)
#define NORMAL_FIRMWARE_ENTRY 0x20000
#endif
#define STACKSIZE 1024
#define PRIORITY 7
#define SLEEPTIME 1000
... | /content/code_sandbox/samples/boards/arc_secure_services/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 346 |
```restructuredtext
.. _bluetooth-mesh-onoff-level-lighting-vnd-sample:
Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
######################################################################
Overview
********
This is a application demonstrating a Bluetooth Mesh node in
which Root element has fol... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,028 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/led.h>
#include <zephyr/drivers/i2c.h>
#include <zephyr/drivers/spi.h>
#include <zephyr/drivers/sensor.h>
#include <stdio.h>
#ifdef CONFIG_LPS2XDF_TRIGGER
static int lps22df_trig_cnt;
... | /content/code_sandbox/samples/boards/sensortile_box_pro/sensors-on-board/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 3,965 |
```yaml
sample:
name: Bluetooth Mesh
tests:
sample.bluetooth.mesh.onoff_level_lighting_vnd:
platform_allow: nrf52840dk/nrf52840
tags: bluetooth
harness: bluetooth
``` | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 47 |
```c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#include "ble_mesh.h"
#include "device_composition.h"
#include "storage.h"
static uint8_t storage_id;
uint8_t reset_counter;
static void save_reset_counter(void)
{
settings_save_one("ps/rc", &reset_counter, sizeof(reset_counter... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/storage.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,343 |
```unknown
CONFIG_INIT_STACKS=n
CONFIG_MAIN_STACK_SIZE=1024
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_BT_OBSERVER=y
CONFIG_BT_BROADCASTER=y
CONFIG_BT_CTLR_DUP_FILTER_LEN=0
CONFIG_BT_CTLR_LE_ENC=n
CONFIG_BT_CTLR_LE_PING=n
CONFIG... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 598 |
```c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#include <zephyr/drivers/gpio.h>
#include <zephyr/kernel.h>
#include "app_gpio.h"
#include "publisher.h"
K_WORK_DEFINE(button_work, publish);
static void button_pressed(const struct device *dev,
struct gpio_callback *cb, ... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/app_gpio.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 531 |
```objective-c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#ifndef _STORAGE_H
#define _STORAGE_H
enum ps_variables_id {
RESET_COUNTER = 0x01,
GEN_DEF_TRANS_TIME_STATE,
GEN_ONPOWERUP_STATE,
DEF_STATES,
LIGHTNESS_LAST_STATE,
LAST_TARGET_STATES,
LIGHTNESS_RANGE,
TEMPER... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/storage.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 118 |
```objective-c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#ifndef _APP_GPIO_H
#define _APP_GPIO_H
/* GPIO */
extern const struct gpio_dt_spec button_device[];
extern const struct gpio_dt_spec led_device[];
void app_gpio_init(void);
#endif
``` | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/app_gpio.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 61 |
```objective-c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#ifndef _COMMON_H
#define _COMMON_H
void update_led_gpio(void);
void update_light_state(void);
void update_vnd_led_gpio(void);
#endif
``` | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/common.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 52 |
```c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#include <zephyr/drivers/gpio.h>
#include "app_gpio.h"
#include "ble_mesh.h"
#include "device_composition.h"
#include "no_transition_work_handler.h"
#include "state_binding.h"
#include "storage.h"
#include "transition.h"
static ... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,152 |
```objective-c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#ifndef _NO_TRANSITION_WORK_HANDLER_H
#define _NO_TRANSITION_WORK_HANDLER_H
extern struct k_work no_transition_work;
#endif
``` | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/no_transition_work_handler.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 48 |
```objective-c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#ifndef _TRANSITION_H
#define _TRANSITION_H
#include "device_composition.h"
#define UNKNOWN_VALUE 0x3F
#define DEVICE_SPECIFIC_RESOLUTION 10
enum transition_types {
MOVE = 0x01,
NON_MOVE
};
struct transition_data {... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/transition.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 213 |
```c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#include "common.h"
#include "ble_mesh.h"
#include "device_composition.h"
#include "state_binding.h"
#include "storage.h"
static void unsolicitedly_publish_states_work_handler(struct k_work *work)
{
gen_onoff_publish(&root_model... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/no_transition_work_handler.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 456 |
```c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#include <zephyr/drivers/gpio.h>
#include "ble_mesh.h"
#include "common.h"
#include "device_composition.h"
#include "state_binding.h"
#include "transition.h"
struct transition_data onoff_transition;
/* Function to calculate Rem... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/transition.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 3,745 |
```objective-c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#ifndef _PUBLISHER_H
#define _PUBLISHER_H
#include <zephyr/kernel.h>
/* Others */
#define LEVEL_S0 -32768
#define LEVEL_S25 -16384
#define LEVEL_S50 0
#define LEVEL_S75 16384
#define LEVEL_S100 32767
#define LEVE... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/publisher.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 143 |
```objective-c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#ifndef _STATE_BINDING_H
#define _STATE_BINDING_H
enum state_binding {
ONOFF,
LEVEL_LIGHT,
DELTA_LEVEL_LIGHT,
MOVE_LIGHT,
ACTUAL,
LINEAR,
CTL_LIGHT,
LEVEL_TEMP,
MOVE_TEMP,
CTL_TEMP,
CTL_DELTA_UV
};
uint16_... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/state_binding.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 149 |
```objective-c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#ifndef _BLE_MESH_H
#define _BLE_MESH_H
#include <zephyr/settings/settings.h>
#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/bluetooth/conn.h>
#include <zephyr/bluetooth/l2cap.h>
#include <zephyr/bluetooth/hci... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/ble_mesh.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,609 |
```c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#include <math.h>
#include <zephyr/drivers/gpio.h>
#include "ble_mesh.h"
#include "device_composition.h"
#include "state_binding.h"
#include "storage.h"
#include "transition.h"
static int32_t ceiling(float num)
{
int32_t inum;
... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/state_binding.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,567 |
```c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#include <zephyr/drivers/gpio.h>
#include "app_gpio.h"
#include "ble_mesh.h"
#include "device_composition.h"
#include "publisher.h"
#define ONOFF
#define GENERIC_LEVEL
static uint8_t tid;
void publish(struct k_work *work)
{
i... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/publisher.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 2,963 |
```c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#include "ble_mesh.h"
#include "device_composition.h"
#ifdef OOB_AUTH_ENABLE
static int output_number(bt_mesh_output_action_t action, uint32_t number)
{
printk("OOB Number: %u\n", number);
return 0;
}
static int output_string... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/ble_mesh.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 388 |
```objective-c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#ifndef _DEVICE_COMPOSITION_H
#define _DEVICE_COMPOSITION_H
#define CID_ZEPHYR 0x0002
#define STATE_OFF 0x00
#define STATE_ON 0x01
#define STATE_DEFAULT 0x01
#define STATE_RESTORE 0x02
/* Following 4 ... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/device_composition.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 565 |
```restructuredtext
.. _bluetooth-mesh-onoff-sample:
Bluetooth: Mesh OnOff Model
###########################
Overview
********
This is a simple application demonstrating a Bluetooth Mesh multi-element node.
Each element has a mesh onoff client and server
model which controls one of the 4 sets of buttons and LEDs .
... | /content/code_sandbox/samples/boards/nrf/mesh/onoff-app/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 956 |
```unknown
#CONFIG_INIT_STACKS=y # if set, lots of noise from mesh/adv.c: STACK_ANALYZE
CONFIG_MAIN_STACK_SIZE=512
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_GPIO=y
CONFIG_BT_SETTINGS=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_BT_MESH_RPL_STORE_TIMEOUT=600
CONFIG_BOOT_BANNER=y... | /content/code_sandbox/samples/boards/nrf/mesh/onoff-app/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 667 |
```yaml
sample:
name: Bluetooth Mesh
tests:
sample.bluetooth.mesh.onoff:
platform_allow: nrf52840dk/nrf52840
tags: bluetooth
harness: bluetooth
``` | /content/code_sandbox/samples/boards/nrf/mesh/onoff-app/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 42 |
```c
/* main.c - Application main entry point */
/*
*
*/
/*
* This application is specific to the Nordic nRF52840-PDK board.
*
* It supports the 4 buttons and 4 LEDs as mesh clients and servers.
*
* Prior to provisioning, a button inverts the state of the
* corresponding LED.
*
* The unprovisioned beacon us... | /content/code_sandbox/samples/boards/nrf/mesh/onoff-app/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 4,587 |
```restructuredtext
.. _nrf_led_matrix_sample:
nRF LED matrix sample
#####################
Overview
********
This is a simple application intended to present the nRF LED matrix display
driver in action and to serve as a test ensuring that this driver is buildable
for both the :ref:`bbc_microbit_v2` and :ref:`bbc_mic... | /content/code_sandbox/samples/boards/nrf/nrf_led_matrix/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 240 |
```c
/* Bluetooth: Mesh Generic OnOff, Generic Level, Lighting & Vendor Models
*
*
*/
#include <zephyr/drivers/gpio.h>
#include "ble_mesh.h"
#include "common.h"
#include "device_composition.h"
#include "state_binding.h"
#include "transition.h"
#include "storage.h"
static struct bt_mesh_health_srv health_srv = {
}... | /content/code_sandbox/samples/boards/nrf/mesh/onoff_level_lighting_vnd_app/src/mesh/device_composition.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 24,497 |
```unknown
CONFIG_DISPLAY=y
``` | /content/code_sandbox/samples/boards/nrf/nrf_led_matrix/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 5 |
```yaml
sample:
name: nRF LED matrix sample
tests:
sample.boards.nrf.nrf_led_matrix:
filter: dt_compat_enabled("nordic,nrf-led-matrix")
integration_platforms:
- bbc_microbit_v2
- bbc_microbit
harness: console
harness_config:
type: multi_line
ordered: true
regex:
... | /content/code_sandbox/samples/boards/nrf/nrf_led_matrix/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 99 |
```restructuredtext
.. _nrfx_sample:
nrfx use example
################
Overview
********
This sample demonstrates the usage of nrfx library in Zephyr.
GPIOTE and DPPI/PPI are used as examples of nrfx drivers.
The code shows how to initialize the GPIOTE interrupt in Zephyr
so that the nrfx_gpiote driver can use it. ... | /content/code_sandbox/samples/boards/nrf/nrfx/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 435 |
```unknown
config NRFX_DPPI
default $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_DPPIC))
config NRFX_PPI
default $(dt_has_compat,$(DT_COMPAT_NORDIC_NRF_PPI))
config NRFX_GPIOTE0
default y if SOC_SERIES_NRF51X || \
SOC_SERIES_NRF52X || \
(SOC_SERIES_NRF53X && !TRUSTED_EXECUTION_NONSECURE) || \
(SOC_... | /content/code_sandbox/samples/boards/nrf/nrfx/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 179 |
```unknown
CONFIG_GPIO=n
CONFIG_LOG=y
CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=100
``` | /content/code_sandbox/samples/boards/nrf/nrfx/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 18 |
```yaml
sample:
name: nrfx use example
tests:
sample.boards.nrf.nrfx:
platform_allow:
- nrf52840dk/nrf52840
- nrf9160dk/nrf9160
integration_platforms:
- nrf52840dk/nrf52840
tags: board
harness: console
harness_config:
type: multi_line
ordered: true
regex:
... | /content/code_sandbox/samples/boards/nrf/nrfx/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 122 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/display.h>
#include <string.h>
#define PIXEL_BIT(idx, val) (val ? BIT(idx) : 0)
#define PIXEL_MASK(...) (FOR_EACH_IDX(PIXEL_BIT, (|), __VA_ARGS__))
static struct display_capabilities caps;
static uint8_t buf[5];
s... | /content/code_sandbox/samples/boards/nrf/nrf_led_matrix/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,977 |
```restructuredtext
.. _samples_boards_nrf_dynamic_pinctrl:
Dynamic Pin Control (nRF)
#########################
The Dynamic Pin Control (nRF) sample demonstrates how to change ``uart0`` at
early boot stages, depending on the input level on a pin connected to a
push-button.
Overview
********
Slightly different board... | /content/code_sandbox/samples/boards/nrf/dynamic_pinctrl/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 723 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <nrfx_gpiote.h>
#include <helpers/nrfx_gppi.h>
#include <zephyr/logging/log.h>
#include <zephyr/irq.h>
LOG_MODULE_REGISTER(nrfx_sample, LOG_LEVEL_INF);
#define INPUT_PIN NRF_DT_GPIOS_TO_PSEL(DT_ALIAS(sw0), gpios)
#define OUTPUT_PIN NRF_DT_GPIOS_TO_PSEL(DT_ALIAS(led... | /content/code_sandbox/samples/boards/nrf/nrfx/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,255 |
```unknown
CONFIG_PINCTRL=y
CONFIG_PINCTRL_DYNAMIC=y
# configure serial and console to come after remap hook
CONFIG_SERIAL_INIT_PRIORITY=60
CONFIG_CONSOLE_INIT_PRIORITY=70
``` | /content/code_sandbox/samples/boards/nrf/dynamic_pinctrl/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 38 |
```yaml
sample:
description: A dynamic pin control sample for nRF board/s.
name: dynamic_pinctrl
tests:
sample.boards.nrf.dynamic_pinctrl:
build_only: true
platform_allow: nrf52840dk/nrf52840
integration_platforms:
- nrf52840dk/nrf52840
``` | /content/code_sandbox/samples/boards/nrf/dynamic_pinctrl/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 75 |
```unknown
mainmenu "Dynamic pin control sample"
config REMAP_INIT_PRIORITY
int "Remap routine initialization priority"
default 50
help
Initialization priority of the remap routine within the PRE_KERNEL1 level.
This priority must be greater than GPIO_INIT_PRIORITY and lower than
UART_INIT_PRIORITY.
sourc... | /content/code_sandbox/samples/boards/nrf/dynamic_pinctrl/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 72 |
```c
/*
*
*/
#include <zephyr/sys/printk.h>
int main(void)
{
printk("Hello World!\n");
return 0;
}
``` | /content/code_sandbox/samples/boards/nrf/dynamic_pinctrl/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 31 |
```unknown
/*
*/
/ {
zephyr,user {
uart0_alt_default = <&uart0_alt_default>;
uart0_alt_sleep = <&uart0_alt_sleep>;
};
};
&pinctrl {
/* Alternative pin configuration for UART0 */
uart0_alt_default: uart0_alt_default {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 5)>,
<NRF_PSEL(UART_RTS, 1, 4)>;
};
grou... | /content/code_sandbox/samples/boards/nrf/dynamic_pinctrl/boards/nrf52840dk_nrf52840.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 264 |
```c
/*
*
*/
#include <zephyr/init.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/pinctrl.h>
/* make sure devices and remap hook are initialized in the correct order */
BUILD_ASSERT((CONFIG_GPIO_INIT_PRIORITY < CONFIG_REMAP_INIT_PRIORITY) &&
(CONFIG_REMAP_INIT_PRIORITY < CONFIG_SERIAL_INIT_PRIOR... | /content/code_sandbox/samples/boards/nrf/dynamic_pinctrl/src/remap.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 393 |
```unknown
CONFIG_ADC=y
``` | /content/code_sandbox/samples/boards/nrf/battery/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 5 |
```yaml
sample:
name: Measure battery voltage
tests:
sample.boards.nrf.battery:
build_only: true
platform_allow:
- particle_xenon
- thingy52/nrf52832
tags: battery
integration_platforms:
- particle_xenon
``` | /content/code_sandbox/samples/boards/nrf/battery/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 65 |
```restructuredtext
.. _boards_nrf_battery:
Battery Voltage Measurement
###########################
Overview
********
This sample demonstrates using Nordic configurations of the Zephyr ADC
infrastructure to measure the voltage of the device power supply. Two
power supply configurations are supported:
* If the boar... | /content/code_sandbox/samples/boards/nrf/battery/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 744 |
```c
/*
*
*/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <zephyr/kernel.h>
#include "battery.h"
/** A discharge curve specific to the power source. */
static const struct battery_level_point levels[] = {
/* "Curve" here eyeballed from captured data for the [Adafruit
* 3.7v 2000 mAh](path_t... | /content/code_sandbox/samples/boards/nrf/battery/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 558 |
```objective-c
/*
*
*/
#ifndef APPLICATION_BATTERY_H_
#define APPLICATION_BATTERY_H_
/** Enable or disable measurement of the battery voltage.
*
* @param enable true to enable, false to disable
*
* @return zero on success, or a negative error code.
*/
int battery_measure_enable(bool enable);
/** Measure the b... | /content/code_sandbox/samples/boards/nrf/battery/src/battery.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 312 |
```restructuredtext
.. _nrfx_prs_sample:
nrfx peripheral resource sharing example
########################################
Overview
********
This sample shows how to use in Zephyr nRF peripherals that share the same ID
and base address. Such peripherals cannot be used simultaneously because they
share certain hardwa... | /content/code_sandbox/samples/boards/nrf/nrfx_prs/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 614 |
```c
/*
*
*/
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <zephyr/kernel.h>
#include <zephyr/init.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/adc.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/logging/log.h>
#include "battery.h"
LOG_MODULE_REGISTER(BATTERY, CONFIG_ADC... | /content/code_sandbox/samples/boards/nrf/battery/src/battery.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,614 |
```yaml
sample:
name: nrfx Peripheral Resource Sharing example
tests:
sample.boards.nrf.nrfx_prs:
platform_allow:
- nrf5340dk/nrf5340/cpuapp
- nrf9160dk/nrf9160
integration_platforms:
- nrf5340dk/nrf5340/cpuapp
- nrf9160dk/nrf9160
tags: nrfx
harness: console
harness_confi... | /content/code_sandbox/samples/boards/nrf/nrfx_prs/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 251 |
```unknown
# This is needed for using SPIM2 and UARTE2 via nrfx drivers and for switching
# between those peripherals, as they share the same ID and hence cannot be used
# simultaneously.
CONFIG_NRFX_SPIM2=y
CONFIG_NRFX_UARTE2=y
CONFIG_NRFX_PRS_BOX_2=y
# This is needed for using another SPIM instance via the Zephyr SP... | /content/code_sandbox/samples/boards/nrf/nrfx_prs/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 93 |
```unknown
&pinctrl {
spi1_default_alt: spi1_default_alt {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 16)>,
<NRF_PSEL(SPIM_MOSI, 0, 17)>;
};
group2 {
psels = <NRF_PSEL(SPIM_MISO, 0, 18)>;
bias-pull-down;
};
};
spi1_sleep_alt: spi1_sleep_alt {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 16)>,
... | /content/code_sandbox/samples/boards/nrf/nrfx_prs/boards/nrf9160dk_nrf9160.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 741 |
```unknown
&pinctrl {
spi1_default_alt: spi1_default_alt {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 25)>,
<NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
group2 {
psels = <NRF_PSEL(SPIM_MISO, 0, 7)>;
bias-pull-down;
};
};
spi1_sleep_alt: spi1_sleep_alt {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 25)>,
<N... | /content/code_sandbox/samples/boards/nrf/nrfx_prs/boards/nrf5340dk_nrf5340_cpuapp.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 679 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.