NSVD Reader  0.0.1
nodamushi::svd::normalized::Cluster< STRREF > Struct Template Reference

#include <Cluster.hpp>

Public Types

using this_t = Cluster< STRREF >
 
using p_ptr = parent_ptr< Peripheral< STRREF > >
 
using p2_ptr = parent_ptr< Cluster< STRREF > >
 
using Register = ::nodamushi::svd::normalized::Register< STRREF >
 
using Field = ::nodamushi::svd::normalized::Field< STRREF >
 
using Peripheral = ::nodamushi::svd::normalized::Peripheral< STRREF >
 

Public Member Functions

node_ptr< Peripheralget_parent () noexcept
 get parent peripheral pointer More...
 
node_ptr< Clusterget_parent2 () noexcept
 get parent cluster pointer More...
 
node_ptr< Peripheral const > get_parent () const noexcept
 get parent peripheral pointer More...
 
node_ptr< Cluster const > get_parent2 () const noexcept
 get parent cluster pointer More...
 
node_ptr< Peripheral const > get_peripheral () const noexcept
 get the Peripheral to which this cluster belongs. More...
 
node_ptr< Peripheralget_peripheral () noexcept
 get the Peripheral to which this cluster belongs. More...
 
uint64_t get_address () const
 calculate an absolute address. More...
 
uint64_t get_address_offset () const
 a relative address from the baseAddress of the Peripheral to which this cluster belongs More...
 
uint32_t get_size () const
 resolve the value of size and return it. More...
 
uint64_t get_resetValue () const
 resolve the value of resetValue and return it. More...
 
uint64_t get_resetMask () const
 resolve the value of resetMask and return it. More...
 
Access get_access () const
 resolve the value of access and return it. More...
 
Protection get_protection () const
 resolve the value of protection and return it. More...
 
template<typename STR >
node_ptr< void > find (::nodamushi::svd::path< STR > &p, size_t pindex=0)
 find path element More...
 
template<typename STR >
node_ptr< Clusterfind_cluster (::nodamushi::svd::path< STR > &p, size_t pindex=0)
 find cluster element More...
 
template<typename STR >
node_ptr< Registerfind_register (::nodamushi::svd::path< STR > &p, size_t pindex=0)
 find register element More...
 
template<typename STR >
node_ptr< Fieldfind_field (::nodamushi::svd::path< STR > &p, size_t pindex=0)
 find field element More...
 
::nodamushi::svd::path get_path () const
 this cluster path More...
 
template<typename T >
 Cluster (const T &n)
 This constructor is for normalizer. More...
 
void update_parent (p_ptr &new_parent, node_ptr< this_t > &me)
 set the peripheral parent More...
 
void update_parent (p2_ptr &new_parent, node_ptr< this_t > &me)
 set the cluster parent More...
 

Public Attributes

path< STRREF > derivedFrom
 derivedFrom attribute More...
 
std::string name
 <name> More...
 
dim_info dim
 dimemsion information object. More...
 
STRREF description
 <description> More...
 
STRREF alternateCluster
 <alternateCluster> More...
 
STRREF headerStructName
 <headerStructName> More...
 
uint64_t addressOffset
 <addressOffset>. More...
 
nullable< uint32_t > size
 <size> default bit-width of registers. More...
 
nullable< Accessaccess
 <access> More...
 
nullable< Protectionprotection
 <protection> More...
 
nullable< uint64_t > resetValue
 <resetValue> More...
 
nullable< uint64_t > resetMask
 <resetMask> More...
 
list< Clusterclusters
 <cluster> elements list. This list is sorted by the addressOffset. More...
 
list< Registerregisters
 <register> elements list. This list is sorted by the addressOffset. More...
 

Detailed Description

template<typename STRREF>
struct nodamushi::svd::normalized::Cluster< STRREF >

Definition at line 26 of file Cluster.hpp.

Member Typedef Documentation

