L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
L4drivers::Register_tmpl< BITS, BLOCK > Class Template Reference

Single hardware register inside a Register_block_base interface. More...

#include <hw_register_block>

+ Inheritance diagram for L4drivers::Register_tmpl< BITS, BLOCK >:
+ Collaboration diagram for L4drivers::Register_tmpl< BITS, BLOCK >:

Public Member Functions

Register_tmploperator= (value_type val)
 write val into the hardware register.
 
void write (value_type val)
 write val into the hardware register.
 
value_type set (value_type set_bits)
 set bits in set_bits in the hardware register.
 
value_type clear (value_type clear_bits)
 clears bits in clear_bits in the hardware register.
 
value_type modify (value_type clear_bits, value_type set_bits)
 clears bits in clear_bits and sets bits in set_bits in the hardware register.
 
- Public Member Functions inherited from L4drivers::Ro_register_tmpl< BITS, BLOCK >
 operator value_type () const
 read the value from the hardware register.
 
value_type read () const
 read the value from the hardware register.
 

Detailed Description

template<unsigned BITS, typename BLOCK>
class L4drivers::Register_tmpl< BITS, BLOCK >

Single hardware register inside a Register_block_base interface.

Template Parameters
BITSThe access width for the register in bits.
BLOCKthe type of the Register_block_base interface.
Note
Objects of this type must be used only in temporary contexts not in global, class, or object scope.

Definition at line 236 of file hw_register_block.

Member Function Documentation

◆ clear()

template<unsigned BITS, typename BLOCK >
value_type L4drivers::Register_tmpl< BITS, BLOCK >::clear ( value_type  clear_bits)
inline

clears bits in clear_bits in the hardware register.

Parameters
clear_bitsbits to be cleared within the hardware register.

This is a read-modify-write function that does a logical and of the old value from the register with the negated value of clear_bits.

unsigned old_value = read();
write(old_value & ~clear_bits);

Definition at line 289 of file hw_register_block.

◆ modify()

template<unsigned BITS, typename BLOCK >
value_type L4drivers::Register_tmpl< BITS, BLOCK >::modify ( value_type  clear_bits,
value_type  set_bits 
)
inline

clears bits in clear_bits and sets bits in set_bits in the hardware register.

Parameters
clear_bitsbits to be cleared within the hardware register.
set_bitsbits to set in the hardware register.

This is a read-modify-write function that first does a logical and of the old value from the register with the negated value of clear_bits and then does a logical or with set_bits.

unsigned old_value = read();
write((old_value & ~clear_bits) | set_bits);
void write(value_type val)
write val into the hardware register.
value_type read() const
read the value from the hardware register.

Definition at line 307 of file hw_register_block.

◆ operator=()

template<unsigned BITS, typename BLOCK >
Register_tmpl & L4drivers::Register_tmpl< BITS, BLOCK >::operator= ( value_type  val)
inline

write val into the hardware register.

Parameters
valthe value to write into the hardware register.

Definition at line 251 of file hw_register_block.

◆ set()

template<unsigned BITS, typename BLOCK >
value_type L4drivers::Register_tmpl< BITS, BLOCK >::set ( value_type  set_bits)
inline

set bits in set_bits in the hardware register.

Parameters
set_bitsbits to be set within the hardware register.

This is a read-modify-write function that does a logical or of the old value from the register with set_bits.

unsigned old_value = read();
write(old_value | set_bits);

Definition at line 273 of file hw_register_block.

◆ write()

template<unsigned BITS, typename BLOCK >
void L4drivers::Register_tmpl< BITS, BLOCK >::write ( value_type  val)
inline

write val into the hardware register.

Parameters
valthe value to write into the hardware register.

Definition at line 258 of file hw_register_block.


The documentation for this class was generated from the following file: