modm API documentation for NUCLEO-F429ZI
|
#include <modm/architecture/interface/register.hpp>
Public Typedefs | |
typedef Enum | EnumType |
The enum type. | |
typedef T | UnderlyingType |
The integer type internally used to represent the register. | |
Public Member Functions | |
constexpr FlagsOperators | operator~ () const |
bitwise negation | |
constexpr | operator bool () const |
constexpr bool | operator! () const |
Returns true if value is zero. | |
constexpr | FlagsOperators () |
default constructor initializes value to zero | |
constexpr | FlagsOperators (Enum flag) |
constructs itself out of a strongly-typed enum | |
constexpr | FlagsOperators (UnderlyingType flag) |
When explicitly called, this class constructs itself out of the underlying type. | |
constexpr | FlagsOperators (Register< T > const &o) |
When explicitly called, this class constructs itself out of the superclass. | |
constexpr | FlagsOperators (FlagsOperators const &o) = default |
Copy constructor. | |
constexpr | FlagsOperators (FlagsOperators &&o) = default |
Move constructor. | |
FlagsOperators & | operator= (FlagsOperators const &o) = default |
Copy assignment. | |
FlagsOperators & | operator= (FlagsOperators &&o) = default |
Move assignment. | |
constexpr FlagsOperators | operator& (FlagsOperators const &o) const |
bitwise AND with multiple bits | |
constexpr FlagsOperators | operator| (FlagsOperators const &o) const |
bitwise OR with multiple bits | |
constexpr FlagsOperators | operator^ (FlagsOperators const &o) const |
bitwise XOR with multiple bits | |
FlagsOperators & | operator&= (FlagsOperators const &o) |
bitwise AND with multiple bits | |
FlagsOperators & | operator|= (FlagsOperators const &o) |
bitwise OR with multiple bits | |
FlagsOperators & | operator^= (FlagsOperators const &o) |
bitwise XOR with multiple bits | |
FlagsOperators & | operator&= (Enum const &flag) |
bitwise AND with a single bit | |
FlagsOperators & | operator|= (Enum const &flag) |
bitwise OR with a single bit | |
FlagsOperators & | operator^= (Enum const &flag) |
bitwise XOR with a single bit | |
Static Public Member Functions | |
static constexpr FlagsOperators | mask () |
returns the mask of the integer type | |
Public Attributes | |
UnderlyingType | value |
The underlying integer value. | |
Friends | |
constexpr friend FlagsOperators | operator& (Enum const &a, FlagsOperators const &b) |
bitwise AND with a single bit | |
constexpr friend FlagsOperators | operator| (Enum const &a, FlagsOperators const &b) |
bitwise OR with a single bit | |
constexpr friend FlagsOperators | operator^ (Enum const &a, FlagsOperators const &b) |
bitwise XOR with a single bit | |
constexpr friend FlagsOperators | operator& (FlagsOperators const &a, Enum const &b) |
bitwise AND with a single bit | |
constexpr friend FlagsOperators | operator| (FlagsOperators const &a, Enum const &b) |
bitwise OR with a single bit | |
constexpr friend FlagsOperators | operator^ (FlagsOperators const &a, Enum const &b) |
bitwise XOR with a single bit | |
constexpr friend FlagsOperators | operator& (Enum const &a, Enum const &b) |
bitwise AND with a single bit | |
constexpr friend FlagsOperators | operator| (Enum const &a, Enum const &b) |
bitwise OR with a single bit | |
constexpr friend FlagsOperators | operator^ (Enum const &a, Enum const &b) |
bitwise XOR with a single bit | |
constexpr friend bool | operator== (FlagsOperators const &a, Enum const &b) |
constexpr friend bool | operator!= (FlagsOperators const &a, Enum const &b) |
constexpr friend bool | operator== (Enum const &a, FlagsOperators const &b) |
constexpr friend bool | operator!= (Enum const &a, FlagsOperators const &b) |
Class for operating on a register.
This class extends the Register base class by adding constructor and bitwise operation overloading between a strongly-typed enum and itself. It is the common base class for Flags, Configurations and Values!
Enum | a strongly-typed enum containing the bit masks |
T | the underlying integer type to be for internal representation |
|
inheritedinlineexplicitconstexpr |
Returns true
if value
is non-zero
The compiler will allow implicit conversions to bool in the following contexts:
|
friend |
Compares if two flags are equal