RKH
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Definition library

Files

file  rkhdef.h
 Platform - independent file that contains standard constants and macros.
 

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

Macro Definition Documentation

#define RKH_BIT (   bit)    (1u << (bit))

Create bit mask with single, specified bit set.

Parameters
[in]bitBit number of bit to set.
Returns
Bit mask with single, specified bit set.

Definition at line 87 of file rkhdef.h.

#define RKH_BIT08 (   bit)    ((rui8_t)((rui8_t) 1u << (bit)))

Create bit mask of specified bit size with single, specified bit set.

Parameters
[in]bitBit number of bit to set.
Returns
Bit mask with single, specified bit set.

Definition at line 100 of file rkhdef.h.

#define RKH_BIT_MASK (   bit_mask,
  bit_shift 
)    ((bit_mask) << (bit_shift))

Shift a bit mask.

Parameters
[in]bit_maskBit mask to shift.
[in]bit_shiftNumber of bit positions to left-shift bit mask.
Returns
Shifted bit mask.

Definition at line 117 of file rkhdef.h.

#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.

Parameters
[in]bit_maskBit mask to shift.
[in]bit_shiftNumber of bit positions to left-shift bit mask.
Returns
Shifted bit mask.

Definition at line 132 of file rkhdef.h.

#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.

Parameters
[in]valValue to modify by setting specified bit(s).
[in]maskMask of bits to set.
Returns
Modified value with specified bit(s) set.

Definition at line 152 of file rkhdef.h.

#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.

Parameters
[in]valValue to modify by clearing specified bit(s).
[in]maskMask of bits to clear.
Returns
Modified value with specified bit(s) clear.

Definition at line 172 of file rkhdef.h.

#define RKH_BIT_IS_SET (   val,
  mask 
)
Value:
((((mask) != 0u) && \
(((val) & (mask)) == (mask))) ? (RKH_YES) : (RKH_NO))
#define RKH_NO
Standard define.
Definition: rkhdef.h:258
#define RKH_YES
Standard define.
Definition: rkhdef.h:259

Determine if specified bit(s) in a value are set.

Parameters
[in]valValue to check for specified bit(s) set.
[in]maskMask of bits to check if set.
Returns
RKH_YES, if ALL specified bit(s) are set in value. RKH_NO, if ALL specified bit(s) are NOT set in value.

Definition at line 193 of file rkhdef.h.

#define RKH_BIT_IS_CLR (   val,
  mask 
)
Value:
((((mask) != 0u) && \
(((val) & (mask)) == 0u)) ? (RKH_YES) : (RKH_NO))
#define RKH_NO
Standard define.
Definition: rkhdef.h:258
#define RKH_YES
Standard define.
Definition: rkhdef.h:259

Determine if specified bit(s) in a value are clear.

Parameters
[in]valValue to check for specified bit(s) clear.
[in]maskMask of bits to check if clear.
Returns
RKH_YES, if ALL specified bit(s) are clear in value. RKH_NO, if ALL specified bit(s) are NOT clear in value.

Definition at line 210 of file rkhdef.h.

#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.

Parameters
[in]valValue to check for specified bit(s) set.
[in]maskMask of bits to check if set.
Returns
RKH_YES, if ALL specified bit(s) are set in value. RKH_NO, if ALL specified bit(s) are NOT set in value.

Definition at line 227 of file rkhdef.h.

#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.

Parameters
[in]valValue to check for specified bit(s) clear.
[in]maskMask of bits to check if clear.
Returns
RKH_YES, if ALL specified bit(s) are clear in value. RKH_NO, if ALL specified bit(s) are NOT clear in value.

Definition at line 243 of file rkhdef.h.

#define RKH_BIT16 (   bit)    ((rui16_t)((rui16_t) 1u << (bit)))

Create bit mask of specified bit size with single, specified bit set.

Parameters
[in]bitBit number of bit to set.
Returns
Bit mask with single, specified bit set.

Definition at line 101 of file rkhdef.h.

#define RKH_BIT32 (   bit)    ((rui32_t)((rui32_t) 1u << (bit)))

Create bit mask of specified bit size with single, specified bit set.

Parameters
[in]bitBit number of bit to set.
Returns
Bit mask with single, specified bit set.

Definition at line 102 of file rkhdef.h.

#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.

Parameters
[in]bit_maskBit mask to shift.
[in]bit_shiftNumber of bit positions to left-shift bit mask.
Returns
Shifted bit mask.

Definition at line 134 of file rkhdef.h.

#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.

Parameters
[in]bit_maskBit mask to shift.
[in]bit_shiftNumber of bit positions to left-shift bit mask.
Returns
Shifted bit mask.

Definition at line 136 of file rkhdef.h.

#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.

Parameters
[in]valValue to modify by setting specified bit(s).
[in]maskMask of bits to set.
Returns
Modified value with specified bit(s) set.

Definition at line 154 of file rkhdef.h.

#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.

Parameters
[in]valValue to modify by setting specified bit(s).
[in]maskMask of bits to set.
Returns
Modified value with specified bit(s) set.

Definition at line 156 of file rkhdef.h.

#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.

Parameters
[in]valValue to modify by clearing specified bit(s).
[in]maskMask of bits to clear.
Returns
Modified value with specified bit(s) clear.

Definition at line 174 of file rkhdef.h.

#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.

Parameters
[in]valValue to modify by clearing specified bit(s).
[in]maskMask of bits to clear.
Returns
Modified value with specified bit(s) clear.

Definition at line 176 of file rkhdef.h.