Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

1-Wire Sensor API More...

Files

file  w1_sensor.h
 Extended public API for 1-Wire sensors.

Enumerations

enum  sensor_attribute_w1 { SENSOR_ATTR_W1_ROM = SENSOR_ATTR_PRIV_START }
 Extended sensor attributes for 1-Wire sensors. More...

Functions

static void w1_rom_to_sensor_value (const struct w1_rom *rom, struct sensor_value *val)
 Encode a w1_rom as a sensor_value.
static void w1_sensor_value_to_rom (const struct sensor_value *val, struct w1_rom *rom)
 Decode a sensor_value into a w1_rom.

Detailed Description

1-Wire Sensor API

Enumeration Type Documentation

◆ sensor_attribute_w1

#include <zephyr/drivers/sensor/w1_sensor.h>

Extended sensor attributes for 1-Wire sensors.

Enumerator
SENSOR_ATTR_W1_ROM 

Device unique 1-Wire ROM identifier.

64-bit ROM (family code, serial number, and CRC) encoded as a big-endian integer:

Use w1_rom_to_sensor_value() and w1_sensor_value_to_rom() to convert between w1_rom and sensor_value.

Function Documentation

◆ w1_rom_to_sensor_value()

void w1_rom_to_sensor_value ( const struct w1_rom * rom,
struct sensor_value * val )
inlinestatic

#include <zephyr/drivers/sensor/w1_sensor.h>

Encode a w1_rom as a sensor_value.

Parameters
[in]romPointer to the ROM structure.
[out]valPointer to the sensor value to populate.

◆ w1_sensor_value_to_rom()

void w1_sensor_value_to_rom ( const struct sensor_value * val,
struct w1_rom * rom )
inlinestatic

#include <zephyr/drivers/sensor/w1_sensor.h>

Decode a sensor_value into a w1_rom.

Parameters
[in]valPointer to the sensor value containing the encoded ROM.
[out]romPointer to the ROM structure to populate.