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

Useful bits manipulation utilities. More...

#include <stdint.h>
Include dependency graph for bits.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 bits
 Defines utility methods for bits manipulation.
 

Functions

static constexpr uint8_t bits::BV8 (uint8_t bit)
 Create a uint8_t bitmask for the given bit number. More...
 
static constexpr uint8_t bits::BV8 (uint8_t bit1, uint8_t bit2)
 Create a uint8_t bitmask for the given bits numbers. More...
 
static constexpr uint8_t bits::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 bits::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 bits::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 bits::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 bits::CBV8 (uint8_t bit)
 Create a uint8_t inverted bitmask for the given bit number. More...
 
static constexpr uint16_t bits::BV16 (uint8_t bit)
 Create a uint16_t bitmask for the given bit number. More...
 
static constexpr uint16_t bits::BV16 (uint8_t bit1, uint8_t bit2)
 Create a uint16_t bitmask for the given bits numbers. More...
 
static constexpr uint16_t bits::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 bits::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 bits::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 bits::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 bits::CBV16 (uint8_t bit)
 Create a uint16_t inverted bitmask for the given bit number. More...
 
static constexpr uint8_t bits::COMPL (uint8_t value)
 Return the uint8_t 2-complement of a byte. More...
 
static constexpr uint8_t bits::LOW_BYTE (uint16_t value)
 Extract the low byte (aka Least Significant Byte, LSB) of a uint16_t value.
 
static constexpr uint8_t bits::HIGH_BYTE (uint16_t value)
 Extract the high byte (aka Most Significant Byte, MSB) of a uint16_t value.
 

Detailed Description

Useful bits manipulation utilities.

Definition in file bits.h.