hsk-libs-dev  270
High Speed Karlsruhe XC878 library collection
Macros
Variable Access

This group specifies macros to access bits of a variable. More...

Macros

#define IO_VAR_SET(var, bits, on, set)
 Set a set of variable bits. More...
 
#define IO_VAR_GET(var, bits, on)
 Evaluates to a bit mask of logical states of a variable. More...
 

Detailed Description

This group specifies macros to access bits of a variable.

Their value lies in the seperation of encoded on state and logical on (1), as well as the safe bit masking.

Macro Definition Documentation

§ IO_VAR_GET

#define IO_VAR_GET (   var,
  bits,
  on 
)
Value:
( \
((var) ^ ~(on)) & (bits) \
)

Evaluates to a bit mask of logical states of a variable.

Parameters
varThe variable to access
bitsA bit mask of the bits to select
onA bit mask that defines the states which represent true

§ IO_VAR_SET

#define IO_VAR_SET (   var,
  bits,
  on,
  set 
)
Value:
{\
(var) &= ((set) ^ ~(on)) | ~(bits); \
(var) |= ((set) ^ ~(on)) & (bits); \
}

Set a set of variable bits.

Parameters
varThe variable to set
bitsA bit mask of the bits to select
onA bit mask that defines the states which represent true
setSet logical values for the defined bits