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
# Telink B91 TLSR9518ADK80D
CONFIG_IEEE802154_B91_RANDOM_MAC=n
CONFIG_IEEE802154_B91_MAC4=0x01
CONFIG_IEEE802154_B91_MAC5=0x02
CONFIG_IEEE802154_B91_MAC6=0x03
CONFIG_IEEE802154_B91_MAC7=0x04
``` | /content/code_sandbox/samples/net/openthread/coprocessor/boards/tlsr9518adk80d.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 82 |
```unknown
/*
*
*/
/ {
chosen {
zephyr,ot-uart = &uart0;
zephyr,console = &uart1;
};
};
&uart1 {
status = "okay";
};
``` | /content/code_sandbox/samples/net/openthread/coprocessor/boards/nrf52840dk_nrf52840.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 46 |
```unknown
CONFIG_NET_IPV4=n
CONFIG_NET_CONFIG_NEED_IPV4=n
CONFIG_NET_CONFIG_MY_IPV4_ADDR=""
CONFIG_NET_CONFIG_PEER_IPV4_ADDR=""
CONFIG_NET_CONFIG_MY_IPV4_GW=""
CONFIG_NET_L2_IEEE802154=y
CONFIG_NET_L2_IEEE802154_SHELL=y
CONFIG_NET_L2_IEEE802154_LOG_LEVEL_INF=y
CONFIG_NET_CONFIG_IEEE802154_CHANNEL=26
``` | /content/code_sandbox/samples/net/mdns_responder/overlay-802154.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 87 |
```unknown
/*
*
*/
/ {
chosen {
zephyr,ot-uart = &uart0;
zephyr,console = &uart1;
};
};
&uart0 {
status = "okay";
current-speed = <57600>;
pinctrl-0 = <&uart0_tx_pb2_default &uart0_rx_pb3_default>;
pinctrl-names = "default";
};
&uart1 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart1_tx... | /content/code_sandbox/samples/net/openthread/coprocessor/boards/tlsr9518adk80d.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 130 |
```unknown
CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_QEMU_ETHERNET=y
CONFIG_PCIE=y
#CONFIG_ETHERNET_LOG_LEVEL_DBG=y
``` | /content/code_sandbox/samples/net/mdns_responder/overlay-e1000.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 33 |
```unknown
CONFIG_NET_VLAN=y
# We have one non-vlan interface and two VLAN interfaces
CONFIG_NET_VLAN_COUNT=2
# There will be three network interfaces.
# First ethernet interface will use these settings
CONFIG_NET_CONFIG_MY_IPV6_ADDR="2001:db8::1"
CONFIG_NET_CONFIG_PEER_IPV6_ADDR="2001:db8::2"
CONFIG_NET_CONFIG_MY_I... | /content/code_sandbox/samples/net/mdns_responder/overlay-vlan.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 360 |
```unknown
# Private config options for mDNS responder sample app
mainmenu "Networking mDNS responder sample application"
config NET_SAMPLE_IFACE2_MY_IPV6_ADDR
string "My IPv6 address for second interface"
help
The value depends on your network setup.
config NET_SAMPLE_IFACE2_MY_IPV4_ADDR
string "My IPv4 addr... | /content/code_sandbox/samples/net/mdns_responder/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 342 |
```unknown
CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_QEMU_ETHERNET=y
CONFIG_NET_SLIP_TAP=n
CONFIG_SLIP=n
``` | /content/code_sandbox/samples/net/mdns_responder/overlay-qemu_cortex_m3_eth.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 32 |
```unknown
CONFIG_NETWORKING=y
CONFIG_NET_UDP=y
CONFIG_NET_TCP=y
CONFIG_NET_IPV6=y
CONFIG_NET_IPV4=y
#CONFIG_NET_DHCPV4=y
CONFIG_NET_IF_MAX_IPV6_COUNT=3
CONFIG_NET_IF_MAX_IPV4_COUNT=3
CONFIG_NET_SOCKETS_POLL_MAX=7
CONFIG_NET_HOSTNAME_ENABLE=y
CONFIG_NET_HOSTNAME_UNIQUE=n
CONFIG_NET_HOSTNAME="zephyr"
CONFIG_MDNS_RES... | /content/code_sandbox/samples/net/mdns_responder/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 328 |
```restructuredtext
.. zephyr:code-sample:: mdns-responder
:name: mDNS responder
:relevant-api: net_core dns_sd bsd_sockets
Listen and respond to mDNS queries.
Overview
********
This application will wait mDNS queries for a pre-defined hostname and
respond to them. The default hostname is **zephyr** and it ... | /content/code_sandbox/samples/net/mdns_responder/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 463 |
```yaml
sample:
name: mDNS responder
tests:
sample.net.mdns_responder:
harness: net
platform_allow:
- qemu_x86
- qemu_cortex_m3
integration_platforms:
- qemu_x86
tags:
- net
- mdns
``` | /content/code_sandbox/samples/net/mdns_responder/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 66 |
```c
/*
*
*/
#include <zephyr/logging/log.h>
LOG_MODULE_DECLARE(net_mdns_responder_sample, LOG_LEVEL_DBG);
#include <zephyr/kernel.h>
#include <zephyr/net/ethernet.h>
/* User data for the interface callback */
struct ud {
struct net_if *first;
struct net_if *second;
};
static void iface_cb(struct net_if *iface... | /content/code_sandbox/samples/net/mdns_responder/src/vlan.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 925 |
```c
/* main.c - mDNS responder */
/*
*
*/
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(net_mdns_responder_sample, LOG_LEVEL_DBG);
#include <zephyr/kernel.h>
#include <zephyr/net/net_core.h>
extern void service(void);
#if defined(CONFIG_NET_VLAN)
int init_vlan(void);
#else
static inline int init_vlan(void... | /content/code_sandbox/samples/net/mdns_responder/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 187 |
```c
/*
*
*/
#include <errno.h>
#include <zephyr/net/dns_sd.h>
#include <zephyr/net/socket.h>
#include <zephyr/posix/netinet/in.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(mdns_echo_service, LOG_LEVEL_DBG);
/* A defaul... | /content/code_sandbox/samples/net/mdns_responder/src/service.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,096 |
```restructuredtext
.. zephyr:code-sample:: net-promiscuous-mode
:name: Promiscuous mode
:relevant-api: promiscuous
Enable promiscuous mode on all interfaces and print information about incoming packets.
Overview
********
This application will enable promiscuous mode for every network
interface in the syste... | /content/code_sandbox/samples/net/promiscuous_mode/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 213 |
```yaml
sample:
name: Promiscuous mode sample application
tests:
sample.net.promiscuous_mode:
harness: net
depends_on: netif
tags:
- net
- promisc
``` | /content/code_sandbox/samples/net/promiscuous_mode/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 47 |
```unknown
# Generic networking options
CONFIG_NETWORKING=y
CONFIG_NET_UDP=y
CONFIG_NET_TCP=y
CONFIG_NET_IPV6=y
CONFIG_NET_IPV4=y
#CONFIG_NET_DHCPV4=y
# Enable promiscuous mode support
CONFIG_NET_PROMISCUOUS_MODE=y
# Kernel options
CONFIG_ENTROPY_GENERATOR=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_INIT_STACKS=y
# Logg... | /content/code_sandbox/samples/net/promiscuous_mode/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 283 |
```restructuredtext
.. zephyr:code-sample:: cellular-modem
:name: Cellular modem
Use a cellular modem to communicate with a UDP server.
Overview
********
This sample consists of a simple application which powers on
the modem, brings up the net interface, then sends a packet
with pseudo random data to the endpo... | /content/code_sandbox/samples/net/cellular_modem/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 393 |
```unknown
CONFIG_POSIX_API=y
# Networking
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=y
CONFIG_NET_L2_PPP=y
CONFIG_NET_IPV4=y
CONFIG_NET_UDP=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_CONTEXT_RCVTIMEO=y
# DNS
CONFIG_DNS_RESOLVER=y
CONFIG_NET_L2_PPP_OPTION_DNS_USE=y
# Network management
CONFIG_NET_MGMT=y
CONFIG_NET_MGMT_EVENT=y
C... | /content/code_sandbox/samples/net/cellular_modem/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 205 |
```yaml
sample:
description: Sample for cellular modem
name: Sample for cellular modem using native networking
common:
tags: cellular modem
tests:
sample.net.cellular_modem:
tags: cellular modem
filter: dt_alias_exists("modem")
platform_allow:
- b_u585i_iot02a
integration_platforms:
... | /content/code_sandbox/samples/net/cellular_modem/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 87 |
```c
/*
*
*/
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(net_promisc_sample, LOG_LEVEL_INF);
#include <zephyr/kernel.h>
#include <errno.h>
#include <stdlib.h>
#include <zephyr/shell/shell.h>
#include <zephyr/net/net_core.h>
#include <zephyr/net/promiscuous.h>
#include <zephyr/net/udp.h>
static void net_pk... | /content/code_sandbox/samples/net/promiscuous_mode/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,645 |
```unknown
#include <nrf52840/nrf9160dk_uart1_on_if0_3.dtsi>
/ {
aliases {
modem = &modem;
};
};
&uart1 {
current-speed = <115200>;
hw-flow-control;
modem: modem {
compatible = "nordic,nrf91-slm";
status = "okay";
mdm-power-gpios = <&interface_to_nrf9160 4 GPIO_ACTIVE_LOW>;
};
};
``` | /content/code_sandbox/samples/net/cellular_modem/boards/nrf9160dk_nrf52840.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 104 |
```unknown
/ {
aliases {
modem-uart = &usart2;
modem = &modem;
};
};
&gpioh {
misc_fixed_usart2 {
gpio-hog;
gpios = <13 GPIO_ACTIVE_HIGH>;
output-high;
};
};
&gpdma1 {
status = "okay";
};
/* BG95 */
&usart2 {
pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3 &usart2_rts_pa1 &usart2_cts_pa0>;
pinctrl-names ... | /content/code_sandbox/samples/net/cellular_modem/boards/b_u585i_iot02a.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 236 |
```unknown
CONFIG_UART_ASYNC_API=y
CONFIG_MODEM_CELLULAR_APN="internet"
``` | /content/code_sandbox/samples/net/cellular_modem/boards/rak5010_nrf52840.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 17 |
```unknown
/ {
aliases {
modem = &modem;
};
};
&uart1 {
compatible = "nordic,nrf-uarte";
current-speed = <115200>;
hw-flow-control;
status = "okay";
pinctrl-0 = <&uart1_default_alt>;
modem: modem {
compatible = "nordic,nrf91-slm";
status = "okay";
mdm-power-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
};
};... | /content/code_sandbox/samples/net/cellular_modem/boards/nrf9160dk_nrf9160_ns.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 223 |
```unknown
CONFIG_UART_ASYNC_API=y
CONFIG_UART_1_ASYNC=y
CONFIG_UART_1_INTERRUPT_DRIVEN=n
# Enable HW RX byte counting. This especially matters at higher baud rates.
CONFIG_UART_1_NRF_HW_ASYNC=y
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1
# Align with the Serial LTE Modem (SLM) application.
CONFIG_MODEM_CELLULAR_CMUX_MAX_FRAME... | /content/code_sandbox/samples/net/cellular_modem/boards/nrf9160dk_nrf9160_ns.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 167 |
```unknown
CONFIG_MODEM_HL7800=n
CONFIG_MODEM_CELLULAR_CMUX_MAX_FRAME_SIZE=255
CONFIG_NET_BUF_TX_COUNT=32
``` | /content/code_sandbox/samples/net/cellular_modem/boards/pinnacle_100_dvk.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 31 |
```unknown
/ {
aliases {
modem-uart = &uart1;
modem = &hl7800;
};
};
``` | /content/code_sandbox/samples/net/cellular_modem/boards/pinnacle_100_dvk.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```unknown
CONFIG_UART_ASYNC_API=y
CONFIG_MODEM_CELLULAR_APN="internet"
``` | /content/code_sandbox/samples/net/cellular_modem/boards/b_u585i_iot02a.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 18 |
```unknown
CONFIG_UART_ASYNC_API=y
CONFIG_UART_1_ASYNC=y
CONFIG_UART_1_INTERRUPT_DRIVEN=n
# Enable HW RX byte counting. This especially matters at higher baud rates.
CONFIG_UART_1_NRF_HW_ASYNC=y
CONFIG_UART_1_NRF_HW_ASYNC_TIMER=1
# Align with the Serial LTE Modem (SLM) application.
CONFIG_MODEM_CELLULAR_CMUX_MAX_FRAME... | /content/code_sandbox/samples/net/cellular_modem/boards/nrf9160dk_nrf52840.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 149 |
```unknown
CONFIG_MODEM_HL7800=n
CONFIG_MODEM_CELLULAR_CMUX_MAX_FRAME_SIZE=255
CONFIG_NET_BUF_TX_COUNT=32
``` | /content/code_sandbox/samples/net/cellular_modem/boards/mg100.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 31 |
```unknown
/ {
aliases {
modem-uart = &uart1;
modem = &hl7800;
};
};
``` | /content/code_sandbox/samples/net/cellular_modem/boards/mg100.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```python
import socket
import threading
import select
class TEUDPEcho():
def __init__(self):
self.running = True
self.thread = threading.Thread(target=self._target_)
def start(self):
self.thread.start()
def stop(self):
self.running = False
self.thread.join(1)
... | /content/code_sandbox/samples/net/cellular_modem/server/te_udp_echo.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 213 |
```python
import signal
from te_udp_echo import TEUDPEcho
from te_udp_receive import TEUDPReceive
udp_echo = TEUDPEcho()
udp_receive = TEUDPReceive()
udp_echo.start()
udp_receive.start()
print("started")
def terminate_handler(a, b):
udp_echo.stop()
udp_receive.stop()
print("stopped")
signal.signal(sig... | /content/code_sandbox/samples/net/cellular_modem/server/te.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 91 |
```python
import socket
import threading
import select
import time
import copy
class TEUDPReceiveSession():
def __init__(self, address, timeout = 1):
self.address = address
self.last_packet_received_at = time.monotonic()
self.timeout = timeout
self.packets_received = 0
self... | /content/code_sandbox/samples/net/cellular_modem/server/te_udp_receive.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 676 |
```unknown
CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_QEMU_ETHERNET=y
CONFIG_PCIE=y
#CONFIG_ETHERNET_LOG_LEVEL_DBG=y
``` | /content/code_sandbox/samples/net/dhcpv4_client/overlay-e1000.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 33 |
```restructuredtext
.. zephyr:code-sample:: dhcpv4-client
:name: DHCPv4 client
:relevant-api: dhcpv4 net_mgmt
Start a DHCPv4 client to obtain an IPv4 address from a DHCPv4 server.
Overview
********
This application starts a DHCPv4 client, gets an IPv4 address from the
DHCPv4 server, and prints address, leas... | /content/code_sandbox/samples/net/dhcpv4_client/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 2,138 |
```unknown
CONFIG_NETWORKING=y
CONFIG_NET_IPV6=n
CONFIG_NET_IPV4=y
CONFIG_NET_ARP=y
CONFIG_NET_UDP=y
CONFIG_NET_DHCPV4=y
CONFIG_NET_DHCPV4_OPTION_CALLBACKS=y
CONFIG_DNS_RESOLVER=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_INIT_STACKS=y
CONFIG_NET_MGMT=y
CONFIG_NET_MGMT_EVENT=y
CONFIG_NET_LOG=y
CONFIG_LOG=y
CONFIG_SLIP... | /content/code_sandbox/samples/net/dhcpv4_client/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 104 |
```yaml
sample:
name: DHCP Client
tests:
sample.net.dhcpv4_client:
harness: net
depends_on: netif
platform_exclude:
- native_posix/native/64
- native_posix
tags:
- net
- http
``` | /content/code_sandbox/samples/net/dhcpv4_client/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 62 |
```c
/*
*
*/
#include <zephyr/device.h>
#include <zephyr/kernel.h>
#include <zephyr/net/socket.h>
#include <zephyr/net/net_if.h>
#include <zephyr/net/dns_resolve.h>
#include <zephyr/pm/device.h>
#include <zephyr/pm/device_runtime.h>
#include <string.h>
#include <zephyr/drivers/cellular.h>
#define SAMPLE_TEST_ENDPO... | /content/code_sandbox/samples/net/cellular_modem/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 2,829 |
```c
/* Networking DHCPv4 client */
/*
*
*/
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(net_dhcpv4_client_sample, LOG_LEVEL_DBG);
#include <zephyr/kernel.h>
#include <zephyr/linker/sections.h>
#include <errno.h>
#include <stdio.h>
#include <zephyr/net/net_if.h>
#include <zephyr/net/net_core.h>
#include <z... | /content/code_sandbox/samples/net/dhcpv4_client/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 701 |
```unknown
ð {
status = "okay";
};
&phy {
status = "okay";
};
&mdio {
status = "okay";
};
``` | /content/code_sandbox/samples/net/dhcpv4_client/boards/fvp_base_revc_2xaemv8a.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 29 |
```unknown
CONFIG_NET_L2_ETHERNET=y
CONFIG_MDIO=y
CONFIG_MDIO_SHELL=n
CONFIG_MDIO_INIT_PRIORITY=81
CONFIG_PHY_INIT_PRIORITY=82
``` | /content/code_sandbox/samples/net/dhcpv4_client/boards/fvp_base_revc_2xaemv8a.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 37 |
```unknown
ð {
status = "okay";
};
&phy {
status = "okay";
};
&mdio {
status = "okay";
};
``` | /content/code_sandbox/samples/net/dhcpv4_client/boards/fvp_baser_aemv8r.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 29 |
```unknown
CONFIG_NET_L2_ETHERNET=y
CONFIG_MDIO=y
CONFIG_MDIO_SHELL=n
CONFIG_MDIO_INIT_PRIORITY=81
CONFIG_PHY_INIT_PRIORITY=82
``` | /content/code_sandbox/samples/net/dhcpv4_client/boards/fvp_baser_aemv8r.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 37 |
```restructuredtext
.. _userspace-samples:
Userspace Samples
#################
.. toctree::
:maxdepth: 1
:glob:
**/*
``` | /content/code_sandbox/samples/userspace/index.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 34 |
```unknown
CONFIG_TEST=y
CONFIG_USERSPACE=y
``` | /content/code_sandbox/samples/userspace/shared_mem/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 10 |
```yaml
sample:
description: userspace memory domain protection
example application
name: protected memory
common:
integration_platforms:
- mps2/an385
tags: userspace
harness: console
harness_config:
type: one_line
regex:
- "MSG"
tests:
sample.kernel.memory_protection.shared_mem:
... | /content/code_sandbox/samples/userspace/shared_mem/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 152 |
```restructuredtext
.. _userspace_protected_memory:
Userspace Protected Memory
##########################
Overview
********
This sample is an example of running multiple threads assigned
unique memory domains with protected partitions. The
application uses memory partitioning with a sample algorithm
simulating an en... | /content/code_sandbox/samples/userspace/shared_mem/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 505 |
```objective-c
/* enc.h */
/*
*/
#ifndef ENC_H
#define ENC_H
#include <zephyr/sys/printk.h>
#define WHEEL_SIZE 26
#define IMOD(a, b) ((a + b) % WHEEL_SIZE)
#ifndef BYTE
#define BYTE unsigned char
#endif
void update_wheel_index(void);
char index_to_char(short i);
short char_to_index(char c);
int calc_rev_wheel(B... | /content/code_sandbox/samples/userspace/shared_mem/src/enc.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 178 |
```c
/*
* enc.c
*/
/*
*/
/*
* This is a model of the enigma hardware as remembered from
* a description read around ten years prior. The model has
* not been tested or validated as cryptographically secure.
* Furthermore the author intentionally did not validate the
* model against published descriptions of ... | /content/code_sandbox/samples/userspace/shared_mem/src/enc.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,127 |
```objective-c
/* main.h */
/*
*/
#ifndef MAIN_H
#define MAIN_H
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/kernel_structs.h>
#include <string.h>
#include <stdlib.h>
#include <zephyr/app_memory/app_memdomain.h>
#include <zephyr/sys/util.h>
#if defined(CONFIG_ARC)
#include <zephyr/a... | /content/code_sandbox/samples/userspace/shared_mem/src/main.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 549 |
```unknown
/*
*
*/
&smu1 {
smu1_data: memory@0 {
/delete-property/ zephyr,memory-attr;
};
};
&smu2 {
smu2_data: memory@0 {
/delete-property/ zephyr,memory-attr;
};
};
``` | /content/code_sandbox/samples/userspace/shared_mem/boards/frdm_rw612.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 64 |
```c
/* main.c */
/*
*/
/*
*
* Basic example of userspace thread protected memory
*
* NOTE: The encryption algorithm is unverified and
* based on a 1930's era piece of hardware.
* DO NOT USE THIS CODE FOR SECURITY
*
*/
#include <zephyr/sys/__assert.h>
#include <zephyr/sys/libc-hooks.h> /* for z_libc_p... | /content/code_sandbox/samples/userspace/shared_mem/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 2,403 |
```unknown
/*
*
*/
/*
* Disable quadspi MPU region for testing
* on this stm32f7 target
* else one region is missing among 8 MPU regions
*/
/delete-node/ &quadspi_memory;
``` | /content/code_sandbox/samples/userspace/shared_mem/boards/nucleo_f746zg.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 44 |
```unknown
/*
*
*/
&sramx {
status = "disabled";
};
``` | /content/code_sandbox/samples/userspace/shared_mem/boards/frdm_mcxn236.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 14 |
```unknown
/*
*
*/
&smu1 {
smu1_data: memory@0 {
/delete-property/ zephyr,memory-attr;
};
};
&smu2 {
smu2_data: memory@0 {
/delete-property/ zephyr,memory-attr;
};
};
``` | /content/code_sandbox/samples/userspace/shared_mem/boards/rd_rw612_bga.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 64 |
```restructuredtext
.. _syscall_perf:
Syscall performances
====================
The goal of this sample application is to measure the performance loss when a
user thread has to go through a system call compared to a supervisor thread that
calls the function directly.
Overview
********
This application creates a su... | /content/code_sandbox/samples/userspace/syscall_perf/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 218 |
```unknown
CONFIG_USERSPACE=y
CONFIG_ASSERT=y
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=0
``` | /content/code_sandbox/samples/userspace/syscall_perf/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 41 |
```yaml
sample:
description: syscall performances sample
name: syscall performances
common:
tags: userspace
harness: console
harness_config:
type: one_line
regex:
- "User thread"
tests:
sample.syscall_performances:
filter: CONFIG_ARCH_HAS_USERSPACE
arch_allow: riscv
integration_pla... | /content/code_sandbox/samples/userspace/syscall_perf/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 89 |
```objective-c
/*
*
*/
#ifndef THREAD_DEF_H
#define THREAD_DEF_H
#include <zephyr/kernel.h>
#define THREAD_STACKSIZE 2048
struct k_thread user_thread;
K_THREAD_STACK_DEFINE(user_stack, THREAD_STACKSIZE);
void supervisor_thread_function(void *p1, void *p2, void *p3);
struct k_thread supervisor_thread;
K_THREAD_ST... | /content/code_sandbox/samples/userspace/syscall_perf/src/thread_def.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 110 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <stdio.h>
#include "thread_def.h"
int main(void)
{
printf("Main Thread started; %s\n", CONFIG_BOARD);
k_thread_create(&supervisor_thread, supervisor_stack, THREAD_STACKSIZE,
supervisor_thread_function, NULL, NULL, NULL,
-1, K_INHERIT_PERMS, K_NO_WAIT);
k_... | /content/code_sandbox/samples/userspace/syscall_perf/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 143 |
```unknown
/*
*
*/
/*
* Disable quadspi MPU region for testing
* on this stm32f7 target.
* Otherwise one region will be missing from the 8 MPU regions
*/
/delete-node/ &quadspi_memory;
``` | /content/code_sandbox/samples/userspace/shared_mem/boards/nucleo_f756zg.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 46 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <stdio.h>
/*
* 0xB00 is CSR mcycle
* 0xB02 is CSR minstret
*/
void supervisor_thread_function(void *p1, void *p2, void *p3)
{
register unsigned long cycle_before, cycle_count;
register unsigned long inst_before, inst_count;
k_tid_t thread;
printf("Supervisor ... | /content/code_sandbox/samples/userspace/syscall_perf/src/test_supervisor.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 284 |
```restructuredtext
.. _hello_world_user:
Hello World
###########
Overview
********
A simple Hello World example that can be used with any supported board and
prints 'Hello World from UserSpace!' to the console.
If unavailable or unconfigured then 'Hello World from privileged mode.'
is printed instead.
This applicat... | /content/code_sandbox/samples/userspace/hello_world_user/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 198 |
```unknown
CONFIG_USERSPACE=y
CONFIG_ASSERT=y
``` | /content/code_sandbox/samples/userspace/hello_world_user/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 10 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <stdio.h>
/*
* 0xC00 is CSR cycle
* 0xC02 is CSR instret
*/
void user_thread_function(void *p1, void *p2, void *p3)
{
register unsigned long cycle_before, cycle_count;
register unsigned long inst_before, inst_count;
k_tid_t thread;
printf("User thread started... | /content/code_sandbox/samples/userspace/syscall_perf/src/test_user.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 281 |
```yaml
sample:
description: Hello World sample, the simplest userspace
Zephyr application
name: hello world user
common:
integration_platforms:
- mps2/an385
tags: introduction
harness: console
harness_config:
type: one_line
regex:
- "Hello World from UserSpace! (.*)"
tests:
sample.h... | /content/code_sandbox/samples/userspace/hello_world_user/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 <stdio.h>
#define USER_STACKSIZE 2048
#ifndef CONFIG_USERSPACE
#error This sample requires CONFIG_USERSPACE.
#endif
struct k_thread user_thread;
K_THREAD_STACK_DEFINE(user_stack, USER_STACKSIZE);
static void user_function(void *p1, void *p2, void *p3)
{
printf("He... | /content/code_sandbox/samples/userspace/hello_world_user/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 173 |
```restructuredtext
.. _userspace_prod_consumer:
Producer/consumer
=================
This is a sample application that exercises some user mode concepts.
Overview
********
Consider a "sample driver" which gets incoming data from some unknown source
and generates interrupts with pointers to this data. The applicatio... | /content/code_sandbox/samples/userspace/prod_consumer/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,059 |
```unknown
CONFIG_USERSPACE=y
CONFIG_HW_STACK_PROTECTION=y
CONFIG_APPLICATION_DEFINED_SYSCALL=y
CONFIG_ASSERT=y
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
``` | /content/code_sandbox/samples/userspace/prod_consumer/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 35 |
```c
/*
*
*/
#include "app_shared.h"
/* Define the shared partition, which will contain a memory region that
* will be accessible by both applications A and B.
*/
K_APPMEM_PARTITION_DEFINE(shared_partition);
/* Define a memory pool to place in the shared area.
*/
K_APP_DMEM(shared_partition) struct sys_heap sha... | /content/code_sandbox/samples/userspace/prod_consumer/src/app_shared.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 116 |
```objective-c
/*
*
*/
#ifndef APP_SHARED_H
#define APP_SHARED_H
#include <zephyr/kernel.h>
#include <zephyr/app_memory/app_memdomain.h>
#include <zephyr/sys/sys_heap.h>
#include "sample_driver.h"
#define BLK_SIZE (SAMPLE_DRIVER_MSG_SIZE + sizeof(void *))
#define HEAP_BYTES (BLK_SIZE * 16)
extern struct k_mem_p... | /content/code_sandbox/samples/userspace/prod_consumer/src/app_shared.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 129 |
```objective-c
/*
*
*/
#ifndef PROD_CONSUMER_APP_A_H
#define PROD_CONSUMER_APP_A_H
#include <zephyr/kernel.h>
#include <zephyr/app_memory/app_memdomain.h>
void app_a_entry(void *p1, void *p2, void *p3);
extern struct k_mem_partition app_a_partition;
#define APP_A_DATA K_APP_DMEM(app_a_partition)
#define APP_A_BSS... | /content/code_sandbox/samples/userspace/prod_consumer/src/app_a.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 105 |
```c
/*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/sys/libc-hooks.h>
#include <zephyr/logging/log.h>
#include "app_shared.h"
#include "app_b.h"
LOG_MODULE_REGISTER(app_b);
/* Resource pool for allocations made by the kernel on behalf of system
* calls. Needed for k_queue_alloc_appen... | /content/code_sandbox/samples/userspace/prod_consumer/src/app_b.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 825 |
```yaml
sample:
description: userspace producer-consumer example
name: producer-consumer
common:
integration_platforms:
- mps2/an385
tags: userspace
harness: console
harness_config:
type: one_line
regex:
- "SUCCESS"
tests:
sample.userspace.prod_consumer:
filter: CONFIG_ARCH_HAS_USERS... | /content/code_sandbox/samples/userspace/prod_consumer/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 103 |
```objective-c
/*
*
*/
#ifndef ZEPHYR_FAKE_DRIVER_H
#define ZEPHYR_FAKE_DRIVER_H
#include <zephyr/device.h>
#define SAMPLE_DRIVER_NAME_0 "SAMPLE_DRIVER_0"
#define SAMPLE_DRIVER_MSG_SIZE 128
typedef void (*sample_driver_callback_t)(const struct device *dev,
void *context, void *data);
typedef int (*sample_d... | /content/code_sandbox/samples/userspace/prod_consumer/src/sample_driver.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 544 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/libc-hooks.h>
#include <zephyr/logging/log.h>
#include "app_shared.h"
#include "app_a.h"
#include "app_b.h"
#define APP_A_STACKSIZE 2048
#define APP_B_STACKSIZE 2048
LOG_MODULE_REGISTER(app_main);
/* Define a thread for t... | /content/code_sandbox/samples/userspace/prod_consumer/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 438 |
```objective-c
/*
*
*/
#ifndef PROD_CONSUMER_APP_B_H
#define PROD_CONSUMER_APP_B_H
#include <zephyr/kernel.h>
#include <zephyr/app_memory/app_memdomain.h>
void app_b_entry(void *p1, void *p2, void *p3);
extern struct k_mem_partition app_b_partition;
#define APP_B_DATA K_APP_DMEM(app_b_partition)
#define APP_B_BSS... | /content/code_sandbox/samples/userspace/prod_consumer/src/app_b.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 105 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/internal/syscall_handler.h>
#include "sample_driver.h"
int z_vrfy_sample_driver_state_set(const struct device *dev, bool active)
{
if (K_SYSCALL_DRIVER_SAMPLE(dev, state_set)) {
return -EINVAL;
}
return z_impl_sample_driver_state_set(dev, active);
}
#i... | /content/code_sandbox/samples/userspace/prod_consumer/src/sample_driver_handlers.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 180 |
```c
/*
*
*/
#include <zephyr/internal/syscall_handler.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(app_syscall);
/* Implementation of magic_syscall() which is a system call just for this
* application, not part of the kernel codebase.
*
* It's trivial, update the supplied cookie value by 1, only if i... | /content/code_sandbox/samples/userspace/prod_consumer/src/app_syscall.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 342 |
```objective-c
/*
*/
#ifndef APP_SYSCALL_H
#define APP_SYSCALL_H
__syscall int magic_syscall(unsigned int *cookie);
#include <zephyr/syscalls/app_syscall.h>
#endif /* MAGIC_SYSCALL_H */
``` | /content/code_sandbox/samples/userspace/prod_consumer/src/app_syscall.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 45 |
```c
/*
*
*/
#include "sample_driver.h"
#include <string.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(sample_driver);
/*
* Fake sample driver for demonstration purposes
*
* This is fake driver for demonstration purposes, showing how an application
* can make system calls to... | /content/code_sandbox/samples/userspace/prod_consumer/src/sample_driver_foo.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 655 |
```unknown
/*
*
*/
&smu1 {
smu1_data: memory@0 {
/delete-property/ zephyr,memory-attr;
};
};
&smu2 {
smu2_data: memory@0 {
/delete-property/ zephyr,memory-attr;
};
};
``` | /content/code_sandbox/samples/userspace/prod_consumer/boards/frdm_rw612.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 64 |
```unknown
/*
*
*/
&smu1 {
smu1_data: memory@0 {
/delete-property/ zephyr,memory-attr;
};
};
&smu2 {
smu2_data: memory@0 {
/delete-property/ zephyr,memory-attr;
};
};
``` | /content/code_sandbox/samples/userspace/prod_consumer/boards/rd_rw612_bga.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 64 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/sys/libc-hooks.h>
#include <zephyr/logging/log.h>
#include "sample_driver.h"
#include "app_shared.h"
#include "app_a.h"
#include "app_syscall.h"
LOG_MODULE_REGISTER(app_a);
#define MAX_MSGS 8
/* Resource pool for allocations made... | /content/code_sandbox/samples/userspace/prod_consumer/src/app_a.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,894 |
```restructuredtext
.. _board-specific-samples:
Board-specific samples
######################
.. toctree::
:maxdepth: 1
:glob:
**/*
``` | /content/code_sandbox/samples/boards/boards.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 35 |
```unknown
mainmenu "MIMXRT1060_EVK SYSTEM_OFF demo"
source "Kconfig.zephyr"
``` | /content/code_sandbox/samples/boards/mimxrt1060_evk/system_off/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 25 |
```restructuredtext
.. _mimxrt1060_evk-system-off-sample:
RT1060 System Off demo
######################
Overview
********
This sample can be used for basic power measurement and as an example of
soft off on NXP i.MX RT platforms. The functional behavior is:
* Busy-wait for 2 seconds
* Turn the system off after enab... | /content/code_sandbox/samples/boards/mimxrt1060_evk/system_off/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 399 |
```unknown
CONFIG_PM=y
# Enable the SNVS RTC
CONFIG_COUNTER=y
CONFIG_COUNTER_MCUX_SNVS=y
CONFIG_COUNTER_MCUX_SNVS_SRTC=y
CONFIG_COUNTER_MCUX_SNVS_SRTC_WAKE=y
``` | /content/code_sandbox/samples/boards/mimxrt1060_evk/system_off/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 45 |
```yaml
sample:
name: Low Power State Sample for mimxrt1060_evk
common:
tags: power
tests:
sample.boards.mimxrt1060_evk.system_off:
build_only: true
platform_allow:
- mimxrt1060_evk
- mimxrt1060_evkb
integration_platforms:
- mimxrt1060_evk
``` | /content/code_sandbox/samples/boards/mimxrt1060_evk/system_off/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 88 |
```unknown
/*
*
*/
/ {
};
&symcr {
status = "okay";
};
&rom_api {
status = "okay";
};
``` | /content/code_sandbox/samples/boards/mec172xevb_assy6906/rom_api/mec172xevb_assy6906.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 27 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_CRYPTO=y
CONFIG_IDLE_STACK_SIZE=512
``` | /content/code_sandbox/samples/boards/mec172xevb_assy6906/rom_api/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 18 |
```yaml
sample:
description: MEC172x EVB ROM API sample application
name: rom_api
common:
tags: crypto
harness: console
harness_config:
type: multi_line
regex:
- "Test Zephyr crypto hash API for multiblock plus remainder"
- "Test Zephyr crypto hash API for multiblock plus remainder returne... | /content/code_sandbox/samples/boards/mec172xevb_assy6906/rom_api/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 218 |
```c
/*
*
*/
#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/counter.h>
#include <zephyr/pm/pm.h>
#include <zephyr/pm/policy.h>
#define BUSY_WAIT_S 2U
#define SLEEP_S 2U
#define SOFT_OFF_S 10U
#define SW0_NODE DT_ALIAS(sw0)
#if !DT_... | /content/code_sandbox/samples/boards/mimxrt1060_evk/system_off/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 813 |
```unknown
/*
*
*/
/ {
};
&pinctrl {
shd_cs0_n_gpio055_sleep: shd_cs0_n_gpio055_sleep {
pinmux = < MCHP_XEC_PINMUX(055, MCHP_AF2) >;
low-power-enable;
};
shd_clk_gpio056_sleep: shd_clk_gpio056_sleep {
pinmux = < MCHP_XEC_PINMUX(056, MCHP_AF2) >;
low-power-enable;
};
shd_io0_gpio223_sleep: shd_io0_gpio2... | /content/code_sandbox/samples/boards/mec172xevb_assy6906/qmspi_ldma/mec172xevb_assy6906.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 646 |
```unknown
# Enable config log
CONFIG_STDOUT_CONSOLE=y
CONFIG_SPI=y
CONFIG_SPI_EXTENDED_MODES=y
CONFIG_SPI_ASYNC=y
CONFIG_PM=n
CONFIG_DEBUG=y
``` | /content/code_sandbox/samples/boards/mec172xevb_assy6906/qmspi_ldma/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```yaml
sample:
description: mec172xevb_assy6906 QMSPI-LDMA testing
name: mec172xevb_assy9606 test
tests:
sample.board.mec172xevb_assy6906.qmspi_ldma:
harness: spi
platform_allow: mec172xevb_assy6906
tags: spi
depends_on:
- spi
- gpio
``` | /content/code_sandbox/samples/boards/mec172xevb_assy6906/qmspi_ldma/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 93 |
```c
/*
*
*/
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <soc.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/spi.h>
#define W25Q128_JEDEC_ID 0x001840efU
#define W25Q128JV_JEDEC_ID 0x001870efU
#define SST26VF016B_JEDEC_ID 0x004126bfU
#define SPI_FLAS... | /content/code_sandbox/samples/boards/mec172xevb_assy6906/qmspi_ldma/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 5,605 |
```unknown
# nothing here
``` | /content/code_sandbox/samples/boards/rpi_pico/uart_pio/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.