|
Embedded Artistry Framework
Embedded Systems C++ Framework
|
Safer types for working with special-function registers. More...
|
Classes | |
| struct | embutil::rw |
| Register access permissions. More... | |
| struct | embutil::ro |
| Read-only access permission tag. More... | |
| struct | embutil::wo |
| Write-only access permission tag. More... | |
| class | embutil::sfr< TPerm, T, TAddr, StaticAddress > |
| class | embutil::sfr< TPerm, T, TAddr, typename std::enable_if< TAddr==0 >::type > |
| SFR Class which supports address assignment with a constructor. More... | |
| class | embutil::sfr< TPerm, T, TAddr, typename std::enable_if_t< TAddr !=0, void > > |
| This variant of the SFR class is used when the address is known at compile-time. More... | |
Safer types for working with special-function registers.
| struct embutil::rw |
Register access permissions.
Read-write access permission tag.
| struct embutil::ro |
Read-only access permission tag.
| struct embutil::wo |
Write-only access permission tag.
| class embutil::sfr |
| TPerm | Tag value indicating the permissions to use for this register. Should be rw, rw, or wo. |
| T | The type corresponding to the SFR representation (i.e., uint32_t on 32-bit systems). |
| TAddr | The address of the SFR. If the address is 0, it can be assigned during object constrution. Otherwise, the address of TAddr is locked in at compile-time. |
| StaticAddress | SFINAE-enabling parameter. You don't need to use this. |
| class embutil::sfr< TPerm, T, TAddr, typename std::enable_if< TAddr==0 >::type > |
SFR Class which supports address assignment with a constructor.
This variant of the SFR class assigns the register value when the object is created. With an optmizer, this will often result in the same as the static-definition variant.

Public Types | |
| using | ptr_t = volatile T * |
| using | const_ptr_t = volatile const T * |
| using | ref_t = volatile T & |
| using | const_ref_t = volatile const T & |
Public Member Functions | |
| sfr (uintptr_t address) noexcept | |
| Construct an SFR with an address. More... | |
| sfr (uintptr_t address, T value) noexcept | |
| Construct an SFR with an address and value. More... | |
| sfr (T *address) noexcept | |
| Construct an SFR with a pointer. More... | |
| sfr (T *address, T value) noexcept | |
| Construct an SFR with a pointer and value. More... | |
| sfr (const sfr &)=delete | |
| Delete the copy constructor. More... | |
| const sfr & | operator= (const sfr &)=delete |
| Delete the copy assignment operator. More... | |
| sfr (sfr &&)=default | |
| sfr & | operator= (sfr &&)=default |
| ~sfr ()=default | |
| Default destructor. More... | |
| constexpr uintptr_t | address () const noexcept |
| Get the address of this SFR. More... | |
| T | load () const noexcept |
| Read from register, explicit operation. More... | |
| operator T () const noexcept | |
| Read from register, read-only dereference. More... | |
| operator T () noexcept | |
| Read from register. More... | |
| void | store (T value) noexcept |
| Write to the register. More... | |
| sfr & | operator= (T value_) noexcept |
| Write via copy/assignment. More... | |
| ref_t | operator * () noexcept |
| Read/write dereference. More... | |
| const_ref_t | operator * () const noexcept |
| Read-only dereference. More... | |
| sfr & | operator++ () noexcept |
| Increment operator is a no-op, but is used for iterator compatibility. More... | |
| sfr | operator++ (int) noexcept |
| Increment operator is a no-op, but is used for iterator compatibility. More... | |
Protected Attributes | |
| const uintptr_t | addr_ |
| The address of the SFR. More... | |
| using embutil::sfr< TPerm, T, TAddr, typename std::enable_if< TAddr==0 >::type >::const_ptr_t = volatile const T* |
| using embutil::sfr< TPerm, T, TAddr, typename std::enable_if< TAddr==0 >::type >::const_ref_t = volatile const T& |
| using embutil::sfr< TPerm, T, TAddr, typename std::enable_if< TAddr==0 >::type >::ptr_t = volatile T* |
| using embutil::sfr< TPerm, T, TAddr, typename std::enable_if< TAddr==0 >::type >::ref_t = volatile T& |
|
inlineexplicitnoexcept |
Construct an SFR with an address.
| [in] | address | The address in memory that this SFR points to. |
|
inlineexplicitnoexcept |
Construct an SFR with an address and value.
| [in] | address | The address in memory that this SFR points to. |
| [in] | value | The initial value to set. |
|
inlineexplicitnoexcept |
Construct an SFR with a pointer.
| [in] | address | The pointer that this SFR points to. |
|
inlineexplicitnoexcept |
Construct an SFR with a pointer and value.
| [in] | address | The pointer that this SFR points to. |
| [in] | value | The initial value to set. |
|
delete |
Delete the copy constructor.
|
default |
|
default |
Default destructor.
|
inlinenoexcept |
Get the address of this SFR.
|
inlinenoexcept |
Read from register, explicit operation.
|
inlinenoexcept |
Read/write dereference.
|
inlinenoexcept |
Read-only dereference.
|
inlinenoexcept |
Read from register, read-only dereference.
|
inlinenoexcept |
Read from register.
|
inlinenoexcept |
Increment operator is a no-op, but is used for iterator compatibility.
|
inlinenoexcept |
Increment operator is a no-op, but is used for iterator compatibility.
|
delete |
Delete the copy assignment operator.
|
default |
|
inlinenoexcept |
Write via copy/assignment.
| [in] | value_ | The value to write to the SFR. |
|
inlinenoexcept |
Write to the register.
| [in] | value | The value to write to the SFR. |
|
protected |
The address of the SFR.
| class embutil::sfr< TPerm, T, TAddr, typename std::enable_if_t< TAddr !=0, void > > |
This variant of the SFR class is used when the address is known at compile-time.

