7#ifndef ZEPHYR_INCLUDE_DRIVERS_RELAY_RELAY_H_
8#define ZEPHYR_INCLUDE_DRIVERS_RELAY_RELAY_H_
61static inline int z_impl_relay_set_state(
const struct device *dev,
bool on)
79static inline int z_impl_relay_get_state(
const struct device *dev,
bool *on)
96#include <zephyr/syscalls/relay.h>
APIs and macros for the Zephyr device model.
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1505
int relay_set_state(const struct device *dev, bool on)
Set the on/off state of the relay.
int(* relay_get_state_t)(const struct device *dev, bool *on)
Read back the on/off state of the relay.
Definition relay.h:41
int(* relay_set_state_t)(const struct device *dev, bool on)
Set the on/off state of the relay.
Definition relay.h:38
int relay_get_state(const struct device *dev, bool *on)
Read back the last requested on/off state of the relay.
#define ENOSYS
Function not implemented.
Definition errno.h:83
Runtime device structure (in ROM) per driver instance.
Definition device.h:543
Relay driver class API.
Definition relay.h:44
relay_set_state_t set_state
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition relay.h:46
relay_get_state_t get_state
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition relay.h:48