sarmfsw: SMFSW Toolbox (for ARM & compatible with Arduino platform) 3.7
SMFSW collection of miscellaneous functions & macros (for ARM & compatible with Arduino platform)
|
Binary manipulation inlines. More...
Functions | |
DWORD | maskBits (const BYTE bits) |
Create specified number of bits mask. | |
BYTE | nbBitsState (const DWORD val, const BYTE bits, const BOOL state) |
Check the number of clear/set bits in a variable. | |
SDWORD | getMSBitSet (const DWORD val) |
Get power of 2 of the most significant set bit. | |
DWORD | swapBits (const DWORD val, const BYTE bits) |
Swap specified number of bits in value (mirroring bits) | |
Binary manipulation inlines.
Get power of 2 of the most significant set bit.
[in] | val | - Variable to check for bits |
>=0 | Index (power of 2) of most significant bit set |
-1 | no bit set |
Create specified number of bits mask.
[in] | bits | - Number of bits to create mask |
Check the number of clear/set bits in a variable.
[in] | val | - Variable to check for bits |
[in] | bits | - Number of bits to check |
[in] | state | - Logic state to check |