Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
1-Wire Interface

1-Wire Interface More...

Topics

 1-Wire Sensor API
 1-Wire Sensor API
 
 1-Wire data link layer
 
 1-Wire network layer
 1-Wire network layer
 

Enumerations

enum  w1_settings_type { W1_SETTING_SPEED , W1_SETTING_STRONG_PULLUP , W1_SETINGS_TYPE_COUNT }
 Defines the 1-Wire master settings types, which are runtime configurable. More...
 

Functions

static int w1_lock_bus (const struct device *dev)
 Lock the 1-wire bus to prevent simultaneous access.
 
static int w1_unlock_bus (const struct device *dev)
 Unlock the 1-wire bus.
 

Detailed Description

1-Wire Interface

Since
3.2
Version
0.1.0

Enumeration Type Documentation

◆ w1_settings_type

#include <zephyr/drivers/w1.h>

Defines the 1-Wire master settings types, which are runtime configurable.

Enumerator
W1_SETTING_SPEED 

Overdrive speed is enabled in case a value of 1 is passed and disabled passing 0.

W1_SETTING_STRONG_PULLUP 

The strong pullup resistor is activated immediately after the next written data block by passing a value of 1, and deactivated passing 0.

W1_SETINGS_TYPE_COUNT 

Number of different settings types.

Function Documentation

◆ w1_lock_bus()

static int w1_lock_bus ( const struct device * dev)
inlinestatic

#include <zephyr/drivers/w1.h>

Lock the 1-wire bus to prevent simultaneous access.

This routine locks the bus to prevent simultaneous access from different threads. The calling thread waits until the bus becomes available. A thread is permitted to lock a mutex it has already locked.

Parameters
[in]devPointer to the device structure for the driver instance.
Return values
0If successful.
-errnoNegative error code on error.

◆ w1_unlock_bus()

static int w1_unlock_bus ( const struct device * dev)
inlinestatic

#include <zephyr/drivers/w1.h>

Unlock the 1-wire bus.

This routine unlocks the bus to permit access to bus line.

Parameters
[in]devPointer to the device structure for the driver instance.
Return values
0If successful.
-errnoNegative error code on error.