FastArduino
v1.8
C++ library to build fast but small Arduino/AVR projects

Defines utility methods for bits manipulation. More...
Functions  
static constexpr uint8_t  BV8 (uint8_t bit) 
Create a uint8_t bitmask for the given bit number. More...  
static constexpr uint8_t  BV8 (uint8_t bit1, uint8_t bit2) 
Create a uint8_t bitmask for the given bits numbers. More...  
static constexpr uint8_t  BV8 (uint8_t bit1, uint8_t bit2, uint8_t bit3) 
Create a uint8_t bitmask for the given bits numbers. More...  
static constexpr uint8_t  BV8 (uint8_t bit1, uint8_t bit2, uint8_t bit3, uint8_t bit4) 
Create a uint8_t bitmask for the given bits numbers. More...  
static constexpr uint8_t  BV8 (uint8_t bit1, uint8_t bit2, uint8_t bit3, uint8_t bit4, uint8_t bit5) 
Create a uint8_t bitmask for the given bits numbers. More...  
static constexpr uint8_t  BV8 (uint8_t bit1, uint8_t bit2, uint8_t bit3, uint8_t bit4, uint8_t bit5, uint8_t bit6) 
Create a uint8_t bitmask for the given bits numbers. More...  
static constexpr uint8_t  CBV8 (uint8_t bit) 
Create a uint8_t inverted bitmask for the given bit number. More...  
static constexpr uint16_t  BV16 (uint8_t bit) 
Create a uint16_t bitmask for the given bit number. More...  
static constexpr uint16_t  BV16 (uint8_t bit1, uint8_t bit2) 
Create a uint16_t bitmask for the given bits numbers. More...  
static constexpr uint16_t  BV16 (uint8_t bit1, uint8_t bit2, uint8_t bit3) 
Create a uint16_t bitmask for the given bits numbers. More...  
static constexpr uint16_t  BV16 (uint8_t bit1, uint8_t bit2, uint8_t bit3, uint8_t bit4) 
Create a uint16_t bitmask for the given bits numbers. More...  
static constexpr uint16_t  BV16 (uint8_t bit1, uint8_t bit2, uint8_t bit3, uint8_t bit4, uint8_t bit5) 
Create a uint16_t bitmask for the given bits numbers. More...  
static constexpr uint16_t  BV16 (uint8_t bit1, uint8_t bit2, uint8_t bit3, uint8_t bit4, uint8_t bit5, uint8_t bit6) 
Create a uint16_t bitmask for the given bits numbers. More...  
static constexpr uint16_t  CBV16 (uint8_t bit) 
Create a uint16_t inverted bitmask for the given bit number. More...  
static constexpr uint8_t  COMPL (uint8_t value) 
Return the uint8_t 2complement of a byte. More...  
static constexpr uint8_t  LOW_BYTE (uint16_t value) 
Extract the low byte (aka Least Significant Byte, LSB) of a uint16_t value.  
static constexpr uint8_t  HIGH_BYTE (uint16_t value) 
Extract the high byte (aka Most Significant Byte, MSB) of a uint16_t value.  
Defines utility methods for bits manipulation.
Most functions defined here are constexpr
, which means that they can be evaluated at compiletime when constant arguments. These functions are used to ensure proper casting of results to the required types, i.e. uint8_t
or uint16_t
.

staticconstexpr 

staticconstexpr 
Create a uint8_t
bitmask for the given bits numbers.
Concretely, this is simply the (1 << bit1)  (1 << bit2)
expression.
bit1  the first bit number for which to produce a bitmask, should be between 0 and 7 . 
bit2  the second bit number for which to produce a bitmask, should be between 0 and 7 . 

staticconstexpr 
Create a uint8_t
bitmask for the given bits numbers.
Concretely, this is simply the (1 << bit1)  (1 << bit2) ...
expression.
bit1  the first bit number for which to produce a bitmask, should be between 0 and 7 . 
bit2  the second bit number for which to produce a bitmask, should be between 0 and 7 . 
bit3  the third bit number for which to produce a bitmask, should be between 0 and 7 . 

staticconstexpr 
Create a uint8_t
bitmask for the given bits numbers.
Concretely, this is simply the (1 << bit1)  (1 << bit2) ...
expression.
bit1  the first bit number for which to produce a bitmask, should be between 0 and 7 . 
bit2  the second bit number for which to produce a bitmask, should be between 0 and 7 . 
bit3  the third bit number for which to produce a bitmask, should be between 0 and 7 . 
bit4  the fourth bit number for which to produce a bitmask, should be between 0 and 7 . 

staticconstexpr 
Create a uint8_t
bitmask for the given bits numbers.
Concretely, this is simply the (1 << bit1)  (1 << bit2) ...
expression.
bit1  the first bit number for which to produce a bitmask, should be between 0 and 7 . 
bit2  the second bit number for which to produce a bitmask, should be between 0 and 7 . 
bit3  the third bit number for which to produce a bitmask, should be between 0 and 7 . 
bit4  the fourth bit number for which to produce a bitmask, should be between 0 and 7 . 
bit5  the fifth bit number for which to produce a bitmask, should be between 0 and 7 . 

staticconstexpr 
Create a uint8_t
bitmask for the given bits numbers.
Concretely, this is simply the (1 << bit1)  (1 << bit2) ...
expression.
bit1  the first bit number for which to produce a bitmask, should be between 0 and 7 . 
bit2  the second bit number for which to produce a bitmask, should be between 0 and 7 . 
bit3  the third bit number for which to produce a bitmask, should be between 0 and 7 . 
bit4  the fourth bit number for which to produce a bitmask, should be between 0 and 7 . 
bit5  the fifth bit number for which to produce a bitmask, should be between 0 and 7 . 
bit6  the sixth bit number for which to produce a bitmask, should be between 0 and 7 . 

staticconstexpr 

staticconstexpr 

staticconstexpr 
Create a uint16_t
bitmask for the given bits numbers.
Concretely, this is simply the (1 << bit1)  (1 << bit2)
expression.
bit1  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit2  the bit number for which to produce a bitmask, should be between 0 and 15 . 

staticconstexpr 
Create a uint16_t
bitmask for the given bits numbers.
Concretely, this is simply the (1 << bit1)  (1 << bit2) ...
expression.
bit1  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit2  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit3  the bit number for which to produce a bitmask, should be between 0 and 15 . 

staticconstexpr 
Create a uint16_t
bitmask for the given bits numbers.
Concretely, this is simply the (1 << bit1)  (1 << bit2) ...
expression.
bit1  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit2  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit3  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit4  the bit number for which to produce a bitmask, should be between 0 and 15 . 

staticconstexpr 
Create a uint16_t
bitmask for the given bits numbers.
Concretely, this is simply the (1 << bit1)  (1 << bit2) ...
expression.
bit1  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit2  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit3  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit4  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit5  the bit number for which to produce a bitmask, should be between 0 and 15 . 

staticconstexpr 
Create a uint16_t
bitmask for the given bits numbers.
Concretely, this is simply the (1 << bit1)  (1 << bit2) ...
expression.
bit1  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit2  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit3  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit4  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit5  the bit number for which to produce a bitmask, should be between 0 and 15 . 
bit6  the bit number for which to produce a bitmask, should be between 0 and 15 . 

staticconstexpr 