![]() |
NTURT Zephyr v0.0.1
NTURT common library for Zephyr RTOS
|
Utility macros and functions. More...
#include <stddef.h>#include <zephyr/kernel.h>#include <zephyr/sys/cbprintf.h>#include <zephyr/sys/util.h>#include "nturt/sys/util_loops.h"
Include dependency graph for util.h:
This graph shows which files directly or indirectly include this file:Data Structures | |
| struct | work_ctx |
| Work context. More... | |
| struct | work_ctx_buf |
| Work context buffer. More... | |
Macros | |
| #define | DISCARD(...) |
Discards all arguments and expend to Zephyr EMPTY. | |
| #define | GET_ARG_N_FIXED(N, ...) |
Same as Zephyr GET_GET_ARG_N but accepts macro expansion for N . | |
| #define | N_FOR_EACH_IDX_FIXED_ARG(F, sep, fixed_arg, ...) |
Same as Zephyr FOR_EACH_IDX_FIXED_ARG, useful for nested FOR_EACH macros. | |
| #define | N_FOR_EACH_FIXED_ARG(F, sep, fixed_arg, ...) |
Same as Zephyr FOR_EACH_FIXED_ARG, useful for nested FOR_EACH macros. | |
| #define | N_FOR_EACH_IDX(F, sep, ...) |
Same as Zephyr FOR_EACH_IDX, useful for nested FOR_EACH macros. | |
| #define | N_FOR_EACH(F, sep, ...) |
Same as Zephyr FOR_EACH, useful for nested FOR_EACH macros. | |
| #define | DEREF_TYPE(type) |
| Get the deferenced type of a pointer type. | |
| #define | TYPEOF_FIELD(type, member) |
| Get the type of a member in a structure (struct or union). | |
| #define | XOR(a, b) |
| Logical XOR. | |
| #define | IS_MASK_SET(value, mask) |
Check if all bits in mask are set in value . | |
| #define | FLAG_SET_AND_CLEAR(num, flag) |
| Check if a flag is set and clear that flag if it so. | |
| #define | BIT_SET_AND_CLEAR(num, bit) |
| Check if a bit is set and clear that bit if it is so. | |
| #define | LOG_DBG_THROTTLE(min_separation, ...) |
| Writes a DEBUG level message to the log with throttling. | |
| #define | LOG_INF_THROTTLE(min_separation, ...) |
| Writes an INFO level message to the log with throttling. | |
| #define | LOG_WRN_THROTTLE(min_separation, ...) |
| Writes a WARNING level message to the log with throttling. | |
| #define | LOG_ERR_THROTTLE(min_separation, ...) |
| Writes an ERROR level message to the log with throttling. | |
| #define | PRI(x) |
Insert format string to print x . | |
| #define | SCN(x) |
Insert format string to scan x . | |
| #define | PRI_arg(x) |
Insert x to printf format. | |
| #define | WORK_CTX_BUF_DEFINE(_name, _size, _work_handler, _ctx, _args_type) |
| Define work context buffer for the bottom half of an ISR. | |
| #define | WORK_CTX(_work) |
| Get the context of the work. | |
| #define | WORK_CTX_ARGS(_work) |
| Get the arguments for the work. | |
Functions | |
| struct work_ctx * | work_ctx_buf_alloc (struct work_ctx_buf *buf) |
| Allocate a work context. Return NULL if all work context are in use. | |
Utility macros and functions.