Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Determines if all the specified bits in a value are set according to a specified bit mask.

Files

lib_def.h

Prototype

          DEF_BIT_IS_SET(val, mask);

Arguments

val

Value to test if the specified bits are set.

mask

Mask of bits to check if set in the value.

Returned Value

DEF_YES

If all the bits in the bit mask a reset in val;

DEF_NO

if all the bits in the bit mask are not set in val.

Required Configuration

None.

Notes / Warnings

val and mask should be unsigned integers. NULL mask (i.e., mask of value 0) allowed; returns DEF_NO since no mask bits specified.

Example Usage

          CPU_INT16U  flags;
          CPU_INT16U  flags_mask;
          CPU_INT16U  flags_set;
           
          flags      = 0x0369u;
          flags_mask = DEF_BIT_08 | DEF_BIT_09;
          flags_set  = DEF_BIT_IS_SET(flags, flags_mask);
  • No labels