Creates a bit mask based on a single bit-number position.
Files
lib_def.h
Prototypes
Arguments
bit
Bit number of the bit mask to set.
Returned Value
Bit mask with the single bit
number position set.
Required Configuration
None.
Notes / Warnings
bit
should be a non-negative integer.
bit
values that overflow the target CPU and/or compiler environment (e.g. negative or greater-than-CPU-data-size values) may generate compiler warnings and/or errors.
To avoid overflowing any target CPU and/or compiler’s integer data type, unsigned bit constant 1
is either cast to specified integer data type size or suffixed with long
integer modifier, ‘L
’. This may still be insufficient for CPUs and/or compilers that support long long
integer data types, in which case ‘LL
’ integer modifier should be suffixed. However, since almost all 16- and 32-bit CPUs and compilers support long
integer data types but many may not support long long
integer data types, only long
integer data types and modifiers are supported.