|
modm API documentation
|
#include <modm/architecture/interface/register.hpp>
Public Typedefs | |
| typedef Parent::EnumType | EnumType |
| The enum type. | |
Public Member Functions | |
| constexpr | Value (UnderlyingType config) |
| explicit constructor for the underlying type | |
| constexpr | Value (Value const &o) = default |
| copy constructor | |
| constexpr | Value (Value &&o) = default |
| move constructor | |
| constexpr | operator bool () const |
| constexpr bool | operator! () const |
Returns true if value is zero. | |
| constexpr FlagsOperators | operator~ () const |
| bitwise negation | |
| constexpr FlagsOperators | operator& (FlagsOperators const &o) const |
| bitwise AND with multiple bits | |
| constexpr FlagsOperators | operator^ (FlagsOperators const &o) const |
| bitwise XOR with multiple bits | |
| constexpr FlagsOperators | operator| (FlagsOperators const &o) const |
| bitwise OR with multiple bits | |
| FlagsOperators & | operator&= (FlagsOperators const &o) |
| bitwise AND with multiple bits | |
| FlagsOperators & | operator^= (FlagsOperators const &o) |
| bitwise XOR with multiple bits | |
| FlagsOperators & | operator|= (FlagsOperators const &o) |
| bitwise OR with multiple bits | |
| FlagsOperators & | operator&= (Parent::EnumType const &flag) |
| bitwise AND with a single bit | |
| FlagsOperators & | operator^= (Parent::EnumType const &flag) |
| bitwise XOR with a single bit | |
| FlagsOperators & | operator|= (Parent::EnumType const &flag) |
| bitwise OR with a single bit | |
Static Public Member Functions | |
| static constexpr Parent | mask () |
| returns the shifted mask for this value | |
| static void | set (Parent &parent, UnderlyingType config) |
| clears and sets a new value in a Flags register | |
| static void | reset (Parent &parent) |
| clears the value in a Flags register | |
| static constexpr UType | get (Parent const &parent) |
| returns the value from a Flags register | |
Public Attributes | |
| UnderlyingType | value |
| The underlying integer value. | |
Class for accessing a numeric value in a register.
A value is a combination of bits which correspond to their numerical value. An example is a 3-bit wide bit field corresponding to the start-up delay in ms.
The value class is similar to the configuration class, but a lot simpler. No enum type is needed, instead the underlying type of the parent register class is used for setting and getting the value.
| Parent | the Flags class to which this configuration belongs to |
| Width | the width in bits of the value in the register |
| Position | how many bits the configuration values need to be shifted |
|
inheritedinlineexplicitconstexpr |
Returns true if value is non-zero
The compiler will allow implicit conversions to bool in the following contexts: