bitspec_t Class Reference

yasimavr: bitspec_t Class Reference
yasimavr
Loading...
Searching...
No Matches
bitspec_t Class Reference

bit spec structure. Represent a field in a I/O register. It works the same as bitmask_t except used bits must be consecutive More...

#include <sim_types.h>

Public Member Functions

constexpr bitspec_t ()
 
constexpr bitspec_t (uint8_t msb_, uint8_t lsb_)
 
constexpr bitspec_t (uint8_t bit)
 
constexpr bitspec_t (const _spec_base_t &spec)
 
constexpr bitspec_t bit (uint8_t n) const
 
constexpr bitmask_t operator| (const bitspec_t &other) const
 
constexpr bool valid () const
 Returns true if at least one bit set.
 
constexpr uint8_t shift_and_mask (uint8_t value) const
 Transform the field value to its true representation and position in the 8-bits of the register.
 
constexpr uint8_t extract (uint8_t reg) const
 Extract the field value and shift right by the LSB.
 
constexpr uint8_t set_from (uint8_t reg) const
 
constexpr uint8_t clear_from (uint8_t reg) const
 
constexpr uint8_t replace (uint8_t reg, uint8_t value) const
 
constexpr unsigned int bitcount () const
 
constexpr uint8_t lsb () const
 
constexpr uint8_t msb () const
 
constexpr operator bitmask_t () const
 
constexpr uint8_t operator& (uint8_t v) const
 

Detailed Description

bit spec structure. Represent a field in a I/O register. It works the same as bitmask_t except used bits must be consecutive

Constructor & Destructor Documentation

◆ bitspec_t() [1/4]

constexpr bitspec_t::bitspec_t ( )
inlineconstexpr

◆ bitspec_t() [2/4]

constexpr bitspec_t::bitspec_t ( uint8_t  msb_,
uint8_t  lsb_ 
)
inlineconstexpr

◆ bitspec_t() [3/4]

constexpr bitspec_t::bitspec_t ( uint8_t  bit)
inlineexplicitconstexpr

◆ bitspec_t() [4/4]

constexpr bitspec_t::bitspec_t ( const _spec_base_t &  spec)
inlineconstexpr

Member Function Documentation

◆ bit()

constexpr bitspec_t bitspec_t::bit ( uint8_t  n) const
inlineconstexpr

◆ bitcount()

constexpr unsigned int bitspec_t::bitcount ( ) const
constexpr

◆ clear_from()

constexpr uint8_t bitspec_t::clear_from ( uint8_t  reg) const
constexpr

◆ extract()

constexpr uint8_t bitspec_t::extract ( uint8_t  reg) const
constexpr

Extract the field value and shift right by the LSB.

◆ lsb()

constexpr uint8_t bitspec_t::lsb ( ) const
constexpr

◆ msb()

constexpr uint8_t bitspec_t::msb ( ) const
constexpr

◆ operator bitmask_t()

constexpr bitspec_t::operator bitmask_t ( ) const
constexpr

◆ operator&()

constexpr uint8_t bitspec_t::operator& ( uint8_t  v) const
constexpr

◆ operator|()

constexpr bitmask_t bitspec_t::operator| ( const bitspec_t other) const
inlineconstexpr

◆ replace()

constexpr uint8_t bitspec_t::replace ( uint8_t  reg,
uint8_t  value 
) const
constexpr

◆ set_from()

constexpr uint8_t bitspec_t::set_from ( uint8_t  reg) const
constexpr

◆ shift_and_mask()

constexpr uint8_t bitspec_t::shift_and_mask ( uint8_t  value) const
constexpr

Transform the field value to its true representation and position in the 8-bits of the register.

◆ valid()

constexpr bool bitspec_t::valid ( ) const
constexpr

Returns true if at least one bit set.


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