Public Types | |
| using | ptr_t = volatile T * |
| using | const_ptr_t = volatile const T * |
| using | ref_t = volatile T & |
| using | const_ref_t = volatile const T & |
Public Member Functions | |
| sfr ()=default | |
| Default constructor. More... | |
| sfr (T value) noexcept | |
| Construct an SFR and set a value. More... | |
| ~sfr ()=default | |
| Default destructor. More... | |
| sfr (const sfr &)=delete | |
| Delete the copy constructor. More... | |
| const sfr & | operator= (const sfr &)=delete |
| Delete the copy assignment operator. More... | |
| sfr (sfr &&)=default | |
| sfr & | operator= (sfr &&)=default |
| constexpr uintptr_t | address () const noexcept |
| Get the address of this SFR. More... | |
| T | load () const noexcept |
| Read from register, explicit operation. More... | |
| operator T () const noexcept | |
| Read from register, read-only dereference. More... | |
| operator T () noexcept | |
| Read from register. More... | |
| void | store (T value) noexcept |
| Write to the register. More... | |
| sfr & | operator= (T value_) noexcept |
| Write via copy/assignment. More... | |
| ref_t | operator * () noexcept |
| Read/write dereference. More... | |
| const_ref_t | operator * () const noexcept |
| Read-only dereference. More... | |
| sfr & | operator++ () noexcept |
| Increment operator is a no-op, but is used for iterator compatibility. More... | |
| sfr | operator++ (int) noexcept |
| Increment operator is a no-op, but is used for iterator compatibility. More... | |
| using embutil::sfr< TPerm, T, TAddr, typename std::enable_if_t< TAddr !=0, void > >::const_ptr_t = volatile const T* |
| using embutil::sfr< TPerm, T, TAddr, typename std::enable_if_t< TAddr !=0, void > >::const_ref_t = volatile const T& |
| using embutil::sfr< TPerm, T, TAddr, typename std::enable_if_t< TAddr !=0, void > >::ptr_t = volatile T* |
| using embutil::sfr< TPerm, T, TAddr, typename std::enable_if_t< TAddr !=0, void > >::ref_t = volatile T& |
|
default |
Default constructor.
|
inlineexplicitnoexcept |
Construct an SFR and set a value.
| [in] | value | The initial value to set. |
|
default |
Default destructor.
|
delete |
Delete the copy constructor.
|
default |
|
inlinenoexcept |
Get the address of this SFR.
|
inlinenoexcept |
Read from register, explicit operation.
|
inlinenoexcept |
Read/write dereference.
|
inlinenoexcept |
Read-only dereference.
|
inlinenoexcept |
Read from register, read-only dereference.
|
inlinenoexcept |
Read from register.
|
inlinenoexcept |
Increment operator is a no-op, but is used for iterator compatibility.
|
inlinenoexcept |
Increment operator is a no-op, but is used for iterator compatibility.
|
delete |
Delete the copy assignment operator.
|
default |
|
inlinenoexcept |
Write via copy/assignment.
| [in] | value_ | The value to write to the SFR. |
|
inlinenoexcept |
Write to the register.
| [in] | value | The value to write to the SFR. |
1.8.15