Zephyr Project API 3.7.0
A Scalable Open Source RTOS
|
HW spinlock Interface. More...
Functions | |
int | hwspinlock_trylock (const struct device *dev, uint32_t id) |
Try to lock HW spinlock. | |
void | hwspinlock_lock (const struct device *dev, uint32_t id) |
Lock HW spinlock. | |
void | hwspinlock_unlock (const struct device *dev, uint32_t id) |
Try to unlock HW spinlock. | |
uint32_t | hwspinlock_get_max_id (const struct device *dev) |
Get HW spinlock max ID. | |
HW spinlock Interface.
#include <include/zephyr/drivers/hwspinlock.h>
Get HW spinlock max ID.
This function is used to get the HW spinlock maximum ID. It should be called before attempting to lock/unlock a specific HW spinlock.
dev | HW spinlock device instance. |
HW | spinlock max ID. |
0 | if the function is not implemented by the driver. |
#include <include/zephyr/drivers/hwspinlock.h>
Lock HW spinlock.
This function is used to lock specific HW spinlock. It should be called before a critical section that we want to protect.
dev | HW spinlock device instance. |
id | Spinlock identifier. |
#include <include/zephyr/drivers/hwspinlock.h>
Try to lock HW spinlock.
This function is used for try to lock specific HW spinlock. It should be called before a critical section that we want to protect.
dev | HW spinlock device instance. |
id | Spinlock identifier. |
0 | If successful. |
-errno | In case of any failure. |
#include <include/zephyr/drivers/hwspinlock.h>
Try to unlock HW spinlock.
This function is used for try to unlock specific HW spinlock. It should be called after a critical section that we want to protect.
dev | HW spinlock device instance. |
id | Spinlock identifier. |