|
enum | Access { RW
, ReadOnly
} |
|
|
| bitfield (bitfield_register< datatype_t > ®, std::string name, size_t bitOffset, size_t bitSize, std::string urid, Access access=RW) |
|
| bitfield (const bitfield &)=delete |
|
bitfield & | operator= (const bitfield &)=delete |
|
void | write (datatype_t &valueToWrite) override |
|
datatype_t | read () override |
|
constexpr datatype_t | get () const |
|
void | put (datatype_t value) |
|
constexpr | operator datatype_t () const |
|
bitfield< datatype_t > & | operator= (datatype_t other) |
|
void | setWriteCallback (std::function< void(bitfield< datatype_t > &, datatype_t &valueToWrite)> callback) |
|
void | setReadCallback (std::function< datatype_t(const bitfield< datatype_t > &)> callback) |
|
constexpr | abstract_bitfield (std::string name, size_t bitOffset, size_t bitSize, std::string urid) |
|
constexpr bool | affected (size_t byteOffset, size_t byteLength) const noexcept |
|
constexpr datatype_t | mask () const noexcept |
|
|
bitfield_register< datatype_t > & | reg |
|
Access | access |
|
const size_t | bitOffset |
|
const size_t | bitSize |
|
const std::string | name |
|
const std::string | urid |
|
|
std::function< void(bitfield< datatype_t > &, datatype_t &)> | writeCallback |
|
std::function< datatype_t(const bitfield< datatype_t > &)> | readCallback |
|
template<typename datatype_t>
class scc::bitfield< datatype_t >
Definition at line 228 of file tlm_target_bfs_register_base.h.
◆ bitfield()
template<typename datatype_t >
- Parameters
-
reg | The register that contains this bitfield |
name | The name of this bitfield |
bitOffset | the position of this bitfield in the containing register |
bitSize | the size of this bitfield |
urid | Unique resource id. Must be unique accross all bitfields in a peripheral |
access | If RO writes to this bitfield are ignored. |
Definition at line 244 of file tlm_target_bfs_register_base.h.
◆ get()
template<typename datatype_t >
◆ operator datatype_t()
template<typename datatype_t >
constexpr scc::bitfield< datatype_t >::operator datatype_t |
( |
| ) |
const |
|
inlineconstexpr |
◆ operator=()
template<typename datatype_t >
◆ put()
template<typename datatype_t >
◆ setReadCallback()
template<typename datatype_t >
void scc::bitfield< datatype_t >::setReadCallback |
( |
std::function< datatype_t(const bitfield< datatype_t > &)> |
callback | ) |
|
|
inline |
Register a callback
that gets called on read. Overwrites previously stored callbacks. Signature: datatype_t onRead(const bitfield<datatype_t>& bf)
Callback is called before the register.
Definition at line 308 of file tlm_target_bfs_register_base.h.
◆ setWriteCallback()
template<typename datatype_t >
void scc::bitfield< datatype_t >::setWriteCallback |
( |
std::function< void(bitfield< datatype_t > &, datatype_t &valueToWrite)> |
callback | ) |
|
|
inline |
Register a callback
that is called on write. Overwrites previously stored callbacks. Signature: void onWrite(bitfield<datatype_t>& bf, datatype_t& valueToWrite)
Callback is called before the register.
If you want to change the value that gets written to the bitfield change the value of the parameter valueToWrite. Direct writes to the bitfield do not work.
Definition at line 298 of file tlm_target_bfs_register_base.h.
The documentation for this class was generated from the following file: