Wirepas SDK
bitfield.h File Reference

Go to the source code of this file.

Typedefs

typedef uint8_t bitfield_t
 

Macros

#define BITFIELD_T_SIZE   (sizeof(bitfield_t) * 8)
 
#define BITFIELD_SET(arr, bit)   ((arr)[ ((bit) / BITFIELD_T_SIZE ) ]) |= (1 << ((bit) % BITFIELD_T_SIZE))
 
#define BITFIELD_CLEAR(arr, bit)   ((arr)[ ((bit) / BITFIELD_T_SIZE ) ]) &= ~(1 << ((bit) % BITFIELD_T_SIZE))
 
#define BITFIELD_GET(arr, bit)   (((arr)[ ((bit) / BITFIELD_T_SIZE) ]) & (1 << ((bit) % BITFIELD_T_SIZE)))
 

Typedef Documentation

◆ bitfield_t

typedef uint8_t bitfield_t

Definition at line 4 of file bitfield.h.

Macro Definition Documentation

◆ BITFIELD_CLEAR

#define BITFIELD_CLEAR (   arr,
  bit 
)    ((arr)[ ((bit) / BITFIELD_T_SIZE ) ]) &= ~(1 << ((bit) % BITFIELD_T_SIZE))

Definition at line 12 of file bitfield.h.

◆ BITFIELD_GET

#define BITFIELD_GET (   arr,
  bit 
)    (((arr)[ ((bit) / BITFIELD_T_SIZE) ]) & (1 << ((bit) % BITFIELD_T_SIZE)))

Definition at line 15 of file bitfield.h.

◆ BITFIELD_SET

#define BITFIELD_SET (   arr,
  bit 
)    ((arr)[ ((bit) / BITFIELD_T_SIZE ) ]) |= (1 << ((bit) % BITFIELD_T_SIZE))

Definition at line 8 of file bitfield.h.

◆ BITFIELD_T_SIZE

#define BITFIELD_T_SIZE   (sizeof(bitfield_t) * 8)

Definition at line 6 of file bitfield.h.