13#ifndef ZEPHYR_INCLUDE_DRIVERS_WUC_H_
14#define ZEPHYR_INCLUDE_DRIVERS_WUC_H_
72#define WUC_DT_SPEC_GET_BY_IDX(node_id, idx) \
73 {.dev = DEVICE_DT_GET(DT_WUC_BY_IDX(node_id, idx)), .id = DT_WUC_ID_BY_IDX(node_id, idx)}
91#define WUC_DT_SPEC_GET_BY_IDX_OR(node_id, idx, default_value) \
92 COND_CODE_1(DT_NODE_HAS_PROP(node_id, wakeup_ctrls), \
93 (WUC_DT_SPEC_GET_BY_IDX(node_id, idx)), \
103#define WUC_DT_SPEC_GET(node_id) WUC_DT_SPEC_GET_BY_IDX(node_id, 0)
114#define WUC_DT_SPEC_GET_OR(node_id, default_value) \
115 WUC_DT_SPEC_GET_BY_IDX_OR(node_id, 0, default_value)
126#define WUC_DT_SPEC_INST_GET_BY_IDX(inst, idx) WUC_DT_SPEC_GET_BY_IDX(DT_DRV_INST(inst), idx)
138#define WUC_DT_SPEC_INST_GET_BY_IDX_OR(inst, idx, default_value) \
139 COND_CODE_1(DT_PROP_HAS_IDX(DT_DRV_INST(inst), wakeup_ctrls, idx), \
140 (WUC_DT_SPEC_GET_BY_IDX(DT_DRV_INST(inst), idx)), \
150#define WUC_DT_SPEC_INST_GET(inst) WUC_DT_SPEC_INST_GET_BY_IDX(inst, 0)
161#define WUC_DT_SPEC_INST_GET_OR(inst, default_value) \
162 WUC_DT_SPEC_INST_GET_BY_IDX_OR(inst, 0, default_value)
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1375
#define ENOSYS
Function not implemented.
Definition errno.h:82
int(* wuc_api_clear_wakeup_source_triggered)(const struct device *dev, uint32_t id)
Callback API to clear a wakeup source triggered status.
Definition wuc.h:191
int(* wuc_api_check_wakeup_source_triggered)(const struct device *dev, uint32_t id)
Callback API to check if a wakeup source triggered.
Definition wuc.h:185
int(* wuc_api_enable_wakeup_source)(const struct device *dev, uint32_t id)
Callback API to enable a wakeup source.
Definition wuc.h:173
int(* wuc_api_disable_wakeup_source)(const struct device *dev, uint32_t id)
Callback API to disable a wakeup source.
Definition wuc.h:179
static int wuc_enable_wakeup_source(const struct device *dev, uint32_t id)
Enable a wakeup source.
Definition wuc.h:227
static int wuc_clear_wakeup_source_triggered(const struct device *dev, uint32_t id)
Clear a wakeup source triggered status.
Definition wuc.h:316
static int wuc_disable_wakeup_source_dt(const struct wuc_dt_spec *spec)
Disable a wakeup source using a wuc_dt_spec.
Definition wuc.h:267
static int wuc_check_wakeup_source_triggered_dt(const struct wuc_dt_spec *spec)
Check if a wakeup source triggered using a wuc_dt_spec.
Definition wuc.h:301
static int wuc_check_wakeup_source_triggered(const struct device *dev, uint32_t id)
Check if a wakeup source triggered.
Definition wuc.h:283
static int wuc_enable_wakeup_source_dt(const struct wuc_dt_spec *spec)
Enable a wakeup source using a wuc_dt_spec.
Definition wuc.h:240
static int wuc_disable_wakeup_source(const struct device *dev, uint32_t id)
Disable a wakeup source.
Definition wuc.h:254
static int wuc_clear_wakeup_source_triggered_dt(const struct wuc_dt_spec *spec)
Clear a wakeup source triggered status using a wuc_dt_spec.
Definition wuc.h:333
#define NULL
Definition iar_missing_defs.h:20
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
<span class="mlabel">Driver Operations</span> WUC driver operations
Definition wuc.h:196
wuc_api_check_wakeup_source_triggered triggered
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition wuc.h:208
wuc_api_disable_wakeup_source disable
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition wuc.h:204
wuc_api_enable_wakeup_source enable
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition wuc.h:200
wuc_api_clear_wakeup_source_triggered clear
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition wuc.h:212
Wakeup controller device configuration.
Definition wuc.h:35
const struct device * dev
Wakeup controller device.
Definition wuc.h:37
uint32_t id
Wakeup source identifier.
Definition wuc.h:39