◆ Field

template<typename STRREF>
using nodamushi::svd::normalized::Cluster< STRREF >::Field = ::nodamushi::svd::normalized::Field<STRREF>

Definition at line 32 of file Cluster.hpp.

◆ p2_ptr

template<typename STRREF>
using nodamushi::svd::normalized::Cluster< STRREF >::p2_ptr = parent_ptr<Cluster<STRREF> >

Definition at line 30 of file Cluster.hpp.

◆ p_ptr

template<typename STRREF>
using nodamushi::svd::normalized::Cluster< STRREF >::p_ptr = parent_ptr<Peripheral<STRREF> >

Definition at line 29 of file Cluster.hpp.

◆ Peripheral

template<typename STRREF>
using nodamushi::svd::normalized::Cluster< STRREF >::Peripheral = ::nodamushi::svd::normalized::Peripheral<STRREF>

Definition at line 33 of file Cluster.hpp.

◆ Register

template<typename STRREF>
using nodamushi::svd::normalized::Cluster< STRREF >::Register = ::nodamushi::svd::normalized::Register<STRREF>

Definition at line 31 of file Cluster.hpp.

◆ this_t

template<typename STRREF>
using nodamushi::svd::normalized::Cluster< STRREF >::this_t = Cluster<STRREF>

Definition at line 28 of file Cluster.hpp.

Constructor & Destructor Documentation

◆ Cluster()

template<typename STRREF>
template<typename T >
nodamushi::svd::normalized::Cluster< STRREF >::Cluster ( const T &  n)
inline

This constructor is for normalizer.

Parameters
Tpre normalized Cluster

Definition at line 277 of file Cluster.hpp.

Member Function Documentation

◆ find()

template<typename STRREF>
template<typename STR >
node_ptr<void> nodamushi::svd::normalized::Cluster< STRREF >::find ( ::nodamushi::svd::path< STR > &  p,
size_t  pindex = 0 
)
inline

find path element

Parameters
ppath
pindexthe first index of serach path. default is 0.
Returns
element pointer

Definition at line 186 of file Cluster.hpp.

◆ find_cluster()

template<typename STRREF>
template<typename STR >
node_ptr<Cluster> nodamushi::svd::normalized::Cluster< STRREF >::find_cluster ( ::nodamushi::svd::path< STR > &  p,
size_t  pindex = 0 
)
inline

find cluster element

Parameters
ppath
pindexthe first index of serach path. default is 0.
Returns
element pointer

Definition at line 209 of file Cluster.hpp.

◆ find_field()

template<typename STRREF>
template<typename STR >
node_ptr<Field> nodamushi::svd::normalized::Cluster< STRREF >::find_field ( ::nodamushi::svd::path< STR > &  p,
size_t  pindex = 0 
)
inline

find field element

Parameters
ppath
pindexthe first index of serach path. default is 0.
Returns
element pointer

Definition at line 249 of file Cluster.hpp.

◆ find_register()

template<typename STRREF>
template<typename STR >
node_ptr<Register> nodamushi::svd::normalized::Cluster< STRREF >::find_register ( ::nodamushi::svd::path< STR > &  p,
size_t  pindex = 0 
)
inline

find register element

Parameters
ppath
pindexthe first index of serach path. default is 0.
Returns
element pointer

Definition at line 228 of file Cluster.hpp.

◆ get_access()

template<typename STRREF>
Access nodamushi::svd::normalized::Cluster< STRREF >::get_access ( ) const
inline

resolve the value of access and return it.

Definition at line 171 of file Cluster.hpp.

◆ get_address()

template<typename STRREF>
uint64_t nodamushi::svd::normalized::Cluster< STRREF >::get_address ( ) const
inline

calculate an absolute address.

Returns
an absolute address

Definition at line 155 of file Cluster.hpp.

◆ get_address_offset()

