|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
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. | |
1-Wire Sensor API
| enum 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. |
|
inlinestatic |
#include <zephyr/drivers/sensor/w1_sensor.h>
Encode a w1_rom as a sensor_value.
| [in] | rom | Pointer to the ROM structure. |
| [out] | val | Pointer to the sensor value to populate. |
|
inlinestatic |
#include <zephyr/drivers/sensor/w1_sensor.h>
Decode a sensor_value into a w1_rom.
| [in] | val | Pointer to the sensor value containing the encoded ROM. |
| [out] | rom | Pointer to the ROM structure to populate. |