Interfaces for 1-Wire devices.
More...
|
file | w1.h |
| Main header file for 1-Wire driver API.
|
|
Interfaces for 1-Wire devices.
- Since
- 3.2
- Version
- 0.1.0
◆ w1_settings_type
#include <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.
|
◆ w1_lock_bus()
static int w1_lock_bus |
( |
const struct device * |
dev | ) |
|
|
inlinestatic |
#include <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] | dev | Pointer to the device structure for the driver instance. |
- Return values
-
0 | If successful. |
-errno | Negative error code on error. |
◆ w1_unlock_bus()
static int w1_unlock_bus |
( |
const struct device * |
dev | ) |
|
|
inlinestatic |
#include <include/zephyr/drivers/w1.h>
Unlock the 1-wire bus.
This routine unlocks the bus to permit access to bus line.
- Parameters
-
[in] | dev | Pointer to the device structure for the driver instance. |
- Return values
-
0 | If successful. |
-errno | Negative error code on error. |