template<typename STRREF>
uint64_t nodamushi::svd::normalized::Cluster< STRREF >::get_address_offset ( ) const
inline

a relative address from the baseAddress of the Peripheral to which this cluster belongs

Definition at line 157 of file Cluster.hpp.

◆ get_parent() [1/2]

template<typename STRREF>
node_ptr<Peripheral> nodamushi::svd::normalized::Cluster< STRREF >::get_parent ( )
inlinenoexcept

get parent peripheral pointer

Returns
parent peripheral pointer or nullptr.
See also
get_parent2()

Definition at line 125 of file Cluster.hpp.

◆ get_parent() [2/2]

template<typename STRREF>
node_ptr<Peripheral const> nodamushi::svd::normalized::Cluster< STRREF >::get_parent ( ) const
inlinenoexcept

get parent peripheral pointer

Returns
parent peripheral pointer or nullptr.
See also
get_parent2()

Definition at line 137 of file Cluster.hpp.

◆ get_parent2() [1/2]

template<typename STRREF>
node_ptr<Cluster> nodamushi::svd::normalized::Cluster< STRREF >::get_parent2 ( )
inlinenoexcept

get parent cluster pointer

Returns
parent cluster pointer or nullptr.
See also
get_parent()

Definition at line 131 of file Cluster.hpp.

◆ get_parent2() [2/2]

template<typename STRREF>
node_ptr<Cluster const> nodamushi::svd::normalized::Cluster< STRREF >::get_parent2 ( ) const
inlinenoexcept

get parent cluster pointer

Returns
parent cluster pointer or nullptr.
See also
get_parent()

Definition at line 144 of file Cluster.hpp.

◆ get_path()

template<typename STRREF>
::nodamushi::svd::path nodamushi::svd::normalized::Cluster< STRREF >::get_path ( ) const
inline

this cluster path

Definition at line 264 of file Cluster.hpp.

◆ get_peripheral() [1/2]

template<typename STRREF>
node_ptr<Peripheral const> nodamushi::svd::normalized::Cluster< STRREF >::get_peripheral ( ) const
inlinenoexcept

get the Peripheral to which this cluster belongs.

Definition at line 147 of file Cluster.hpp.

◆ get_peripheral() [2/2]

template<typename STRREF>
node_ptr<Peripheral> nodamushi::svd::normalized::Cluster< STRREF >::get_peripheral ( )
inlinenoexcept

get the Peripheral to which this cluster belongs.

Definition at line 149 of file Cluster.hpp.

◆ get_protection()

template<typename STRREF>
Protection nodamushi::svd::normalized::Cluster< STRREF >::get_protection ( ) const
inline

resolve the value of protection and return it.

Definition at line 175 of file Cluster.hpp.

◆ get_resetMask()

template<typename STRREF>
uint64_t nodamushi::svd::normalized::Cluster< STRREF >::get_resetMask ( ) const
inline

resolve the value of resetMask and return it.

Definition at line 167 of file Cluster.hpp.

◆ get_resetValue()

template<typename STRREF>
uint64_t nodamushi::svd::normalized::Cluster< STRREF >::get_resetValue ( ) const
inline

resolve the value of resetValue and return it.

Definition at line 163 of file Cluster.hpp.

◆ get_size()

template<typename STRREF>
uint32_t nodamushi::svd::normalized::Cluster< STRREF >::get_size ( ) const
inline

resolve the value of size and return it.

Definition at line 159 of file Cluster.hpp.

◆ update_parent() [1/2]

template<typename STRREF>
void nodamushi::svd::normalized::Cluster< STRREF >::update_parent ( p_ptr new_parent,
node_ptr< this_t > &  me 
)
inline

set the peripheral parent

Parameters
new_parentperipheral parent pointer
methis instance pointer

Definition at line 322 of file Cluster.hpp.

◆ update_parent() [2/2]

