|
Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
|
Wakeup Controller (WUC) Driver APIs. More...
Topics | |
| Devicetree WUC Controller API | |
Files | |
| file | wuc.h |
| Main header file for WUC (Wakeup Controller) driver API. | |
| file | wuc_nxp_llwu.h |
| NXP LLWU wakeup source encodings. | |
Data Structures | |
| struct | wuc_dt_spec |
| Wakeup controller device configuration. More... | |
Macros | |
| #define | WUC_DT_SPEC_GET_BY_IDX(node_id, idx) |
Static initializer for a wuc_dt_spec. | |
| #define | WUC_DT_SPEC_GET_BY_IDX_OR(node_id, idx, default_value) |
| Like WUC_DT_SPEC_GET_BY_IDX(), with a fallback to a default value. | |
| #define | WUC_DT_SPEC_GET(node_id) |
| Equivalent to WUC_DT_SPEC_GET_BY_IDX(node_id, 0). | |
| #define | WUC_DT_SPEC_GET_OR(node_id, default_value) |
| Equivalent to WUC_DT_SPEC_GET_BY_IDX_OR(node_id, 0, default_value). | |
| #define | WUC_DT_SPEC_INST_GET_BY_IDX(inst, idx) |
Static initializer for a wuc_dt_spec from a DT_DRV_COMPAT instance's Wakeup Controller property at an index. | |
| #define | WUC_DT_SPEC_INST_GET_BY_IDX_OR(inst, idx, default_value) |
Static initializer for a wuc_dt_spec from a DT_DRV_COMPAT instance's 'wakeup-ctrls' property at an index, with fallback. | |
| #define | WUC_DT_SPEC_INST_GET(inst) |
| Equivalent to WUC_DT_SPEC_INST_GET_BY_IDX(inst, 0). | |
| #define | WUC_DT_SPEC_INST_GET_OR(inst, default_value) |
| Equivalent to WUC_DT_SPEC_INST_GET_BY_IDX_OR(node_id, 0, default_value). | |
Functions | |
| static int | wuc_enable_wakeup_source (const struct device *dev, uint32_t id) |
| Enable a wakeup source. | |
| static int | wuc_enable_wakeup_source_dt (const struct wuc_dt_spec *spec) |
| Enable a wakeup source using a wuc_dt_spec. | |
| static int | wuc_disable_wakeup_source (const struct device *dev, uint32_t id) |
| Disable a wakeup source. | |
| static int | wuc_disable_wakeup_source_dt (const struct wuc_dt_spec *spec) |
| Disable a wakeup source using a wuc_dt_spec. | |
| static int | wuc_check_wakeup_source_triggered (const struct device *dev, uint32_t id) |
| Check if a wakeup source triggered. | |
| 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. | |
| static int | wuc_clear_wakeup_source_triggered (const struct device *dev, uint32_t id) |
| Clear a wakeup source triggered status. | |
| 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. | |
Wakeup Controller (WUC) Driver APIs.
| #define WUC_DT_SPEC_GET | ( | node_id | ) |
#include <zephyr/drivers/wuc.h>
Equivalent to WUC_DT_SPEC_GET_BY_IDX(node_id, 0).
| node_id | devicetree node identifier |
| #define WUC_DT_SPEC_GET_BY_IDX | ( | node_id, | |
| idx ) |
#include <zephyr/drivers/wuc.h>
Static initializer for a wuc_dt_spec.
This returns a static initializer for a wuc_dt_spec structure given a devicetree node identifier, a property specifying a Wakeup Controller and an index.
Example devicetree fragment:
n: node {
wakeup-ctrls = <&wuc 10>;
}
Example usage:
const struct wuc_dt_spec spec = WUC_DT_SPEC_GET_BY_IDX(DT_NODELABEL(n), 0);
Initializes 'spec' to:
{
.dev = DEVICE_DT_GET(DT_NODELABEL(wuc)),
.id = 10
}
The 'wuc' field must still be checked for readiness, e.g. using device_is_ready(). It is an error to use this macro unless the node exists, has the given property, and that property specifies a wakeup controller wakeup source id as shown above.
| node_id | devicetree node identifier |
| idx | logical index into "wakeup-ctrls" |
| #define WUC_DT_SPEC_GET_BY_IDX_OR | ( | node_id, | |
| idx, | |||
| default_value ) |
#include <zephyr/drivers/wuc.h>
Like WUC_DT_SPEC_GET_BY_IDX(), with a fallback to a default value.
If the devicetree node identifier 'node_id' refers to a node with a 'wakeup-ctrls' property, this expands to WUC_DT_SPEC_GET_BY_IDX(node_id, idx). The default_value parameter is not expanded in this case.
Otherwise, this expands to default_value.
| node_id | devicetree node identifier |
| idx | logical index into the 'wakeup-ctrls' property |
| default_value | fallback value to expand to |
| #define WUC_DT_SPEC_GET_OR | ( | node_id, | |
| default_value ) |
#include <zephyr/drivers/wuc.h>
Equivalent to WUC_DT_SPEC_GET_BY_IDX_OR(node_id, 0, default_value).
| node_id | devicetree node identifier |
| default_value | fallback value to expand to |
| #define WUC_DT_SPEC_INST_GET | ( | inst | ) |
#include <zephyr/drivers/wuc.h>
Equivalent to WUC_DT_SPEC_INST_GET_BY_IDX(inst, 0).
| inst | DT_DRV_COMPAT instance number |
| #define WUC_DT_SPEC_INST_GET_BY_IDX | ( | inst, | |
| idx ) |
#include <zephyr/drivers/wuc.h>
Static initializer for a wuc_dt_spec from a DT_DRV_COMPAT instance's Wakeup Controller property at an index.
| inst | DT_DRV_COMPAT instance number |
| idx | logical index into "wakeup-ctrls" |
| #define WUC_DT_SPEC_INST_GET_BY_IDX_OR | ( | inst, | |
| idx, | |||
| default_value ) |
#include <zephyr/drivers/wuc.h>
Static initializer for a wuc_dt_spec from a DT_DRV_COMPAT instance's 'wakeup-ctrls' property at an index, with fallback.
| inst | DT_DRV_COMPAT instance number |
| idx | logical index into the 'wakeup-ctrls' property |
| default_value | fallback value to expand to |
| #define WUC_DT_SPEC_INST_GET_OR | ( | inst, | |
| default_value ) |
#include <zephyr/drivers/wuc.h>
Equivalent to WUC_DT_SPEC_INST_GET_BY_IDX_OR(node_id, 0, default_value).
| inst | DT_DRV_COMPAT instance number |
| default_value | fallback value to expand to |
#include <zephyr/drivers/wuc.h>
Check if a wakeup source triggered.
| dev | Pointer to the WUC device structure. |
| id | Wakeup source identifier. |
| 1 | If wakeup was triggered by this source. |
| 0 | If wakeup was not triggered by this source. |
| -errno | Negative errno code on failure. |
| -ENOSYS | if the interface is not implemented. |
|
inlinestatic |
#include <zephyr/drivers/wuc.h>
Check if a wakeup source triggered using a wuc_dt_spec.
| spec | Pointer to the WUC devicetree spec structure. |
| 1 | If wakeup was triggered by this source. |
| 0 | If wakeup was not triggered by this source. |
| -errno | Negative errno code on failure. |
| -ENOSYS | if the interface is not implemented. |
#include <zephyr/drivers/wuc.h>
Clear a wakeup source triggered status.
| dev | Pointer to the WUC device structure. |
| id | Wakeup source identifier. |
| 0 | If successful. |
| -errno | Negative errno code on failure. |
| -ENOSYS | if the interface is not implemented. |
|
inlinestatic |
#include <zephyr/drivers/wuc.h>
Clear a wakeup source triggered status using a wuc_dt_spec.
| spec | Pointer to the WUC devicetree spec structure. |
| 0 | If successful. |
| -errno | Negative errno code on failure. |
| -ENOSYS | if the interface is not implemented. |
#include <zephyr/drivers/wuc.h>
Disable a wakeup source.
| dev | Pointer to the WUC device structure. |
| id | Wakeup source identifier. |
| 0 | If successful. |
| -errno | Negative errno code on failure. |
|
inlinestatic |
#include <zephyr/drivers/wuc.h>
Disable a wakeup source using a wuc_dt_spec.
| spec | Pointer to the WUC devicetree spec structure. |
| 0 | If successful. |
| -errno | Negative errno code on failure. |
#include <zephyr/drivers/wuc.h>
Enable a wakeup source.
| dev | Pointer to the WUC device structure |
| id | Wakeup source identifier |
| 0 | If successful |
| -errno | Negative errno code on failure |
|
inlinestatic |
#include <zephyr/drivers/wuc.h>
Enable a wakeup source using a wuc_dt_spec.
| spec | Pointer to the WUC devicetree spec structure. |
| 0 | If successful. |
| -errno | Negative errno code on failure. |