13#ifndef ZEPHYR_INCLUDE_DRIVERS_RESET_H_
14#define ZEPHYR_INCLUDE_DRIVERS_RESET_H_
72#define RESET_DT_SPEC_GET_BY_IDX(node_id, idx) \
74 .dev = DEVICE_DT_GET(DT_RESET_CTLR_BY_IDX(node_id, idx)), \
75 .id = DT_RESET_ID_BY_IDX(node_id, idx) \
94#define RESET_DT_SPEC_GET_BY_IDX_OR(node_id, idx, default_value) \
95 COND_CODE_1(DT_NODE_HAS_PROP(node_id, resets), \
96 (RESET_DT_SPEC_GET_BY_IDX(node_id, idx)), \
106#define RESET_DT_SPEC_GET(node_id) \
107 RESET_DT_SPEC_GET_BY_IDX(node_id, 0)
118#define RESET_DT_SPEC_GET_OR(node_id, default_value) \
119 RESET_DT_SPEC_GET_BY_IDX_OR(node_id, 0, default_value)
130#define RESET_DT_SPEC_INST_GET_BY_IDX(inst, idx) \
131 RESET_DT_SPEC_GET_BY_IDX(DT_DRV_INST(inst), idx)
143#define RESET_DT_SPEC_INST_GET_BY_IDX_OR(inst, idx, default_value) \
144 COND_CODE_1(DT_PROP_HAS_IDX(DT_DRV_INST(inst), resets, idx), \
145 (RESET_DT_SPEC_GET_BY_IDX(DT_DRV_INST(inst), idx)), \
155#define RESET_DT_SPEC_INST_GET(inst) \
156 RESET_DT_SPEC_INST_GET_BY_IDX(inst, 0)
167#define RESET_DT_SPEC_INST_GET_OR(inst, default_value) \
168 RESET_DT_SPEC_INST_GET_BY_IDX_OR(inst, 0, default_value)
278static inline int z_impl_reset_line_assert(
const struct device *dev,
uint32_t id)
320static inline int z_impl_reset_line_deassert(
const struct device *dev,
uint32_t id)
361static inline int z_impl_reset_line_toggle(
const struct device *dev,
uint32_t id)
396#include <zephyr/syscalls/reset.h>
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1425
int(* reset_api_line_toggle)(const struct device *dev, uint32_t id)
API template to reset the device.
Definition reset.h:202
int reset_line_toggle(const struct device *dev, uint32_t id)
Reset the device.
int(* reset_api_status)(const struct device *dev, uint32_t id, uint8_t *status)
@def_driverbackendgroup{Reset Controller,reset_controller_interface}
Definition reset.h:181
int(* reset_api_line_deassert)(const struct device *dev, uint32_t id)
API template to take out the device from reset state.
Definition reset.h:195
static int reset_line_deassert_dt(const struct reset_dt_spec *spec)
Deassert the reset state from a reset_dt_spec.
Definition reset.h:342
static int reset_status_dt(const struct reset_dt_spec *spec, uint8_t *status)
Get the reset status from a reset_dt_spec.
Definition reset.h:258
int(* reset_api_line_assert)(const struct device *dev, uint32_t id)
API template to put the device in reset state.
Definition reset.h:188
int reset_line_deassert(const struct device *dev, uint32_t id)
Take out the device from reset state.
int reset_line_assert(const struct device *dev, uint32_t id)
Put the device in reset state.
static int reset_line_assert_dt(const struct reset_dt_spec *spec)
Assert the reset state from a reset_dt_spec.
Definition reset.h:300
int reset_status(const struct device *dev, uint32_t id, uint8_t *status)
Get the reset status.
static int reset_line_toggle_dt(const struct reset_dt_spec *spec)
Reset the device from a reset_dt_spec.
Definition reset.h:383
#define ENOSYS
Function not implemented.
Definition errno.h:82
#define NULL
Definition iar_missing_defs.h:20
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
@driver_ops{Reset Controller}
Definition reset.h:207
reset_api_line_toggle line_toggle
@driver_ops_optional API template to reset the device.
Definition reset.h:215
reset_api_line_deassert line_deassert
@driver_ops_optional API template to take out the device from reset state.
Definition reset.h:213
reset_api_status status
@driver_ops_optional @def_driverbackendgroup{Reset Controller,reset_controller_interface}
Definition reset.h:209
reset_api_line_assert line_assert
@driver_ops_optional API template to put the device in reset state.
Definition reset.h:211
Reset controller device configuration.
Definition reset.h:35
const struct device * dev
Reset controller device.
Definition reset.h:37
uint32_t id
Reset line.
Definition reset.h:39