|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Main header file for hardware spinlock driver API. More...
#include <zephyr/types.h>#include <zephyr/sys/util.h>#include <zephyr/sys/__assert.h>#include <zephyr/device.h>#include <zephyr/spinlock.h>#include <zephyr/devicetree.h>Go to the source code of this file.
Data Structures | |
| struct | hwspinlock_dt_spec |
| Complete hardware spinlock DT information. More... | |
| struct | hwspinlock_driver_config |
| This structure is common to all hardware spinlock drivers and is expected to be the first element in the driver's struct driver_config declaration. More... | |
| struct | hwspinlock_driver_api |
| @driver_ops{Hardware Spinlock} More... | |
Macros | |
| #define | HWSPINLOCK_DT_SPEC_GET_BY_IDX(node_id, idx) |
| Structure initializer for struct hwspinlock_dt_spec from devicetree by index. | |
| #define | HWSPINLOCK_DT_SPEC_GET_BY_NAME(node_id, name) |
| Structure initializer for struct hwspinlock_dt_spec from devicetree by name. | |
| #define | HWSPINLOCK_DT_SPEC_GET(node_id) |
| Structure initializer for struct hwspinlock_dt_spec from devicetree. | |
| #define | HWSPINLOCK_DT_SPEC_INST_GET_BY_IDX(inst, idx) |
| Instance version of HWSPINLOCK_DT_SPEC_GET_BY_IDX(). | |
| #define | HWSPINLOCK_DT_SPEC_INST_GET_BY_NAME(inst, name) |
| Instance version of HWSPINLOCK_DT_SPEC_GET_BY_NAME(). | |
| #define | HWSPINLOCK_DT_SPEC_INST_GET(inst) |
| Instance version of HWSPINLOCK_DT_SPEC_GET(). | |
| #define | HWSPINLOCK_COMMON_CONFIG_FROM_DT_NODE(node_id) |
| Make a struct hwspinlock_driver_config initializer from a node identifier. | |
| #define | HWSPINLOCK_COMMON_CONFIG_FROM_DT_INST(inst) |
Make a struct hwspinlock_driver_config initializer from a DT_DRV_COMPAT instance number. | |
| #define | HWSPINLOCK_SPINLOCK_ARRAY_DT_DEFINE(node_id) |
| Make an array of spinlock initializer from a node identifier. | |
| #define | HWSPINLOCK_SPINLOCK_ARRAY_DT_INST_DEFINE(inst) |
Make an array of spinlock initializer from a DT_DRV_COMPAT instance number. | |
Typedefs | |
| typedef int(* | hwspinlock_api_trylock) (const struct device *dev, uint32_t id) |
| @def_driverbackendgroup{Hardware Spinlock,hwspinlock_interface} | |
| typedef void(* | hwspinlock_api_lock) (const struct device *dev, uint32_t id) |
| Callback API to lock an HW spinlock. | |
| typedef void(* | hwspinlock_api_unlock) (const struct device *dev, uint32_t id) |
| Callback API to unlock an HW spinlock. | |
| typedef uint32_t(* | hwspinlock_api_get_max_id) (const struct device *dev) |
| Callback API to get the maximum HW spinlock ID. | |
Functions | |
| static int | hw_spin_trylock (const struct device *dev, uint32_t id, k_spinlock_key_t *key) |
| Try to lock HW spinlock. | |
| static k_spinlock_key_t | hw_spin_lock (const struct device *dev, uint32_t id) |
| Lock HW spinlock. | |
| static void | hw_spin_unlock (const struct device *dev, uint32_t id, k_spinlock_key_t key) |
| Unlock HW spinlock. | |
| static uint32_t | hw_spinlock_get_max_id (const struct device *dev) |
| Get HW spinlock max ID. | |
| static int | hw_spin_trylock_dt (struct hwspinlock_dt_spec *spec, k_spinlock_key_t *key) |
| Try to lock HW spinlock from a struct hwspinlock_dt_spec. | |
| static k_spinlock_key_t | hw_spin_lock_dt (struct hwspinlock_dt_spec *spec) |
| Lock HW spinlock from a struct hwspinlock_dt_spec. | |
| static void | hw_spin_unlock_dt (struct hwspinlock_dt_spec *spec, k_spinlock_key_t key) |
| Unlock HW spinlock from a struct hwspinlock_dt_spec. | |
| static uint32_t | hw_spinlock_get_max_id_dt (struct hwspinlock_dt_spec *spec) |
| Get HW spinlock max ID from a struct hwspinlock_dt_spec. | |
Main header file for hardware spinlock driver API.