Bitmask managing module.
More...
|
#define | BITMASK_BYTES_CALCULATE(bits_count) NRFX_CEIL_DIV(bits_count, 8) |
| Get number of bytes needed to store the given bitmask.
|
|
#define | BITMASK_BYTE_GET(abs_bit) ((abs_bit)/8) |
| Macro for getting index of byte in byte stream where abs_bit is put.
|
|
#define | BITMASK_RELBIT_GET(abs_bit) ((abs_bit) & 0x7UL) |
| Macro for getting relative index of bit in byte.
|
|
|
__STATIC_INLINE bool | nrf_bitmask_bit_is_set (uint32_t bit, void const *p_mask) |
| Function for checking if bit in the multi-byte bit mask is set.
|
|
__STATIC_INLINE void | nrf_bitmask_bit_set (uint32_t bit, void *p_mask) |
| Function for setting a bit in the multi-byte bit mask.
|
|
__STATIC_INLINE void | nrf_bitmask_bit_clear (uint32_t bit, void *p_mask) |
| Function for clearing a bit in the multi-byte bit mask.
|
|
__STATIC_INLINE void | nrf_bitmask_masks_or (void const *p_mask1, void const *p_mask2, void *p_out_mask, size_t length) |
| Function for performing bitwise OR operation on two multi-byte bit masks.
|
|
__STATIC_INLINE void | nrf_bitmask_masks_and (void const *p_mask1, void const *p_mask2, void *p_out_mask, size_t length) |
| Function for performing bitwise AND operation on two multi-byte bit masks.
|
|
Bitmask managing module.
◆ BITMASK_BYTES_CALCULATE
#define BITMASK_BYTES_CALCULATE |
( |
|
bits_count | ) |
NRFX_CEIL_DIV(bits_count, 8) |
Get number of bytes needed to store the given bitmask.
- Parameters
-
[in] | bits_count | Number of bits in the bitmask. |
- Returns
- Number of bytes to store requested bit mask.
◆ nrf_bitmask_bit_clear()
__STATIC_INLINE void nrf_bitmask_bit_clear |
( |
uint32_t |
bit, |
|
|
void * |
p_mask |
|
) |
| |
Function for clearing a bit in the multi-byte bit mask.
- Parameters
-
[in] | bit | Bit index. |
[in,out] | p_mask | Pointer to mask with bit fields. |
◆ nrf_bitmask_bit_is_set()
__STATIC_INLINE bool nrf_bitmask_bit_is_set |
( |
uint32_t |
bit, |
|
|
void const * |
p_mask |
|
) |
| |
Function for checking if bit in the multi-byte bit mask is set.
- Parameters
-
[in] | bit | Bit index. |
[in] | p_mask | Pointer to mask with bit fields. |
- Return values
-
true | If the specified bit is set. |
false | If the specified bit is cleared. |
◆ nrf_bitmask_bit_set()
__STATIC_INLINE void nrf_bitmask_bit_set |
( |
uint32_t |
bit, |
|
|
void * |
p_mask |
|
) |
| |
Function for setting a bit in the multi-byte bit mask.
- Parameters
-
[in] | bit | Bit index. |
[in,out] | p_mask | Pointer to mask with bit fields. |
◆ nrf_bitmask_masks_and()
__STATIC_INLINE void nrf_bitmask_masks_and |
( |
void const * |
p_mask1, |
|
|
void const * |
p_mask2, |
|
|
void * |
p_out_mask, |
|
|
size_t |
length |
|
) |
| |
Function for performing bitwise AND operation on two multi-byte bit masks.
- Parameters
-
[in] | p_mask1 | Pointer to the first bit mask. |
[in] | p_mask2 | Pointer to the second bit mask. |
[out] | p_out_mask | Pointer to the output bit mask. |
[in] | length | Length of output mask in bytes. |
◆ nrf_bitmask_masks_or()
__STATIC_INLINE void nrf_bitmask_masks_or |
( |
void const * |
p_mask1, |
|
|
void const * |
p_mask2, |
|
|
void * |
p_out_mask, |
|
|
size_t |
length |
|
) |
| |
Function for performing bitwise OR operation on two multi-byte bit masks.
- Parameters
-
[in] | p_mask1 | Pointer to the first bit mask. |
[in] | p_mask2 | Pointer to the second bit mask. |
[out] | p_out_mask | Pointer to the output bit mask. |
[in] | length | Length of output mask in bytes. |