template<typename STRREF>
void nodamushi::svd::normalized::Cluster< STRREF >::update_parent ( p2_ptr new_parent,
node_ptr< this_t > &  me 
)
inline

set the cluster parent

Parameters
new_parentcluster parent pointer
methis instance pointer

Definition at line 335 of file Cluster.hpp.

Member Data Documentation

◆ access

template<typename STRREF>
nullable<Access> nodamushi::svd::normalized::Cluster< STRREF >::access

<access>

See also
get_access()

Definition at line 81 of file Cluster.hpp.

◆ addressOffset

template<typename STRREF>
uint64_t nodamushi::svd::normalized::Cluster< STRREF >::addressOffset

<addressOffset>.

If you nead an absolute address, call the get_address() method. If you nead a relative address from the baseAddress of peripheral,call the get_offset() method.
Note
Although the CMSIS-SVD document describes the addressOffset as a relative address from the baseAddress of peripheral, it is probably wrong. In this library, the addressOffset is treated as a relative path from the parent address. The parent is a peripheral or a cluster.
See also
get_address()
get_address_offset()

Definition at line 70 of file Cluster.hpp.

◆ alternateCluster

template<typename STRREF>
STRREF nodamushi::svd::normalized::Cluster< STRREF >::alternateCluster

<alternateCluster>

Definition at line 53 of file Cluster.hpp.

◆ clusters

template<typename STRREF>
list<Cluster> nodamushi::svd::normalized::Cluster< STRREF >::clusters

<cluster> elements list. This list is sorted by the addressOffset.

Cluster class does not prohibit copying, but basically it should be treated with a reference.
auto& c = parent.clusters[x];

Definition at line 107 of file Cluster.hpp.

◆ derivedFrom

template<typename STRREF>
path<STRREF> nodamushi::svd::normalized::Cluster< STRREF >::derivedFrom

derivedFrom attribute

Definition at line 43 of file Cluster.hpp.

◆ description

template<typename STRREF>
STRREF nodamushi::svd::normalized::Cluster< STRREF >::description

<description>

Definition at line 49 of file Cluster.hpp.

◆ dim

template<typename STRREF>
dim_info nodamushi::svd::normalized::Cluster< STRREF >::dim

dimemsion information object.

Definition at line 47 of file Cluster.hpp.

◆ headerStructName

template<typename STRREF>
STRREF nodamushi::svd::normalized::Cluster< STRREF >::headerStructName

<headerStructName>

Definition at line 55 of file Cluster.hpp.

◆ name

template<typename STRREF>
std::string nodamushi::svd::normalized::Cluster< STRREF >::name

<name>

Definition at line 45 of file Cluster.hpp.

◆ protection

template<typename STRREF>
nullable<Protection> nodamushi::svd::normalized::Cluster< STRREF >::protection

<protection>

See also
get_protection()

Definition at line 86 of file Cluster.hpp.

◆ registers

template<typename STRREF>
list<Register> nodamushi::svd::normalized::Cluster< STRREF >::registers

<register> elements list. This list is sorted by the addressOffset.

Register class does not prohibit copying, but basically it should be treated with a reference.
auto& r = parent.registers[x];

Definition at line 118 of file Cluster.hpp.

◆ resetMask

template<typename STRREF>
nullable<uint64_t> nodamushi::svd::normalized::Cluster< STRREF >::resetMask

<resetMask>

See also
get_resetMask()

Definition at line 96 of file Cluster.hpp.

◆ resetValue

template<typename STRREF>
nullable<uint64_t> nodamushi::svd::normalized::Cluster< STRREF >::resetValue

<resetValue>

See also
get_resetValue()

Definition at line 91 of file Cluster.hpp.

◆ size

template<typename STRREF>
nullable<uint32_t> nodamushi::svd::normalized::Cluster< STRREF >::size

<size> default bit-width of registers.

See also
get_size()

Definition at line 76 of file Cluster.hpp.


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