nRF5 SDK v17.1.0
Macros | Functions
Bitmask module

Bitmask managing module. More...

Macros

#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) & 0x00000007)
 Macro for getting relative index of bit in byte.
 

Functions

__STATIC_INLINE uint32_t 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. More...
 
__STATIC_INLINE void nrf_bitmask_bit_set (uint32_t bit, void *p_mask)
 Function for setting a bit in the multi-byte bit mask. More...
 
__STATIC_INLINE void nrf_bitmask_bit_clear (uint32_t bit, void *p_mask)
 Function for clearing a bit in the multi-byte bit mask. More...
 
__STATIC_INLINE void nrf_bitmask_masks_or (void const *p_mask1, void const *p_mask2, void *p_out_mask, uint32_t length)
 Function for performing bitwise OR operation on two multi-byte bit masks. More...
 
__STATIC_INLINE void nrf_bitmask_masks_and (void const *p_mask1, void const *p_mask2, void *p_out_mask, uint32_t length)
 Function for performing bitwise AND operation on two multi-byte bit masks. More...
 

Detailed Description

Bitmask managing module.

Function Documentation

__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]bitBit index.
[in]p_maskPointer to mask with bit fields.
__STATIC_INLINE uint32_t 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]bitBit index.
[in]p_maskPointer to mask with bit fields.
Returns
0 if bit is not set, positive value otherwise.
__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]bitBit index.
[in]p_maskPointer to mask with bit fields.
__STATIC_INLINE void nrf_bitmask_masks_and ( void const *  p_mask1,
void const *  p_mask2,
void *  p_out_mask,
uint32_t  length 
)

Function for performing bitwise AND operation on two multi-byte bit masks.

Parameters
[in]p_mask1Pointer to the first bit mask.
[in]p_mask2Pointer to the second bit mask.
[in]p_out_maskPointer to the output bit mask.
[in]lengthLength of output mask in bytes.
__STATIC_INLINE void nrf_bitmask_masks_or ( void const *  p_mask1,
void const *  p_mask2,
void *  p_out_mask,
uint32_t  length 
)

Function for performing bitwise OR operation on two multi-byte bit masks.

Parameters
[in]p_mask1Pointer to the first bit mask.
[in]p_mask2Pointer to the second bit mask.
[in]p_out_maskPointer to the output bit mask.
[in]lengthLength of output mask in bytes.

Documentation feedback | Developer Zone | Subscribe | Updated