RKH
rkhdef.h File Reference

Defines constants and macros. More...

Go to the source code of this file.

Macros

#define RKH_BIT(bit)    (1u << (bit))
 Create bit mask with single, specified bit set. More...
 
#define RKH_BIT_MASK(bit_mask, bit_shift)   ((bit_mask) << (bit_shift))
 Shift a bit mask. More...
 
#define RKH_BIT_IS_SET(val, mask)
 Determine if specified bit(s) in a value are set. More...
 
#define RKH_BIT_IS_CLR(val, mask)
 Determine if specified bit(s) in a value are clear. More...
 
#define RKH_BIT_IS_SET_ANY(val, mask)   ((((val) & (mask)) == 0u) ? (RKH_NO) : (RKH_YES))
 Determine if any specified bit(s) in a value are set. More...
 
#define RKH_BIT_IS_CLR_ANY(val, mask)   ((((val) & (mask)) == (mask)) ? (RKH_NO) : (RKH_YES))
 Determine if any specified bit(s) in a value are clear. More...
 
#define RKH_BIT08(bit)    ((rui8_t)((rui8_t) 1u << (bit)))
 Create bit mask of specified bit size with single, specified bit set. More...
 
#define RKH_BIT16(bit)    ((rui16_t)((rui16_t) 1u << (bit)))
 Create bit mask of specified bit size with single, specified bit set. More...
 
#define RKH_BIT32(bit)    ((rui32_t)((rui32_t) 1u << (bit)))
 Create bit mask of specified bit size with single, specified bit set. More...
 
#define RKH_BIT_MASK_08(bit_mask, bit_shift)   ((rui8_t)((rui8_t)(bit_mask) << (bit_shift)))
 Shift a bit mask of specified bit size. More...
 
#define RKH_BIT_MASK_16(bit_mask, bit_shift)   ((rui16_t)((rui16_t)(bit_mask) << (bit_shift)))
 Shift a bit mask of specified bit size. More...
 
#define RKH_BIT_MASK_32(bit_mask, bit_shift)   ((rui32_t)((rui32_t)(bit_mask) << (bit_shift)))
 Shift a bit mask of specified bit size. More...
 
#define RKH_BIT_SET_08(val, mask)   ((val) = (rui8_t)(((rui8_t)(val)) | ((rui8_t)(mask))))
 Set specified bit(s) in a value of specified bit size. More...
 
#define RKH_BIT_SET_16(val, mask)   ((val) = (rui16_t)(((rui16_t)(val)) | ((rui16_t)(mask))))
 Set specified bit(s) in a value of specified bit size. More...
 
#define RKH_BIT_SET_32(val, mask)   ((val) = (rui32_t)(((rui32_t)(val)) | ((rui32_t)(mask))))
 Set specified bit(s) in a value of specified bit size. More...
 
#define RKH_BIT_CLR_08(val, mask)   ((val) = (rui8_t)(((rui8_t)(val)) & ((rui8_t) ~(mask))))
 Clear specified bit(s) in a value of specified bit size. More...
 
#define RKH_BIT_CLR_16(val, mask)   ((val) = (rui16_t)(((rui16_t)(val)) & ((rui16_t) ~(mask))))
 Clear specified bit(s) in a value of specified bit size. More...
 
#define RKH_BIT_CLR_32(val, mask)   ((val) = (rui32_t)(((rui32_t)(val)) & ((rui32_t) ~(mask))))
 Clear specified bit(s) in a value of specified bit size. More...
 
#define RKH_FALSE   0u
 Standard define.
 
#define RKH_TRUE   1u
 Standard define.
 
#define RKH_NO   0u
 Standard define.
 
#define RKH_YES   1u
 Standard define.
 
#define RKH_DISABLED   0u
 Standard define.
 
#define RKH_ENABLED   1u
 Standard define.
 
#define RKH_INACTIVE   0u
 Standard define.
 
#define RKH_ACTIVE   1u
 Standard define.
 
#define RKH_INVALID   0u
 Standard define.
 
#define RKH_VALID   1u
 Standard define.
 
#define RKH_OFF   0u
 Standard define.
 
#define RKH_ON   1u
 Standard define.
 
#define RKH_CLR   0u
 Standard define.
 
#define RKH_SET   1u
 Standard define.
 
#define RKH_FAIL   0u
 Standard define.
 
#define RKH_OK   1u
 Standard define.
 

Detailed Description

Defines constants and macros.

All constants and macros are prefixed with RKH_ to provide a consistent naming convention and to avoid namespace conflicts with other constants and macros in your application.

Definition in file rkhdef.h.