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_tmpl & | operator= (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

  BITS | The access width for the register in bits.
  BLOCK | the 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 237 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_bits | bits 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);
L4drivers::Register_tmpl::write
void write(value_type val)
write val into the hardware register.
Definition hw_register_block:259
L4drivers::Ro_register_tmpl::read
value_type read() const
read the value from the hardware register.
Definition hw_register_block:224

Definition at line 290 of file hw_register_block.

Referenced by L4drivers::Register_tmpl< MAX_BITS, Block >::clear().

Here is the caller graph for this function:

## 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_bits | bits to be cleared within the hardware register.
  set_bits | bits 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);

Definition at line 308 of file hw_register_block.

Referenced by L4drivers::Register_tmpl< MAX_BITS, Block >::modify().

Here is the caller graph for this function:

## 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

  val | the value to write into the hardware register.

Definition at line 252 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_bits | bits 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 274 of file hw_register_block.

Referenced by L4drivers::Register_tmpl< MAX_BITS, Block >::set().

Here is the caller graph for this function:

## write()

template<unsigned BITS, typename BLOCK>

void L4drivers::Register_tmpl< BITS, BLOCK >::write | ( | value_type | val | ) |

inline

write val into the hardware register.

Parameters

  val | the value to write into the hardware register.

Definition at line 259 of file hw_register_block.

Referenced by L4drivers::Register_tmpl< MAX_BITS, Block >::operator=(), and L4drivers::Register_tmpl< MAX_BITS, Block >::write().

Here is the caller graph for this function:

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

- pkg/drivers-frst/include/hw_register_block