NSVD Reader  0.0.1
nodamushi::svd::Device< STR, VendorExtensions > Struct Template Reference

Device. More...

#include <Device.hpp>

Inheritance diagram for nodamushi::svd::Device< STR, VendorExtensions >:

Public Member Functions

 Device ()=default
 
 Device (const Device &)=delete
 
Deviceoperator= (Device &&)=default
 
 Device (Device &&)=default
 
Deviceoperator= (const Device &)=delete
 
template<typename SVD >
 Device (SVD &svd)
 constructor More...
 

Public Attributes

value< STR,ATTR > schemaVersion
 attribute: schemaVersion More...
 
value< STR,ATTR > xs
 attribute: xmlns:xs More...
 
value< STR,ATTR > noNamespaceSchemaLocation
 attribute: noNamespaceSchemaLocation More...
 
value< STR,ELEMENT > vendor
 <vendor> More...
 
value< STR,ELEMENT > vendorID
 <vendorID> More...
 
value< STR,ELEMENT > name
 <name> More...
 
value< STR,ELEMENT > series
 <seriese> More...
 
value< STR,ELEMENT > version
 <version> More...
 
value< STR,ELEMENT > description
 <description> More...
 
value< STR,ELEMENT > licenseText
 <licenseText> More...
 
value< Cpu< STR >,ELEMENT > cpu
 <cpu> More...
 
value< STR,ELEMENT > headerSystemFilename
 <headerSystemFilename> More...
 
value< STR,ELEMENT > headerDefinitionsPrefix
 <headerDefinitionsPrefix> More...
 
value< uint32_t,ELEMENT > addressUnitBits
 <addressUnitBits> More...
 
value< uint32_t,ELEMENT > width
 <width> More...
 
value< uint32_t,ELEMENT > size
 <size> More...
 
value< Access,ELEMENT > access
 <access> More...
 
value< Protection,ELEMENT > protection
 <protection> More...
 
value< hex64,ELEMENT > resetValue
 <resetValue> More...
 
value< hex64,ELEMENT > resetMask
 <resetMask> More...
 
value< Peripherals< STR >,ELEMENT > peripherals
 <peripherals> More...
 
value< VendorExtensions,ELEMENT > vendorExtensions
 <vendorExtensions> More...
 

Detailed Description

template<typename STR = std::string, typename VendorExtensions = void>
struct nodamushi::svd::Device< STR, VendorExtensions >

Device.

<device> is a root element of the SVD file.
This class represents SVD (xml) information as it is. Therefore, there is a possibility that each element does not have value because it dose not be defined in the source SVD file.
// samplecode
// read SVD file with boost (* include "nodamushi/svd/boost.hpp")
nodamushi::svd::boost_svd_reader svd_reader(filename);
// read and create Device
nodamushi::svd::Device<> device(svd_reader);
// get cpu name
if(device.cpu){
std::cout << device.cpu->name.get("Undefined") << std::endl;
}else{
std::cout << "CPU element is not defined" << std::endl;
}
// set value
device.description = "My Device";
// print SVD(xml)
std::cout << device <<std::endl;
// access to Peripheral
if(device.peripherals && device.peripherals->peripheral){
for(const auto& p : device.peripherals->peripheral.get()){
std::cout << p.name.get("undefined") << std::endl;
}
}
It's hard to write code that accesses in loops. For simplicity, a visitor pattern class have be prepared to access all major elements.
see sample code 'sample/visitor_sample.cpp'
Parameters
STRstring type. default type is std::string
VendorExtensions.default type is void
See also
http://www.keil.com/pack/doc/CMSIS/SVD/html/elem_device.html
nodamushi::svd::normalized::Device
nodamushi::svd::normalize()

Definition at line 101 of file Device.hpp.

Constructor & Destructor Documentation

◆ Device() [1/4]

template<typename STR = std::string, typename VendorExtensions = void>
nodamushi::svd::Device< STR, VendorExtensions >::Device ( )
default

◆ Device() [2/4]

template<typename STR = std::string, typename VendorExtensions = void>
nodamushi::svd::Device< STR, VendorExtensions >::Device ( const Device< STR, VendorExtensions > &  )
delete

◆ Device() [3/4]

template<typename STR = std::string, typename VendorExtensions = void>
nodamushi::svd::Device< STR, VendorExtensions >::Device ( Device< STR, VendorExtensions > &&  )
default

◆ Device() [4/4]

template<typename STR = std::string, typename VendorExtensions = void>
template<typename SVD >
nodamushi::svd::Device< STR, VendorExtensions >::Device ( SVD &  svd)
inline

constructor

Parameters
svdSVD reader

Definition at line 160 of file Device.hpp.

Member Function Documentation

