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
/*
*/
/ {
aliases {
qdec0 = &qdec130;
qenca = &phase_a;
qencb = &phase_b;
};
encoder-emulate {
compatible = "gpio-leds";
phase_a: phase_a {
gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
};
phase_b: phase_b {
gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
};
};
};
&pinctrl {
qdec_pinctrl: qdec_pin... | /content/code_sandbox/samples/sensor/qdec/boards/nrf54h20dk_nrf54h20_cpuapp.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 233 |
```unknown
/*
*
*/
/ {
aliases {
qdec0 = &pcnt;
};
};
&pinctrl {
pcnt_default: pcnt_default {
group1 {
pinmux = <PCNT0_CH0SIG_GPIO35>,
<PCNT0_CH0CTRL_GPIO36>;
bias-pull-up;
};
};
};
&pcnt {
pinctrl-0 = <&pcnt_default>;
pinctrl-names = "default";
status = "okay";
#address-cells = <1>;
#size... | /content/code_sandbox/samples/sensor/qdec/boards/esp32s3_luatos_core_procpu.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 212 |
```unknown
/*
*
*/
/ {
aliases {
qdec0 = &qdec0;
};
};
&qdec0 {
status = "okay";
};
``` | /content/code_sandbox/samples/sensor/qdec/boards/sam_e70_xplained_same70q21.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 32 |
```unknown
/*
*/
/ {
aliases {
qdec0 = &qdec0;
qenca = &phase_a;
qencb = &phase_b;
};
encoder-emulate {
compatible = "gpio-leds";
phase_a: phase_a {
/* Arduino D1 */
gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
};
phase_b: phase_b {
/* Arduino D3 */
gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
};
};
... | /content/code_sandbox/samples/sensor/qdec/boards/nrf52840dk_nrf52840.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 245 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/sys/printk.h>
#define QUAD_ENC_EMUL_ENABLED \
DT_NODE_EXISTS(DT_ALIAS(qenca)) && DT_NODE_EXISTS(DT_ALIAS(qencb))
#if QUAD_ENC_EMUL_ENABLED
#include <zephyr/drivers/gpio.h>
#define QUAD_ENC_EMUL... | /content/code_sandbox/samples/sensor/qdec/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 674 |
```unknown
/*
*/
/ {
aliases {
qdec0 = &qdec20;
qenca = &phase_a;
qencb = &phase_b;
};
encoder-emulate {
compatible = "gpio-leds";
phase_a: phase_a {
gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
};
phase_b: phase_b {
gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
};
};
};
&pinctrl {
qdec_pinctrl: qdec_pin... | /content/code_sandbox/samples/sensor/qdec/boards/nrf54l15pdk_nrf54l15_cpuapp.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 223 |
```unknown
/*
*
*/
/ {
aliases {
qdec0 = &pcnt;
};
};
&pinctrl {
pcnt_default: pcnt_default {
group1 {
pinmux = <PCNT0_CH0SIG_GPIO35>,
<PCNT0_CH0CTRL_GPIO36>;
bias-pull-up;
};
};
};
&pcnt {
pinctrl-0 = <&pcnt_default>;
pinctrl-names = "default";
status = "okay";
#address-cells = <1>;
#size... | /content/code_sandbox/samples/sensor/qdec/boards/esp32s3_luatos_core_procpu_usb.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 212 |
```unknown
/*
*
*
* Application overlay for creating quadrature decoder device instance
*/
/ {
aliases {
qdec0 = &qdec1;
qenca = &phase_a;
qencb = &phase_b;
/delete-property/ magn0;
/delete-property/ accel0;
};
/* Wire J22 3 <-> 5 and J22 4 <-> 6 */
encoder-emulate {
compatible = "gpio-leds";
ph... | /content/code_sandbox/samples/sensor/qdec/boards/mimxrt1050_evk.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 351 |
```unknown
/*
*
*
* Application overlay for creating quadrature decoder device instance
*/
/ {
aliases {
qdec0 = &qdec;
};
};
&timers3 {
status = "okay";
qdec: qdec {
status = "okay";
pinctrl-0 = <&tim3_ch1_pa6 &tim3_ch2_pa7>;
pinctrl-names = "default";
st,input-polarity-inverted;
st,input-filter... | /content/code_sandbox/samples/sensor/qdec/boards/nucleo_f401re.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 122 |
```unknown
/*
*
*/
/ {
aliases {
qdec0 = &qdec0;
};
};
&qdec0 {
status = "okay";
};
``` | /content/code_sandbox/samples/sensor/qdec/boards/sam_e70_xplained_same70q21b.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 32 |
```unknown
/*
*
*/
/ {
aliases {
qdec0 = &pcnt;
};
};
&pinctrl {
pcnt_default: pcnt_default {
group1 {
pinmux = <PCNT0_CH0SIG_GPIO35>,
<PCNT0_CH0CTRL_GPIO36>;
bias-pull-up;
};
};
};
&pcnt {
pinctrl-0 = <&pcnt_default>;
pinctrl-names = "default";
status = "okay";
#address-cells = <1>;
#size... | /content/code_sandbox/samples/sensor/qdec/boards/esp32s3_devkitm_procpu.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 212 |
```unknown
/*
*/
/ {
aliases {
qdec0 = &qdec1;
qenca = &phase_a;
qencb = &phase_b;
};
encoder-emulate {
compatible = "gpio-leds";
phase_a: phase_a {
/* Arduino A1 */
gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
};
phase_b: phase_b {
/* Arduino A3 */
gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
};
};
... | /content/code_sandbox/samples/sensor/qdec/boards/nrf5340dk_nrf5340_cpuapp.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 245 |
```restructuredtext
.. _fdc2x1x:
FDC2X1X: Capacitance-to-Digital Converter
#########################################
Overview
********
This sample application periodically reads frequency and capacitance data from the
FDC2X1X sensor in polling mode or optionally with data ready trigger. It is able
to read the 12-Bit... | /content/code_sandbox/samples/sensor/fdc2x1x/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,115 |
```unknown
CONFIG_LOG=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_PM_DEVICE=n
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_REQUIRES_FLOAT_PRINTF=y
CONFIG_FDC2X1X_TRIGGER_GLOBAL_THREAD=n
``` | /content/code_sandbox/samples/sensor/fdc2x1x/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 47 |
```yaml
sample:
name: fdc2x1x sample
description: FDC2X1X sample application
tests:
sample.sensor.fdc2x1x:
harness: sensor
tags: sensors
platform_allow: nrf9160dk/nrf9160
integration_platforms:
- nrf9160dk/nrf9160
``` | /content/code_sandbox/samples/sensor/fdc2x1x/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 79 |
```unknown
/*
*
*/
&i2c2 {
clock-frequency = <I2C_BITRATE_FAST>;
fdc2x1x@2A {
compatible = "ti,fdc2x1x";
reg = <0x2A>;
sd-gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
intb-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
autoscan;
deglitch = <5>;
fref = <43360>;
channel_0 {
rcount = <7499>;
settlecount = <48>... | /content/code_sandbox/samples/sensor/fdc2x1x/boards/nrf9160dk_nrf9160.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 224 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/sys/util.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/drivers/sensor/fdc2x1x.h>
#include <stdio.h>
#define CH_BUF_INIT(m) {},
K_SEM_DEFINE(sem, 0, 1);
#ifdef CONFIG_FDC2X1X_TRIGGER
static void trigger_handler(co... | /content/code_sandbox/samples/sensor/fdc2x1x/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 881 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_SENSOR=y
``` | /content/code_sandbox/samples/sensor/mhz19b/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 22 |
```yaml
#
#
sample:
name: MH-Z19B CO2 sensor
tests:
sample.sensor.mhz19b:
build_only: true
harness: sensor
tags: sensors
depends_on: serial
filter: dt_compat_enabled("winsen,mhz19b")
``` | /content/code_sandbox/samples/sensor/mhz19b/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 62 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/sys/printk.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/drivers/sensor/mhz19b.h>
int main(void)
{
const struct device *dev;
struct sensor_value val;
int ret;
printk("Winsen MH-Z19B CO2 sensor application\n");
dev = DEVICE_DT_GET_ONE(winsen_mh... | /content/code_sandbox/samples/sensor/mhz19b/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 500 |
```restructuredtext
.. _mhz19b-sample:
MH-Z19B: CO2 Sensor Sample
##########################
Description
***********
This sample application demonstrate the configurations of the MH-Z19B CO2
sensor, then periodically reads CO2 data from the sensor. The driver
currently only support uart interrupt APIs.
Requirements... | /content/code_sandbox/samples/sensor/mhz19b/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 343 |
```restructuredtext
.. _hts221:
HTS221: Temperature and Humidity Monitor
########################################
Overview
********
This sample periodically reads temperature and humidity from the HTS221
Temperature & Humidity Sensor and displays it on the console
Requirements
************
This sample uses the HTS... | /content/code_sandbox/samples/sensor/hts221/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 243 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/hts221/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 24 |
```unknown
/*
*
*/
&usart1 {
current-speed = <9600>;
mhz19b {
compatible = "winsen,mhz19b";
maximum-range = <10000>;
abc-on;
};
};
``` | /content/code_sandbox/samples/sensor/mhz19b/boards/nucleo_g0b1re.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 50 |
```yaml
sample:
name: HTS221 Temperature and Humidity Monitor
common:
harness: console
integration_platforms:
- disco_l475_iot1
filter: dt_compat_enabled("st,hts221")
tags: sensors
depends_on:
- i2c
- hts221
harness_config:
type: multi_line
ordered: true
regex:
- "Observation... | /content/code_sandbox/samples/sensor/hts221/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 175 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <stdio.h>
#include <zephyr/sys/util.h>
static void process_sample(const struct device *dev)
{
static unsigned int obs;
struct sensor_value temp, hum;
if (sensor_sample_fetch(dev) < 0) {
printf("Sensor... | /content/code_sandbox/samples/sensor/hts221/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 427 |
```restructuredtext
.. _ds18b20_sample:
DS18B20 1-Wire Temperature Sensor
#################################
Overview
********
This sample shows how to use the Zephyr :ref:`sensor` API driver for the
`Maxim DS18B20`_ temperature sensor.
.. _Maxim DS18B20:
path_to_url
The sample periodically reads temperature dat... | /content/code_sandbox/samples/sensor/ds18b20/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 725 |
```unknown
/*
*
*/
/*
* Example configuration of a DS18B20 device on an Arduino serial bus.
* Requires external circuit to provide an open-drain interface.
*/
&arduino_serial {
status = "okay";
w1_0: w1-zephyr-serial-0 {
compatible = "zephyr,w1-serial";
#address-cells = <1>;
#size-cells = <0>;
status ... | /content/code_sandbox/samples/sensor/ds18b20/arduino_serial.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 145 |
```yaml
sample:
name: DS18B20 Temperature Sensor sample
common:
harness: console
tags: sensors
tests:
sample.sensor.ds18b20.w1_serial:
platform_allow:
- nucleo_g0b1re
- nrf52840dk/nrf52840
integration_platforms:
- nucleo_g0b1re
- nrf52840dk/nrf52840
harness_config:
type... | /content/code_sandbox/samples/sensor/ds18b20/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 219 |
```unknown
CONFIG_SENSOR=y
CONFIG_W1=y
CONFIG_LOG=y
CONFIG_SENSOR_LOG_LEVEL_DBG=y
``` | /content/code_sandbox/samples/sensor/ds18b20/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 21 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/sensor.h>
/*
* Get a device structure from a devicetree node with compatible
* "maxim,ds18b20". (If there are multiple, just pick one.)
*/
static const struct device *get_ds18b20_device(void... | /content/code_sandbox/samples/sensor/ds18b20/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 388 |
```unknown
/*
*
*/
&arduino_serial {
status = "okay";
w1_0: w1-zephyr-serial-0 {
compatible = "zephyr,w1-serial";
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
ds18b20 {
compatible = "maxim,ds18b20";
family-code = <0x28>;
resolution = <12>;
status = "okay";
};
};
};
``` | /content/code_sandbox/samples/sensor/ds18b20/boards/serial_overlay.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 115 |
```unknown
/*
*
*/
/*
* Example configuration of a DS18B20 device on an Arduino serial bus.
* Open drain configuration allows communication by simply connecting the bus
* line to:
* a) the UART RX pin as well as the TX pin.
* b) the UART TX pin only, while the single wire half-duplex mode is enabled.
* An exte... | /content/code_sandbox/samples/sensor/ds18b20/boards/nucleo_g0b1re.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 112 |
```unknown
/*
*
*/
/*
* Example configuration of a DS18b20 device on an Arduino serial bus, using
* the zephyr-serial 1-Wire driver.
* Open drain configuration allows communication by simply connecting the bus
* line to the UART RX pin as well as the TX pin
* An external pull-up should be added anyways.
*/
#i... | /content/code_sandbox/samples/sensor/ds18b20/boards/nrf52840dk_nrf52840.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 187 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/adt7420/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 24 |
```yaml
sample:
name: ADT7420 Sensor Sample
tests:
sample.sensor.adt7420:
harness: sensor
tags: sensors
platform_allow: frdm_k64f
depends_on: i2c
``` | /content/code_sandbox/samples/sensor/adt7420/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 51 |
```restructuredtext
.. _adt7420:
ADT7420: High accuracy digital I2C temperature sensor
#####################################################
Description
***********
This sample application periodically (1Hz) measures the ambient temperature
in degrees Celsius. The result is written to the console.
When configured i... | /content/code_sandbox/samples/sensor/adt7420/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 503 |
```unknown
/*
*
*/
&i2c0 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
adt7420@48 {
compatible = "adi,adt7420";
reg = <0x48>;
int-gpios = <&gpioc 16 GPIO_ACTIVE_LOW>;
};
};
``` | /content/code_sandbox/samples/sensor/adt7420/boards/frdm_k64f.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 71 |
```unknown
/*
*
*/
&i2c0 { /* SDA P0.26, SCL P0.27, ALERT P0.11 */
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
adt7420@48 {
compatible = "adi,adt7420";
reg = <0x48>;
int-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};
};
``` | /content/code_sandbox/samples/sensor/adt7420/boards/nrf52dk_nrf52832.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 91 |
```unknown
/*
*
*/
&arduino_i2c {
status = "okay";
max17262@36 {
compatible = "maxim,max17262";
reg = <0x36>;
design-voltage = <3600>;
desired-voltage = <3600>;
desired-charging-current = <2000>;
design-cap = <17000>;
empty-voltage = <3300>;
recovery-voltage = <3880>;
charge-voltage = <3600>;
... | /content/code_sandbox/samples/sensor/max17262/app.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 119 |
```restructuredtext
.. _max17262:
MAX17262 Fuel Gauge Sensor
###################################
Overview
********
This sample application periodically reads voltage, current and temperature
data from the MAX17262 device that implements SENSOR_CHAN_GAUGE_VOLTAGE,
SENSOR_CHAN_GAUGE_AVG_CURRENT, and SENSOR_CHAN_GAUGE_... | /content/code_sandbox/samples/sensor/max17262/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 445 |
```unknown
CONFIG_I2C=y
CONFIG_LOG=y
CONFIG_SENSOR=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/max17262/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 22 |
```yaml
sample:
description: MAX17262 sensor sample
name: MAX17262 sample
tests:
sample.sensor.max17262:
build_only: true
depends_on: arduino_i2c
harness: console
tags: sensors
platform_allow: nrf52840dk/nrf52840
harness_config:
type: one_line
regex:
- "V: (.*) V; I: (.... | /content/code_sandbox/samples/sensor/max17262/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 114 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <stdio.h>
#include <zephyr/sys/__assert.h>
#define DELAY_WITH_TRIGGER K_SECONDS(5)
#define DELAY_WITHOUT_TRIGGER K_SECONDS(1)
#define UCEL_PER_CEL 1000000
#define UCEL_PER_MCEL 1000
#define TEMP_INITIAL_C... | /content/code_sandbox/samples/sensor/adt7420/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,174 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/sensor.h>
int main(void)
{
const struct device *const dev = DEVICE_DT_GET_ONE(maxim_max17262);
if (!device_is_ready(dev)) {
printk("sensor: device not ready.\n");
return 0;
}
while (1... | /content/code_sandbox/samples/sensor/max17262/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 264 |
```unknown
CONFIG_ADC=y
CONFIG_SENSOR=y
CONFIG_REQUIRES_FULL_LIBC=y
CONFIG_REQUIRES_FLOAT_PRINTF=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/grove_temperature/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 31 |
```yaml
common:
filter: CONFIG_FULL_LIBC_SUPPORTED
sample:
name: Grove Temperature Sensor
tests:
sample.sensor.grove_temperature:
min_flash: 33
tags:
- drivers
- sensor
- grove
- temperature
platform_allow: nrf52dk/nrf52832
integration_platforms:
- nrf52dk/nrf52832
... | /content/code_sandbox/samples/sensor/grove_temperature/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 98 |
```restructuredtext
.. _grove_temperature:
Grove Temperature Sensor
########################
Overview
********
This sample application gets the output of the grove temperature sensor and prints it to the
console, in units of celsius, once every second. When the :kconfig:option:`CONFIG_GROVE_LCD_RGB`
and :kconfig:opt... | /content/code_sandbox/samples/sensor/grove_temperature/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 411 |
```unknown
/*
*
*/
/ {
ntc {
compatible = "seeed,grove-temperature";
io-channels = <&arduino_adc 0>;
};
};
``` | /content/code_sandbox/samples/sensor/grove_temperature/boards/nrf52dk_nrf52832.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 37 |
```restructuredtext
.. _lsm6dso:
LSM6DSO: IMU Sensor Monitor
###########################
Overview
********
This sample sets the date rate of LSM6DSO accelerometer and gyroscope to
12.5Hz and enables a trigger on data ready. It displays on the console
the values for accelerometer and gyroscope.
Requirements
*********... | /content/code_sandbox/samples/sensor/lsm6dso/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 378 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/init.h>
#include <stdio.h>
#include <zephyr/drivers/sensor.h>
#ifdef CONFIG_GROVE_LCD_RGB
#include <zephyr/drivers/misc/grove_lcd/grove_lcd.h>
#include <stdio.h>
#include <string.h>
#endif
#define SLEEP_TIME K_MSEC(1000)
int main(void)
{
const struct devic... | /content/code_sandbox/samples/sensor/grove_temperature/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 531 |
```yaml
sample:
name: LSM6DSO accelerometer and gyrometer sensor
tests:
sample.sensor.lsm6dso:
harness: console
tags:
- sensors
timeout: 15
filter: dt_compat_enabled("st,lsm6dso")
integration_platforms:
- stm32l562e_dk
harness_config:
type: multi_line
ordered: true
... | /content/code_sandbox/samples/sensor/lsm6dso/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 172 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_LSM6DSO_TRIGGER_GLOBAL_THREAD=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/lsm6dso/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 35 |
```restructuredtext
.. _icm42605:
MPU6050: Invensense Motion Tracking Device
##########################################
Description
***********
This sample application periodically (10 Hz) measures the sensor
temperature, acceleration, and angular velocity, tap, double tap
displaying the values on the console along ... | /content/code_sandbox/samples/sensor/icm42605/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 577 |
```c
/*
*
*/
#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
static inline float out_ev(struct sensor_value *val)
{
return (val->val1 + (float)val->val2 / 1000000);
}
static void fetch_and_display(const struct device *dev)
{
struct sensor_value x, y, z;... | /content/code_sandbox/samples/sensor/lsm6dso/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 813 |
```unknown
#
#
#
CONFIG_SPI=y
CONFIG_SENSOR=y
``` | /content/code_sandbox/samples/sensor/icm42605/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 12 |
```yaml
#
#
#
sample:
name: ICM42605 Sensor Sample
tests:
sample.sensor.icm42605:
build_only: true
platform_allow: nrf52dk/nrf52832
integration_platforms:
- nrf52dk/nrf52832
tags: sensors
``` | /content/code_sandbox/samples/sensor/icm42605/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 66 |
```unknown
/*
*
*/
&pinctrl {
spi0_default_alt: spi0_default_alt {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 27)>,
<NRF_PSEL(SPIM_MOSI, 0, 26)>,
<NRF_PSEL(SPIM_MISO, 0, 23)>;
};
};
spi0_sleep_alt: spi0_sleep_alt {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 27)>,
<NRF_PSEL(SPIM_MOSI, 0, 26)>,
... | /content/code_sandbox/samples/sensor/icm42605/boards/nrf52dk_nrf52832.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 300 |
```restructuredtext
.. _ti_tmp116_sample:
TI_TMP116 Sample
################
Description
***********
This sample application periodically takes temperature readings using the ti_tmp116
sensor driver. The result is written to the console. This sample also included the code
to use the features provided by TMP117, whic... | /content/code_sandbox/samples/sensor/tmp116/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 421 |
```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/icm42605/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 919 |
```yaml
sample:
name: TI TMP116 Sensor Sample
tests:
sample.sensor.tmp116:
harness: console
platform_allow: nucleo_f401re
integration_platforms:
- nucleo_f401re
tags: sensors
depends_on: i2c
harness_config:
type: one_line
regex:
- "temp is (.*) oC"
fixture: fi... | /content/code_sandbox/samples/sensor/tmp116/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 94 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_SENSOR_INIT_PRIORITY=90
CONFIG_EEPROM=y
CONFIG_EEPROM_INIT_PRIORITY=91
CONFIG_EEPROM_TMP116=y
``` | /content/code_sandbox/samples/sensor/tmp116/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 44 |
```unknown
/*
*
*/
&i2c1 {
ti_tmp116: ti_tmp116@4b {
compatible = "ti,tmp116";
reg = <0x4B>;
#address-cells = <1>;
#size-cells = <0>;
eeprom: ti_tmp116_eeprom@0 {
compatible = "ti,tmp116-eeprom";
reg = <0x0>;
read-only;
};
};
};
``` | /content/code_sandbox/samples/sensor/tmp116/boards/nucleo_f401re.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 100 |
```restructuredtext
.. _mpu6050:
MPU6050: Invensense Motion Tracking Device
##########################################
Description
***********
This sample application periodically (0.5 Hz) measures the sensor
temperature, acceleration, and angular velocity, displaying the values
on the console along with a timestamp... | /content/code_sandbox/samples/sensor/mpu6050/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 595 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/drivers/eeprom.h>
#include <zephyr/drivers/sensor/tmp116.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/__assert.h>
#define TMP116_NODE DT_COMPAT_GET_ANY_STATUS_OKAY(ti_tmp116)
#define TMP1... | /content/code_sandbox/samples/sensor/tmp116/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 627 |
```yaml
#
#
#
sample:
name: MPU6050 Sensor Sample
tests:
sample.sensor.mpu6050:
build_only: true
platform_allow: nrf52dk/nrf52832
tags: sensors
integration_platforms:
- nrf52dk/nrf52832
``` | /content/code_sandbox/samples/sensor/mpu6050/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 65 |
```unknown
#
#
#
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_MPU6050_TRIGGER_NONE=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/mpu6050/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 30 |
```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/mpu6050/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 765 |
```unknown
/*
*
*/
&i2c0 {
mpu6050@68 {
compatible = "invensense,mpu6050";
reg = <0x68>;
status = "okay";
int-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
};
};
``` | /content/code_sandbox/samples/sensor/mpu6050/boards/nrf52dk_nrf52832.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 63 |
```unknown
CONFIG_PRINTK=y
CONFIG_GPIO=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_LOG=y
CONFIG_SENSOR_LOG_LEVEL_INF=y
CONFIG_I2C_LOG_LEVEL_INF=y
CONFIG_APDS9960_TRIGGER_GLOBAL_THREAD=n
CONFIG_PM_DEVICE=n
``` | /content/code_sandbox/samples/sensor/apds9960/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 55 |
```yaml
sample:
name: APDS9960 sample
tests:
sample.sensor.apds9960:
harness: console
platform_allow: reel_board
integration_platforms:
- reel_board
tags: sensors
depends_on:
- i2c
- gpio
harness_config:
type: multi_line
ordered: true
regex:
- "APD... | /content/code_sandbox/samples/sensor/apds9960/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 244 |
```restructuredtext
.. _apds9960:
APDS9960 RGB, Ambient Light, Gesture Sensor
###########################################
Overview
********
This sample application demonstrates how to use the APDS9960 sensor to get
ambient light, RGB, and proximity (or gesture) data. This sample checks the
sensor in polling mode (w... | /content/code_sandbox/samples/sensor/apds9960/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 221 |
```restructuredtext
.. _lps22hb:
LPS22HB: Temperature and Pressure Monitor
#########################################
Overview
********
This sample periodically reads pressure from the LPS22HB MEMS pressure
sensor and displays it on the console.
Requirements
************
This sample uses the LPS22HB sensor controll... | /content/code_sandbox/samples/sensor/lps22hb/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 251 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/device.h>
#include <stdio.h>
#include <zephyr/sys/printk.h>
#ifdef CONFIG_APDS9960_TRIGGER
K_SEM_DEFINE(sem, 0, 1);
static void trigger_handler(const struct device *dev,
const struct sensor_trigger *trigger)
{
ARG_U... | /content/code_sandbox/samples/sensor/apds9960/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 482 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/lps22hb/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 24 |
```yaml
sample:
name: LPS22HB Temperature and Humidity Monitor
tests:
sample.sensor.lps22hb:
harness: console
tags: sensors
depends_on:
- i2c
- lps22hb
harness_config:
type: multi_line
ordered: true
regex:
- "Temperature: (.*)"
- "Relative Humidity: (.*)... | /content/code_sandbox/samples/sensor/lps22hb/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 101 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <stdio.h>
#include <zephyr/sys/util.h>
static void process_sample(const struct device *dev)
{
static unsigned int obs;
struct sensor_value pressure, temp;
if (sensor_sample_fetch(dev) < 0) {
printf("... | /content/code_sandbox/samples/sensor/lps22hb/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 310 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_CBPRINTF_FP_SUPPORT=y
CONFIG_I2C=y
CONFIG_SENSOR=y
``` | /content/code_sandbox/samples/sensor/ina219/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 24 |
```yaml
#
#
sample:
name: TI INA219 power/current monitor
description: Demonstration of the INA219 I2C power/current monitor
tests:
sample.drivers.ina219:
build_only: true
platform_allow: blackpill_f411ce
tags: sensors
``` | /content/code_sandbox/samples/sensor/ina219/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 63 |
```restructuredtext
.. _ina219:
INA219 Bidirectional Power/Current Monitor
##########################################
Overview
********
This sample application measures shunt voltage, bus voltage, power and current
every 2 seconds and prints them to console.
The calibration/configuration parameters can be set in the... | /content/code_sandbox/samples/sensor/ina219/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 320 |
```unknown
/*
*
*/
&i2c1 {
status = "okay";
compatible = "st,stm32-i2c-v1";
clock-frequency = <I2C_BITRATE_FAST>;
ina219@40 {
status = "okay";
compatible = "ti,ina219";
reg = <0x40>;
brng = <0>;
pg = <0>;
sadc = <13>;
badc = <13>;
shunt-milliohm = <100>;
lsb-microamp = <10>;
};
};
``` | /content/code_sandbox/samples/sensor/ina219/boards/blackpill_f411ce.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 123 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <stdio.h>
#include <zephyr/drivers/sensor.h>
int main(void)
{
const struct device *const ina = DEVICE_DT_GET_ONE(ti_ina219);
struct sensor_value v_bus, power, current;
int rc;
if (!device_is_ready(ina)) {
printf("Device %s is not ready.\n", ina->name);
retu... | /content/code_sandbox/samples/sensor/ina219/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 259 |
```unknown
CONFIG_SPI=y
CONFIG_SENSOR=y
``` | /content/code_sandbox/samples/sensor/i3g4250d/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 9 |
```yaml
#
#
#
sample:
name: I3G4250D Sensor Sample
tests:
sample.sensor.i3g4250d:
platform_allow: stm32f3_disco@E
tags: sensors
``` | /content/code_sandbox/samples/sensor/i3g4250d/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 48 |
```restructuredtext
.. _i3g4250d:
I3G4250D: 3-axis digital output gyroscope
#########################################
Description
***********
This sample application configures the gyroscope with a fixed
sampling rate and polls the measurements with the same rate and
displays the measurements along with a timestamp ... | /content/code_sandbox/samples/sensor/i3g4250d/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 482 |
```restructuredtext
.. _th02-sample:
TH02: Temperature and Humidity Monitor
######################################
Overview
********
This sample periodically reads temperature and humidity from the Grove
Temperature & Humidity Sensor (TH02) and display the results on the Grove LCD
display.
Requirements
************... | /content/code_sandbox/samples/sensor/th02/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 243 |
```c
/*
*
*/
#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#define SAMPLING_INTERVAL_MS 10
#define DISPLAY_INTERVAL_MS 50
static int set_sampling_frequency(const struct device *sensor, double sampling_frequency)
{
struct sensor_value setting;
(void)s... | /content/code_sandbox/samples/sensor/i3g4250d/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 429 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_LOG=n
CONFIG_SENSOR_LOG_LEVEL_DBG=y
CONFIG_GROVE_LCD_RGB=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/th02/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 43 |
```yaml
sample:
name: TH02 Temperature and Humidity Monitor
tests:
sample.sensor.th02:
harness: sensor
tags: sensors
depends_on: i2c
filter: dt_compat_enabled("hoperf,th02") and dt_compat_enabled("seeed,grove-lcd-rgb")
``` | /content/code_sandbox/samples/sensor/th02/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 68 |
```unknown
/*
*
*/
&i2c0 {
th02@40 {
compatible = "hoperf,th02";
reg = <0x40>;
};
glcd: glcd@3e {
compatible = "seeed,grove-lcd-rgb";
reg = <0x3e>;
};
};
``` | /content/code_sandbox/samples/sensor/th02/boards/frdm_k64f.overlay | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 72 |
```c
/*
*
*/
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/util.h>
#include <zephyr/drivers/misc/grove_lcd/grove_lcd.h>
#include <stdio.h>
#include <string.h>
struct channel_info {
int chan;
};
static struct channel_in... | /content/code_sandbox/samples/sensor/th02/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 611 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_CBPRINTF_FP_SUPPORT=y
``` | /content/code_sandbox/samples/sensor/lis2dh/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 24 |
```yaml
sample:
name: LIS2DH Accelerometer Monitor
tests:
sample.sensor.lis2dh:
harness: sensor
tags:
- samples
- sensor
depends_on:
- i2c
- lis2dh
``` | /content/code_sandbox/samples/sensor/lis2dh/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 55 |
```restructuredtext
.. _lis2dh:
LIS2DH: Motion Sensor Monitor
#############################
Overview
********
This sample application periodically reads accelerometer data from the
LIS2DH sensor (or the compatible LS2DH12, LIS3DH, and LSM303DLHC
sensors), and displays the sensor data on the console.
Requirements
**... | /content/code_sandbox/samples/sensor/lis2dh/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 542 |
```restructuredtext
.. _tmp112_sample:
TMP112 sample
#############
Overview
********
A sample showing how to use the :dtcompatible:`ti,tmp112` sensor.
Requirements
************
A board with this sensor built in to its :ref:`devicetree <dt-guide>`, or a
devicetree overlay with such a node added.
Building and Runni... | /content/code_sandbox/samples/sensor/tmp112/README.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 139 |
```unknown
CONFIG_STDOUT_CONSOLE=y
CONFIG_I2C=y
CONFIG_SENSOR=y
CONFIG_ASSERT=y
``` | /content/code_sandbox/samples/sensor/tmp112/prj.conf | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 21 |
```yaml
sample:
name: TMP112 Sensor Sample
tests:
sample.sensor.tmp112:
harness: console
tags: sensors
depends_on: i2c
filter: dt_compat_enabled("ti,tmp112")
harness_config:
type: one_line
regex:
- "temp is (.*)"
fixture: fixture_i2c_tmp112
``` | /content/code_sandbox/samples/sensor/tmp112/sample.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 79 |
```c
/*
*
*/
#include <stdio.h>
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/sensor.h>
static void fetch_and_display(const struct device *sensor)
{
static unsigned int count;
struct sensor_value accel[3];
struct sensor_value temperature;
const char *overrun = "";
int rc = sens... | /content/code_sandbox/samples/sensor/lis2dh/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 762 |
```unknown
/*
*
*/
&i2c0 {
tmp112@4a {
compatible = "ti,tmp112";
reg = <0x4a>;
};
};
``` | /content/code_sandbox/samples/sensor/tmp112/boards/frdm_k64f.overlay | unknown | 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/drivers/sensor.h>
#include <zephyr/sys/printk.h>
#include <zephyr/sys/__assert.h>
static void do_main(const struct device *dev)
{
int ret;
struct sensor_value temp_value;
struct sensor_value attr;
attr.val1 = 150;
attr.val2 = ... | /content/code_sandbox/samples/sensor/tmp112/src/main.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 401 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.