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
/*
*
*/
/ {
zephyr,user {
/* 0x5 is ADC_COMPB_IN_VDDS (power supply measurement) */
io-channels = <&adc0 0x5>;
};
};
&adc0 {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
channel@5 {
reg = <5>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acqui... | /content/code_sandbox/samples/drivers/adc/adc_dt/boards/cc1352r_sensortag.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 139 |
```restructuredtext
.. _sensor-samples:
Sensor Samples
##############
.. toctree::
:maxdepth: 1
:glob:
**/*
``` | /content/code_sandbox/samples/sensor/sensor.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 32 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_LOG=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_SENSOR_LOG_LEVEL_DBG=y
CONFIG_CBPRINTF_FP_SUPPORT=y
CONFIG_FXOS8700_MODE_ACCEL=y
CONFIG_FXOS8700_TRIGGER_OWN_THREAD=y
``` | /content/code_sandbox/samples/sensor/fxos8700/prj_accel.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 58 |
```unknown
/*
*
*/
/ {
zephyr,user {
/* Reading mulitple pins not possible */
io-channels = <&adc0 0x09>;
io-channel-names = "MB1_AN";
/*
* io-channels = <&adc0 0x0a>;
* io-channel-names = "MB2_AN";
*/
};
};
&adc0 {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
/* MB1 AN */
ch... | /content/code_sandbox/samples/drivers/adc/adc_dt/boards/beagleconnect_freedom.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 526 |
```unknown
CONFIG_FXOS8700_MOTION=y
``` | /content/code_sandbox/samples/sensor/fxos8700/overlay-motion.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 11 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_LOG=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_SENSOR_LOG_LEVEL_DBG=y
CONFIG_FXOS8700_MODE_HYBRID=y
CONFIG_FXOS8700_TEMP=y
CONFIG_FXOS8700_TRIGGER_OWN_THREAD=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/fxos8700/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 69 |
```yaml
common:
harness: sensor
tags: sensors
depends_on:
- i2c
- gpio
sample:
name: FXOS8700 Accelerometer/Magnetometer Sensor
tests:
sample.sensor.fxos8700.hybrid:
platform_allow:
- frdm_k64f
- hexiwear/mk64f12
- warp7/mcimx7d/m4
- frdm_kw41z
- rv32m1_vega/openisa_r... | /content/code_sandbox/samples/sensor/fxos8700/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 378 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/drivers/sensor.h>
#include <stdio.h>
K_SEM_DEFINE(sem, 0, 1); /* starts off "not available" */
#if !defined(CONFIG_FXOS8700_TRIGGER_NONE)
static void trigger_handler(const struct device *dev,
const struct sensor_trigger *trigger)
{
ARG_UNUSED(trigger... | /content/code_sandbox/samples/sensor/fxos8700/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 762 |
```unknown
CONFIG_FXOS8700_TRIGGER_OWN_THREAD=n
CONFIG_FXOS8700_TRIGGER_NONE=y
``` | /content/code_sandbox/samples/sensor/fxos8700/boards/mimxrt1160_evk_mimxrt1166_cm4.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 23 |
```restructuredtext
.. _fxos8700:
FXOS8700 Accelerometer/Magnetometer Sensor
##########################################
Overview
********
This sample application shows how to use the FXOS8700 driver.
The driver supports FXOS8700 accelerometer/magnetometer and
MMA8451Q, MMA8652FC, MMA8653FC accelerometers.
Building ... | /content/code_sandbox/samples/sensor/fxos8700/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,553 |
```unknown
CONFIG_FXOS8700_TRIGGER_OWN_THREAD=n
CONFIG_FXOS8700_TRIGGER_NONE=y
``` | /content/code_sandbox/samples/sensor/fxos8700/boards/mimxrt1170_evk_mimxrt1176_cm7_A.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 23 |
```unknown
CONFIG_FXOS8700_TRIGGER_OWN_THREAD=n
CONFIG_FXOS8700_TRIGGER_NONE=y
``` | /content/code_sandbox/samples/sensor/fxos8700/boards/mimxrt1170_evk_cm4.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 23 |
```unknown
CONFIG_FXOS8700_TRIGGER_OWN_THREAD=n
CONFIG_FXOS8700_TRIGGER_NONE=y
``` | /content/code_sandbox/samples/sensor/fxos8700/boards/mimxrt1024_evk.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 23 |
```unknown
CONFIG_FXOS8700_TRIGGER_OWN_THREAD=n
CONFIG_FXOS8700_TRIGGER_NONE=y
``` | /content/code_sandbox/samples/sensor/fxos8700/boards/mimxrt1170_evk_mimxrt1176_cm4.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 23 |
```unknown
CONFIG_FXOS8700_TRIGGER_OWN_THREAD=n
CONFIG_FXOS8700_TRIGGER_NONE=y
``` | /content/code_sandbox/samples/sensor/fxos8700/boards/twr_ke18f.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 23 |
```unknown
CONFIG_FXOS8700_TRIGGER_OWN_THREAD=n
CONFIG_FXOS8700_TRIGGER_NONE=y
``` | /content/code_sandbox/samples/sensor/fxos8700/boards/mimxrt1160_evk_mimxrt1166_cm7.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 23 |
```restructuredtext
.. _sgp40_sht4x:
SGP40 and SHT4X: High accuracy digital I2C humidity sensor and multipixel gas sensor
####################################################################################
Description
***********
This sample application periodically measures the ambient temperature, humidity
and a ... | /content/code_sandbox/samples/sensor/sgp40_sht4x/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 646 |
```unknown
#
#
#
mainmenu "SGP40/SHT4X sample application"
config APP_USE_COMPENSATION
bool "Use the T/RH compensation feature of the SGP40"
default y
config APP_USE_HEATER
bool "Use the Heater on the SHT4X"
default n
help
Maximum duty cycle for using the heater is 5%
config APP_HEATER_HUMIDITY_THRESH
int "... | /content/code_sandbox/samples/sensor/sgp40_sht4x/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 287 |
```yaml
#
#
#
sample:
name: SGP40 and SHT4X Sensor Sample
tests:
sample.sensor.sgp40_sht4x:
build_only: true
platform_allow: blackpill_f411ce
tags: sensors
``` | /content/code_sandbox/samples/sensor/sgp40_sht4x/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 54 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <stdio.h>
#include <zephyr/drivers/sensor/sgp40.h>
#include <zephyr/drivers/sensor/sht4x.h>
#if !DT_HAS_COMPAT_STATUS_OKAY(sensirion_sgp40)
#error "No sensirion,sgp40 compatible node found in the device t... | /content/code_sandbox/samples/sensor/sgp40_sht4x/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 926 |
```unknown
CONFIG_CBPRINTF_FP_SUPPORT=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_PM_DEVICE=y
CONFIG_LOG=y
CONFIG_SENSOR_LOG_LEVEL_DBG=y
``` | /content/code_sandbox/samples/sensor/sgp40_sht4x/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 34 |
```unknown
CONFIG_PRINTK=y
CONFIG_GPIO=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/bmg160/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 27 |
```yaml
sample:
name: BMG160 Sensor Sample
tests:
sample.sensor.bmg160:
harness: sensor
tags: sensors
depends_on:
- i2c
- gpio
filter: dt_compat_enabled("bosch,bmg160")
``` | /content/code_sandbox/samples/sensor/bmg160/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 58 |
```unknown
/*
*
*/
&i2c1 {
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
sht4x@44 {
status = "okay";
compatible = "sensirion,sht4x";
reg = <0x44>;
repeatability = <2>;
};
sgp40@59 {
status = "okay";
compatible = "sensirion,sgp40";
reg = <0x59>;
enable-selftest;
};
};
``` | /content/code_sandbox/samples/sensor/sgp40_sht4x/boards/blackpill_f411ce.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 115 |
```unknown
/*
*
*/
&i2c0 {
bmg160@68 {
compatible = "bosch,bmg160";
reg = <0x68>;
int-gpios = <&gpioc 6 0>;
};
};
``` | /content/code_sandbox/samples/sensor/bmg160/boards/frdm_k64f.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 53 |
```restructuredtext
.. veaa_x_3:
VEAA-X-3 sample
##########################
Overview
********
A sensor sample that demonstrates how to use a VEAA-X-3 device.
Building and Running
********************
This sample sets the valve setpoint then reads the actual pressure.
This is done continuously. When the maximum sup... | /content/code_sandbox/samples/sensor/veaa_x_3/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 274 |
```unknown
#
#
#
mainmenu "VEAA sample application"
config SAMPLE_USE_SHELL
bool "Use sensor shell and disable loop"
default n
select SHELL
select SENSOR_SHELL
config SAMPLE_LOOP_INTERVAL
int "Sample loop delay in milliseconds"
default 200
config SAMPLE_LOOP_INCREMENT
int "Sample kPa increment per loop"
def... | /content/code_sandbox/samples/sensor/veaa_x_3/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 82 |
```unknown
CONFIG_ADC=y
CONFIG_DAC=y
CONFIG_SENSOR=y
CONFIG_LOG=y
``` | /content/code_sandbox/samples/sensor/veaa_x_3/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 17 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys_clock.h>
#include <stdio.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/drivers/i2c.h>
#define MAX_TEST_TIME 15000
#define SLEEPTIME 300
#if !DT_HAS_COMPAT_STATUS_OKAY(bosch_bmg160)
#err... | /content/code_sandbox/samples/sensor/bmg160/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,393 |
```yaml
sample:
name: VEAA-X-3 sensor sample
tests:
sample.sensor.veaa_x_3:
harness: sensor
tags: sensors
filter: dt_compat_enabled("festo,veaa-x-3")
depends_on: adc dac
``` | /content/code_sandbox/samples/sensor/veaa_x_3/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 59 |
```c
/*
*
*/
#include <zephyr/device.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/drivers/sensor/veaa_x_3.h>
static const struct device *const dev = DEVICE_DT_GET_ONE(festo_veaa_x_3);
int main(void)
{
int rc;
struct sensor_value range, setpoint,... | /content/code_sandbox/samples/sensor/veaa_x_3/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 501 |
```unknown
/*
*
*/
/* spi1 sck conflicts with dac1 channel 3 */
/delete-node/ &spi1;
/ {
test_veaa_x_3: test_veaa_x_3 {
status = "okay";
compatible = "festo,veaa-x-3";
io-channels = <&adc1 3>;
dac = <&dac1>;
dac-channel-id = <2>;
dac-resolution = <12>;
pressure-range-type = "D2";
};
};
&adc1 {
#a... | /content/code_sandbox/samples/sensor/veaa_x_3/boards/nucleo_h563zi.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 197 |
```unknown
#
#
#
CONFIG_SENSOR=y
CONFIG_GPIO=y
# Need float format support
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_REQUIRES_FLOAT_PRINTF=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/dht/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 40 |
```yaml
#
#
#
common:
filter: CONFIG_FULL_LIBC_SUPPORTED
sample:
name: DHT Sensor Sample
tests:
sample.sensor.dht:
build_only: true
platform_allow: nrf52dk/nrf52832
integration_platforms:
- nrf52dk/nrf52832
tags: sensors
``` | /content/code_sandbox/samples/sensor/dht/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 73 |
```restructuredtext
.. _dht:
DHT: Aosong DHT Digital-output Humidity and Temperature Sensor
##############################################################
Description
***********
This sample application periodically (0.5 Hz) measures the ambient
temperature and humidity. The result is written to the console.
Wiring... | /content/code_sandbox/samples/sensor/dht/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 392 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <stdio.h>
static const char *now_str(void)
{
static char buf[16]; /* ...HH:MM:SS.MMM */
uint32_t now = k_uptime_get_32();
unsigned int ms = now % MSEC_PER_SEC;
unsigned int s;
unsigned int min;
unsig... | /content/code_sandbox/samples/sensor/dht/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 414 |
```unknown
/*
*/
/ {
dht22 {
compatible = "aosong,dht";
status = "okay";
dio-gpios = <&gpiob 9 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};
};
``` | /content/code_sandbox/samples/sensor/dht/boards/longan_nano.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 51 |
```restructuredtext
.. _sm351lt:
SM351LT: Magnetoresistive Sensor Example
########################################
Overview
********
This sample application periodically polls an SM351LT magnetoresistive sensor
and displays if a magnet near to the sensor, via the console.
Requirements
************
This sample uses... | /content/code_sandbox/samples/sensor/sm351lt/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 267 |
```unknown
/*
*
*/
/ {
dht22 {
compatible = "aosong,dht";
status = "okay";
dio-gpios = <&gpio0 11 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
dht22;
};
};
``` | /content/code_sandbox/samples/sensor/dht/boards/nrf52dk_nrf52832.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 56 |
```yaml
sample:
name: SM351LT Magnetoresistive Sensor Example
tests:
sample.sensor.sm351lt:
harness: sensor
tags:
- samples
- sensor
depends_on:
- gpio
- sm351lt
``` | /content/code_sandbox/samples/sensor/sm351lt/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 55 |
```c
/*
* Based on code by Nordic Semiconductor ASA
*
*/
#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/sensor.h>
static void fetch_and_display(const struct device *sensor)
{
static unsigned int count;
struct sensor_value mag;
i... | /content/code_sandbox/samples/sensor/sm351lt/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 508 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_GPIO=y
CONFIG_SENSOR=y
``` | /content/code_sandbox/samples/sensor/sm351lt/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 15 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_SENSOR=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/magn_polling/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 18 |
```yaml
sample:
name: Magnetometer Polling Sample
tests:
sample.sensor.magn_polling:
harness: sensor
tags: sensors
filter: dt_alias_exists("magn0")
integration_platforms:
- frdm_k64f # fxos8700
- thingy53/nrf5340/cpuapp # bmm150
- sensortile_box # lis2mdl
... | /content/code_sandbox/samples/sensor/magn_polling/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 126 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/sys/printk.h>
#include <stdio.h>
int main(void)
{
const struct device *const dev = DEVICE_DT_GET(DT_ALIAS(magn0));
struct sensor_value value_x, value_y, value_z;
int ret;
if (!device_is_ready(... | /content/code_sandbox/samples/sensor/magn_polling/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 284 |
```restructuredtext
.. _magn-polling-sample:
BMC150 Magnetometer Sample
##########################
Overview
********
Sample application that periodically reads magnetometer (X, Y, Z) data from
the first available device that implements SENSOR_CHAN_MAGN_* (predefined array
of device names).
``` | /content/code_sandbox/samples/sensor/magn_polling/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 60 |
```unknown
CONFIG_SENSOR=y
CONFIG_MCUX_ACMP_TRIGGER=y
``` | /content/code_sandbox/samples/sensor/mcux_acmp/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 13 |
```restructuredtext
.. _mcux_acmp:
NXP MCUX Analog Comparator (ACMP)
#################################
Overview
********
This sample show how to use the NXP MCUX Analog Comparator (ACMP) driver. The
sample supports the :ref:`twr_ke18f`, :ref:`mimxrt1170_evk`, :ref:`frdm_ke17z`
and :ref:`frdm_ke17z512`.
The input vo... | /content/code_sandbox/samples/sensor/mcux_acmp/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 603 |
```yaml
sample:
description: Demonstration of the NXP MCUX ACMP sensor driver
name: NXP MCUX ACMP sample
common:
platform_allow:
- twr_ke18f
- mimxrt1170_evk/mimxrt1176/cm7
- mimxrt1170_evk/mimxrt1176/cm4
- frdm_ke17z
- frdm_ke17z512
integration_platforms:
- twr_ke18f
tags:
- drive... | /content/code_sandbox/samples/sensor/mcux_acmp/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 211 |
```unknown
/*
*
*/
&pinctrl {
acmp1_default: acmp1_default {
group0 {
pinmux = <&iomuxc_gpio_ad_01_acmp1_in2>;
drive-strength = "high";
bias-pull-up;
slew-rate = "fast";
};
};
};
&acmp1 {
status = "okay";
pinctrl-0 = <&acmp1_default>;
pinctrl-names = "default";
};
``` | /content/code_sandbox/samples/sensor/mcux_acmp/boards/mimxrt1170_evk_mimxrt1176_cm4.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 104 |
```unknown
/*
*
*/
&pinctrl {
acmp0_default: acmp0_default {
group0 {
pinmux = <ACMP0_IN4_PTC3>;
drive-strength = "low";
slew-rate = "slow";
};
};
};
&cmp0 {
status = "okay";
pinctrl-0 = <&acmp0_default>;
pinctrl-names = "default";
};
``` | /content/code_sandbox/samples/sensor/mcux_acmp/boards/frdm_ke17z512.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 91 |
```unknown
/*
*
*/
&pinctrl {
acmp0_default: acmp0_default {
group0 {
pinmux = <ACMP0_IN4_PTC3>;
drive-strength = "low";
slew-rate = "slow";
};
};
};
&cmp0 {
status = "okay";
pinctrl-0 = <&acmp0_default>;
pinctrl-names = "default";
};
``` | /content/code_sandbox/samples/sensor/mcux_acmp/boards/frdm_ke17z.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 91 |
```c
/*
*
*/
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/drivers/sensor/mcux_acmp.h>
#include <zephyr/kernel.h>
#include <stdio.h>
#ifdef CONFIG_BOARD_TWR_KE18F
#define ACMP_NODE DT_NODELABEL(cmp2)
#define ACMP_POSITIVE 5
#define ACMP_NEGATIVE 5
#define ACMP_DAC_VREF 0
#elif def... | /content/code_sandbox/samples/sensor/mcux_acmp/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,144 |
```unknown
/*
*
*/
&pinctrl {
cmp2_default: cmp2_default {
group0 {
pinmux = <ADC0_SE12_PTC14>;
drive-strength = "low";
slew-rate = "slow";
};
};
};
&cmp2 {
status = "okay";
pinctrl-0 = <&cmp2_default>;
pinctrl-names = "default";
};
``` | /content/code_sandbox/samples/sensor/mcux_acmp/boards/twr_ke18f.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 88 |
```restructuredtext
.. _soc_voltage:
SoC voltage sensor measurement
##############################
Overview
********
This sample reads one or more of the various voltage sensors an SoC might have and
displays the results.
Building and Running
********************
In order to run this sample, enable the sensor node... | /content/code_sandbox/samples/sensor/soc_voltage/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 167 |
```unknown
CONFIG_SENSOR=y
CONFIG_ADC=y
CONFIG_PRINTK=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/soc_voltage/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 21 |
```yaml
sample:
description: SoC voltage sensor example
name: soc_voltage
tests:
sample.sensor.soc_voltage:
depends_on: adc
tags: sensors
timeout: 10
filter: dt_alias_exists("volt-sensor0")
harness: console
harness_config:
type: one_line
ordered: true
regex:
- "Se... | /content/code_sandbox/samples/sensor/soc_voltage/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 112 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/sys/printk.h>
#define VOLT_SENSOR_ALIAS(i) DT_ALIAS(_CONCAT(volt_sensor, i))
#define VOLT_SENSOR(i, _) \
IF_ENABLED(DT_NODE... | /content/code_sandbox/samples/sensor/soc_voltage/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 367 |
```unknown
&pinctrl {
pio0_spi0_default: pio0_spi0_default {
/* gpio 13 is used for chip select, not assigned to the PIO */
group1 {
pinmux = <PIO0_P14>, <PIO0_P15>;
};
group2 {
pinmux = <PIO0_P12>;
input-enable;
};
};
};
&pio0 {
status = "okay";
pio0_spi0: pio0_spi0 {
pinctrl-0 = <&pio0_spi0... | /content/code_sandbox/samples/sensor/bme280/rpi_pico_spi_pio.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 302 |
```unknown
/*
*
*/
&pinctrl {
acmp1_default: acmp1_default {
group0 {
pinmux = <&iomuxc_gpio_ad_01_acmp1_in2>;
drive-strength = "high";
bias-pull-up;
slew-rate = "fast";
};
};
};
&acmp1 {
status = "okay";
pinctrl-0 = <&acmp1_default>;
pinctrl-names = "default";
};
``` | /content/code_sandbox/samples/sensor/mcux_acmp/boards/mimxrt1170_evk_mimxrt1176_cm7_A.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 104 |
```unknown
/*
*
*/
/* Example configuration of a BME280 device on an Arduino SPI bus. */
&arduino_spi {
status = "okay";
cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>;
bme280@0 {
compatible = "bosch,bme280";
reg = <0>;
spi-max-frequency = <1000000>; /* conservatively set to 1MHz */
};
};
``` | /content/code_sandbox/samples/sensor/bme280/arduino_spi.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 89 |
```unknown
/*
*
*/
/*
* Example configuration of a BME280 device on an Arduino I2C bus.
*
* Device address 0x77 is assumed. Your device may have a different
* address; check your device documentation if unsure.
*/
&arduino_i2c {
status = "okay";
bme280@77 {
compatible = "bosch,bme280";
reg = <0x77>;
};
}... | /content/code_sandbox/samples/sensor/bme280/arduino_i2c.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 90 |
```unknown
config LOG
default y
config LOG_PRINTK
default y
config SENSOR_LOG_LEVEL
default 4
# Enable SPI and I2C support by default so that the sample works with
# the device connected either way. These defaults can be overridden if
# needed.
config SPI
default y
config I2C
default y
source "Kconfig.zephyr... | /content/code_sandbox/samples/sensor/bme280/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 81 |
```unknown
CONFIG_SENSOR=y
CONFIG_SENSOR_ASYNC_API=y
``` | /content/code_sandbox/samples/sensor/bme280/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 11 |
```yaml
sample:
name: BME280 Sensor sample
tests:
sample.sensor.bme280:
harness: console
tags: sensors
platform_allow:
- adafruit_feather_m0_basic_proto
- rpi_pico
integration_platforms:
- adafruit_feather_m0_basic_proto
harness_config:
type: one_line
regex:
... | /content/code_sandbox/samples/sensor/bme280/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 307 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/drivers/sensor_data_types.h>
#include <zephyr/rtio/rtio.h>
#include <zephyr/dsp/print_format.h>
/*
* Get a device structure from a devicetree node with compatible
*... | /content/code_sandbox/samples/sensor/bme280/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 764 |
```restructuredtext
.. _bme280:
BME280 Humidity and Pressure Sensor
###################################
Overview
********
This sample shows how to use the Zephyr :ref:`sensor` API driver for the
`Bosch BME280`_ environmental sensor.
.. _Bosch BME280:
path_to_url
The sample periodically reads temperature, pressu... | /content/code_sandbox/samples/sensor/bme280/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,792 |
```unknown
/*
*
*/
&feather_i2c {
bme280: bme280@76 {
/* 0x76 - SDO <-> GND */
/* 0x77 - SDO <-> VCC */
compatible = "bosch,bme280";
reg = <0x76>;
};
};
``` | /content/code_sandbox/samples/sensor/bme280/boards/adafruit_feather_m0_basic_proto.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 71 |
```unknown
&spi0 {
status = "okay";
cs-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&spi0_default>;
bme280@0 {
compatible = "bosch,bme280";
reg = <0>;
spi-max-frequency = <1000000>; /* conservatively set to 1MHz */
};
};
``` | /content/code_sandbox/samples/sensor/bme280/boards/rpi_pico.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 82 |
```unknown
/*
*
*/
&i2c1 {
bme280@76 {
compatible = "bosch,bme280";
reg = <0x76>;
status = "okay";
};
};
``` | /content/code_sandbox/samples/sensor/bme280/boards/intel_rpl_p_crb.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 44 |
```unknown
/*
*
*/
&i2c0 {
bme280@76 {
compatible = "bosch,bme280";
reg = <0x76>;
status = "okay";
};
};
``` | /content/code_sandbox/samples/sensor/bme280/boards/intel_adl_crb.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 44 |
```unknown
/*
*
*/
/ {
app {
#address-cells = <1>;
#size-cells = <0>;
vsensor0: sensor@0 {
compatible = "vnd,fake-sensor";
reg = <0>;
friendly-name = "Fake sensor 0";
status = "okay";
};
vsensor1: sensor@1 {
compatible = "vnd,fake-sensor";
reg = <1>;
friendly-name = "Fake sensor 1";... | /content/code_sandbox/samples/sensor/sensor_shell/app.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 125 |
```restructuredtext
.. _sensor_shell_sample:
Sensor Shell Module Sample
##########################
Overview
********
This is a simple shell module to get data from sensors presented in the system.
Building and Running
********************
Build the sample app by choosing the target board that has sensors drivers
en... | /content/code_sandbox/samples/sensor/sensor_shell/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 688 |
```unknown
config SAMPLES_SENSOR_SHELL_FAKE_SENSOR
bool "Enable fake sensor"
help
On boards that do not have a sensor, enabling this will build a fake
sensor that can be interacted with via the sensor shell.
source "Kconfig.zephyr"
``` | /content/code_sandbox/samples/sensor/sensor_shell/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 58 |
```yaml
sample:
name: Shell Sensor Module Sample
common:
tags:
- sensor
- shell
tests:
sample.sensor.shell:
integration_platforms:
- frdm_k64f
# TODO Remove once #63414 is resolved
platform_exclude: gd32l233r_eval
filter: ( CONFIG_UART_CONSOLE and CONFIG_SERIAL_SUPPORT_INTERRUPT )
... | /content/code_sandbox/samples/sensor/sensor_shell/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 185 |
```yaml
description: Fake sensor
include: sensor-device.yaml
compatible: "vnd,fake-sensor"
``` | /content/code_sandbox/samples/sensor/sensor_shell/dts/bindings/vnd,sensor.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 23 |
```python
import logging
from twister_harness import Shell
logger = logging.getLogger(__name__)
def test_sensor_shell_info(shell: Shell):
logger.info('send "sensor info" command')
lines = shell.exec_command('sensor info')
assert any(['device name: sensor@0' in line for line in lines]), 'expected respo... | /content/code_sandbox/samples/sensor/sensor_shell/pytest/test_sensor_shell.py | python | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 722 |
```unknown
CONFIG_SHELL=y
CONFIG_BOOT_BANNER=n
CONFIG_SENSOR=y
CONFIG_SENSOR_SHELL=y
CONFIG_SENSOR_INFO=y
CONFIG_LOG=y
CONFIG_RTIO_CONSUME_SEM=y
``` | /content/code_sandbox/samples/sensor/sensor_shell/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 41 |
```c
/*
*
*/
/*
* This sample app launches a shell. Interact with it using the `sensor` command. See
* `drivers/sensor/sensor_shell.c`. There is nothing to do in the main thread.
*/
int main(void)
{
return 0;
}
``` | /content/code_sandbox/samples/sensor/sensor_shell/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 57 |
```unknown
CONFIG_SPI_RTIO=y
``` | /content/code_sandbox/samples/sensor/sensor_shell/boards/robokit1.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 7 |
```unknown
CONFIG_FXLS8974_TRIGGER_OWN_THREAD=n
CONFIG_FXLS8974_TRIGGER_NONE=y
``` | /content/code_sandbox/samples/sensor/sensor_shell/boards/mimxrt1040_evk.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 23 |
```unknown
CONFIG_BMP388_TRIGGER_NONE=y
``` | /content/code_sandbox/samples/sensor/sensor_shell/boards/mimxrt1062_fmurt6.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 9 |
```objective-c
/*
*
*/
#ifndef ZEPHYR_SAMPLES_SENSOR_SENSOR_SHELL_INCLUDE_TRIGGER_H
#define ZEPHYR_SAMPLES_SENSOR_SENSOR_SHELL_INCLUDE_TRIGGER_H
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
void sensor_shell_data_ready_trigger_handler(const struct device *sensor,
const struct sensor_trig... | /content/code_sandbox/samples/sensor/sensor_shell/include/trigger.h | objective-c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 86 |
```restructuredtext
.. _accel_polling:
Generic 3-Axis accelerometer polling sample
###########################################
Overview
********
This sample application demonstrates how to use 3-Axis accelerometers.
Building and Running
********************
This sample supports up to 10 3-Axis accelerometers. Each... | /content/code_sandbox/samples/sensor/accel_polling/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 504 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_SENSOR=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/accel_polling/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 18 |
```yaml
sample:
name: Accelerometer polling sample
tests:
sample.sensor.accel_polling:
harness: console
tags: sensors
filter: dt_alias_exists("accel0")
harness_config:
type: one_line
regex:
- "^\\s*[0-9A-Za-z_,+-.]*@[0-9A-Fa-f]* \\[m\/s\\^2\\]: \
\\(\\s*-?[0-9\\.]*,... | /content/code_sandbox/samples/sensor/accel_polling/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 388 |
```c
/*
*
*/
#define DT_DRV_COMPAT vnd_fake_sensor
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(fake_sensor);
static int init(const struct device *dev)
{
ARG_UNUSED(dev);
return 0;
}
static int attr_set(const struct device *dev, enum sensor_... | /content/code_sandbox/samples/sensor/sensor_shell/src/fake_sensor.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 631 |
```restructuredtext
.. _fxas21002:
FXAS21002 Gyroscope Sensor
##########################
Overview
********
A sensor application that demonstrates how to use the fxas21002 data ready
interrupt to read gyroscope data synchronously.
Building and Running
********************
This project outputs sensor data to the con... | /content/code_sandbox/samples/sensor/fxas21002/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 296 |
```c
/*
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/sys/util_macro.h>
#include <zephyr/kernel.h>
#define ACCEL_ALIAS(i) DT_ALIAS(_CONCAT(accel, i))
#define ACCELEROMETER_DEVICE(i, _) ... | /content/code_sandbox/samples/sensor/accel_polling/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 715 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_LOG=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_SENSOR_LOG_LEVEL_DBG=y
CONFIG_FXAS21002_TRIGGER_OWN_THREAD=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/fxas21002/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 47 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/drivers/sensor.h>
#include <stdio.h>
K_SEM_DEFINE(sem, 0, 1); /* starts off "not available" */
static void trigger_handler(const struct device *dev,
const struct sensor_trigger *trigger)
{
k_sem_give(&sem);
}
int main(void)
{
struct sensor_value gy... | /content/code_sandbox/samples/sensor/fxas21002/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 310 |
```unknown
/*
*/
&arduino_i2c {
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
ens210: ens210@43 {
compatible = "ams,ens210";
reg = <0x43>;
};
};
``` | /content/code_sandbox/samples/sensor/ens210/app.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 55 |
```yaml
sample:
name: FXAS21002 Gyroscope Sensor Sample
tests:
sample.sensor.fxas21002:
harness: sensor
tags: sensors
platform_allow: hexiwear/mk64f12
integration_platforms:
- hexiwear/mk64f12
``` | /content/code_sandbox/samples/sensor/fxas21002/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 64 |
```restructuredtext
.. _ens210:
ams ens210 Relative Humidity and Temperature Sensor
###################################################
Overview
********
This sample application demonstrates how to use the ams ens210 sensor to
measure the ambient temperature and relative humidity.
Building and Running
*************... | /content/code_sandbox/samples/sensor/ens210/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 229 |
```unknown
CONFIG_I2C=y
CONFIG_SENSOR=y
``` | /content/code_sandbox/samples/sensor/ens210/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 11 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/sys/printk.h>
int main(void)
{
const struct device *const dev = DEVICE_DT_GET_ONE(ams_ens210);
struct sensor_value temperature, humidity;
if (!device_is_ready(dev)) {
printk("Device %s is not... | /content/code_sandbox/samples/sensor/ens210/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 225 |
```yaml
sample:
description: Demonstration of the AMS Temperature and Humidity Sensor driver
name: ENS210 sample
tests:
sample.sensor.ens210:
harness: sensor
tags: samples
depends_on:
- i2c
- arduino_i2c
``` | /content/code_sandbox/samples/sensor/ens210/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 63 |
```unknown
CONFIG_SENSOR=y
CONFIG_PRINTK=y
``` | /content/code_sandbox/samples/sensor/qdec/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 10 |
```restructuredtext
.. _qdec_sensor:
Quadrature Decoder Sensor
#########################
Overview
********
This sample reads the value of the counter which has been configured in
quadrature decoder mode.
It requires:
* an external mechanical encoder
* pin to be properly configured in the device tree
Building and ... | /content/code_sandbox/samples/sensor/qdec/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 391 |
```yaml
sample:
description: Usage quadrature decoder sensor
name: qdec_sensor
common:
tags: sensors
timeout: 5
harness: console
tests:
sample.sensor.qdec_sensor:
filter: dt_alias_exists("qdec0")
harness_config:
type: multi_line
ordered: true
regex:
- "Quadrature decoder s... | /content/code_sandbox/samples/sensor/qdec/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 419 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.