Loading...
Searching...
No Matches
Go to the documentation of this file.
8#ifndef __ZEPHYR_RTOS_BIT_H__
9#define __ZEPHYR_RTOS_BIT_H__
11#include <zephyr/sys/util.h>
15#define MASK(b_hi, b_lo) \
16 (((1ULL << ((b_hi) - (b_lo) + 1ULL)) - 1ULL) << (b_lo))
17#define SET_BIT(b, x) (((x) & 1) << (b))
18#define SET_BITS(b_hi, b_lo, x) \
19 (((x) & ((1ULL << ((b_hi) - (b_lo) + 1ULL)) - 1ULL)) << (b_lo))
20#define GET_BIT(b, x) \
21 (((x) & (1ULL << (b))) >> (b))
22#define GET_BITS(b_hi, b_lo, x) \
23 (((x) & MASK(b_hi, b_lo)) >> (b_lo))