◆ operator=() [1/2]

template<typename STR = std::string, typename VendorExtensions = void>
Device& nodamushi::svd::Device< STR, VendorExtensions >::operator= ( Device< STR, VendorExtensions > &&  )
default

◆ operator=() [2/2]

template<typename STR = std::string, typename VendorExtensions = void>
Device& nodamushi::svd::Device< STR, VendorExtensions >::operator= ( const Device< STR, VendorExtensions > &  )
delete

Member Data Documentation

◆ access

template<typename STR = std::string, typename VendorExtensions = void>
value< Access ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::access

<access>

Definition at line 144 of file Device.hpp.

◆ addressUnitBits

template<typename STR = std::string, typename VendorExtensions = void>
value< uint32_t ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::addressUnitBits

<addressUnitBits>

Definition at line 138 of file Device.hpp.

◆ cpu

template<typename STR = std::string, typename VendorExtensions = void>
value< Cpu<STR> ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::cpu

<cpu>

Definition at line 132 of file Device.hpp.

◆ description

template<typename STR = std::string, typename VendorExtensions = void>
value< STR ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::description

<description>

Definition at line 128 of file Device.hpp.

◆ headerDefinitionsPrefix

template<typename STR = std::string, typename VendorExtensions = void>
value< STR ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::headerDefinitionsPrefix

<headerDefinitionsPrefix>

Definition at line 136 of file Device.hpp.

◆ headerSystemFilename

template<typename STR = std::string, typename VendorExtensions = void>
value< STR ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::headerSystemFilename

<headerSystemFilename>

Definition at line 134 of file Device.hpp.

◆ licenseText

template<typename STR = std::string, typename VendorExtensions = void>
value< STR ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::licenseText

<licenseText>

Definition at line 130 of file Device.hpp.

◆ name

template<typename STR = std::string, typename VendorExtensions = void>
value< STR ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::name

<name>

Definition at line 122 of file Device.hpp.

◆ noNamespaceSchemaLocation

template<typename STR = std::string, typename VendorExtensions = void>
value< STR ,ATTR> nodamushi::svd::Device< STR, VendorExtensions >::noNamespaceSchemaLocation

attribute: noNamespaceSchemaLocation

Definition at line 114 of file Device.hpp.

◆ peripherals

template<typename STR = std::string, typename VendorExtensions = void>
value< Peripherals<STR> ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::peripherals

<peripherals>

Definition at line 152 of file Device.hpp.

◆ protection

template<typename STR = std::string, typename VendorExtensions = void>
value< Protection ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::protection

<protection>

Definition at line 146 of file Device.hpp.

◆ resetMask

template<typename STR = std::string, typename VendorExtensions = void>
value< hex64 ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::resetMask

<resetMask>

Definition at line 150 of file Device.hpp.

◆ resetValue

template<typename STR = std::string, typename VendorExtensions = void>
value< hex64 ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::resetValue

<resetValue>

Definition at line 148 of file Device.hpp.

◆ schemaVersion

template<typename STR = std::string, typename VendorExtensions = void>
value< STR ,ATTR> nodamushi::svd::Device< STR, VendorExtensions >::schemaVersion

attribute: schemaVersion

Definition at line 110 of file Device.hpp.

◆ series

template<typename STR = std::string, typename VendorExtensions = void>
value< STR ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::series

<seriese>

Definition at line 124 of file Device.hpp.

◆ size

template<typename STR = std::string, typename VendorExtensions = void>
value< uint32_t ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::size

<size>

Definition at line 142 of file Device.hpp.

◆ vendor

template<typename STR = std::string, typename VendorExtensions = void>
value< STR ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::vendor

<vendor>

Definition at line 118 of file Device.hpp.

◆ vendorExtensions

template<typename STR = std::string, typename VendorExtensions = void>
value< VendorExtensions ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::vendorExtensions

<vendorExtensions>

Definition at line 154 of file Device.hpp.

◆ vendorID

template<typename STR = std::string, typename VendorExtensions = void>
value< STR ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::vendorID

<vendorID>

Definition at line 120 of file Device.hpp.

◆ version

template<typename STR = std::string, typename VendorExtensions = void>
value< STR ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::version

<version>

Definition at line 126 of file Device.hpp.

◆ width

template<typename STR = std::string, typename VendorExtensions = void>
value< uint32_t ,ELEMENT> nodamushi::svd::Device< STR, VendorExtensions >::width

<width>

Definition at line 140 of file Device.hpp.

◆ xs

template<typename STR = std::string, typename VendorExtensions = void>
value< STR ,ATTR> nodamushi::svd::Device< STR, VendorExtensions >::xs

attribute: xmlns:xs

Definition at line 112 of file Device.hpp.


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