Bitfield abstraction. Provides a way to read from, write to and pass around bitfields within registers as if they were normal variables.
More...
#include <registers.hpp>
|
static constexpr SizeType | Mask = ((1ULL << u64(To - From + 1)) - 1) << From |
| Mask to access the bitfield's bits. More...
|
|
template<u32 BaseAddress, typename SizeType, u8 From, u8 To>
struct bsp::BitField< BaseAddress, SizeType, From, To >
Bitfield abstraction. Provides a way to read from, write to and pass around bitfields within registers as if they were normal variables.
- Template Parameters
-
BaseAddress | Register base address |
SizeType | Register size |
From | First bit to include in bitfield |
To | Last bit to include in bitfield |
◆ BitField()
template<u32 BaseAddress, typename SizeType , u8 From, u8 To>
◆ operator SizeType()
template<u32 BaseAddress, typename SizeType , u8 From, u8 To>
SizeType conversion operator overload.
- Returns
- Value in bitfield
◆ operator=()
template<u32 BaseAddress, typename SizeType , u8 From, u8 To>
template<typename T >
Assignment operator overload.
- Template Parameters
-
T | Type of parameter. Must be unsigned |
- Parameters
-
value | Value to assign to bitfield |
- Returns
- new value in bitfield
◆ Mask
template<u32 BaseAddress, typename SizeType , u8 From, u8 To>
constexpr SizeType bsp::BitField< BaseAddress, SizeType, From, To >::Mask = ((1ULL << u64(To - From + 1)) - 1) << From |
|
staticconstexpr |
Mask to access the bitfield's bits.
The documentation for this struct was generated from the following file: