Merge branch 'brainstorm-serialize_docs_svd_example'

This commit is contained in:
Marc-Antoine Arnaud 2021-02-08 14:11:24 +01:00
commit df49bff4be
16 changed files with 1020 additions and 58 deletions

View File

@ -1,5 +1,11 @@
language: rust
rust:
# error on #[non_exhaustive] being "experimental"
# - 1.36.0
# - 1.37.0
# error on cfg(doctest)
# - 1.38.0
# - 1.39.0
- 1.40.0
- 1.41.0
- 1.42.0

View File

@ -2,4 +2,5 @@
members = [
"yaserde",
"yaserde_derive",
"examples",
]

13
examples/Cargo.toml Normal file
View File

@ -0,0 +1,13 @@
[package]
name = "yaserde-examples"
version = "0.0.1"
authors = ["Marc-Antoine Arnaud <maarnaud@media-io.com>"]
license = "MIT"
edition = "2018"
[dependencies]
yaserde = {version = "0.5.1", path = "../yaserde" }
yaserde_derive = {version = "0.5.1", path = "../yaserde_derive" }
xml-rs = "0.8.0"
log = "0.4"
simple_logger = "1.0"

View File

@ -0,0 +1,106 @@
// related to issue https://github.com/media-io/yaserde/issues/15
#[derive(YaDeserialize, Default, Debug, PartialEq)]
#[yaserde(
prefix = "ss",
namespace = "x: urn:schemas-microsoft-com:office:excel",
namespace = "ss: urn:schemas-microsoft-com:office:spreadsheet",
namespace = "o: urn:schemas-microsoft-com:office:office",
namespace = "html: http://www.w3.org/TR/REC-html40"
)]
struct Workbook {
#[yaserde(rename = "Worksheet")]
worksheet: Worksheet,
}
#[derive(YaDeserialize, Default, Debug, PartialEq)]
#[yaserde(
prefix = "ss",
namespace = "x: urn:schemas-microsoft-com:office:excel",
namespace = "ss: urn:schemas-microsoft-com:office:spreadsheet",
namespace = "o: urn:schemas-microsoft-com:office:office",
namespace = "html: http://www.w3.org/TR/REC-html40"
)]
struct Worksheet {
#[yaserde(rename = "Table")]
table: Table,
#[yaserde(attribute, rename = "Name", prefix = "ss")]
ws_name: String,
}
#[derive(YaDeserialize, Default, Debug, PartialEq)]
#[yaserde(
prefix = "ss",
namespace = "x: urn:schemas-microsoft-com:office:excel",
namespace = "ss: urn:schemas-microsoft-com:office:spreadsheet",
namespace = "o: urn:schemas-microsoft-com:office:office",
namespace = "html: http://www.w3.org/TR/REC-html40"
)]
struct Table {
#[yaserde(attribute, rename = "ExpandedColumnCount", prefix = "ss")]
expanded_column_count: u32,
#[yaserde(attribute, rename = "ExpandedRowCount", prefix = "ss")]
expanded_row_count: u32,
#[yaserde(attribute, rename = "FullColumns", prefix = "x")]
full_columns: u32,
#[yaserde(attribute, rename = "FullRows", prefix = "x")]
full_rows: u32,
#[yaserde(attribute, rename = "StyleID", prefix = "ss")]
style_id: String,
#[yaserde(attribute, rename = "DefaultColumnWidth", prefix = "ss")]
default_column_width: f32,
#[yaserde(attribute, rename = "DefaultRowHeight", prefix = "ss")]
default_column_height: f32,
#[yaserde(rename = "Row")]
rows: Vec<Row>,
}
#[derive(YaDeserialize, Default, Debug, PartialEq)]
#[yaserde(
prefix = "ss",
namespace = "x: urn:schemas-microsoft-com:office:excel",
namespace = "ss: urn:schemas-microsoft-com:office:spreadsheet",
namespace = "o: urn:schemas-microsoft-com:office:office",
namespace = "html: http://www.w3.org/TR/REC-html40"
)]
struct Row {
#[yaserde(attribute, rename = "AutoFitHeight", prefix = "ss")]
auto_fit_height: f32,
#[yaserde(attribute, rename = "Height", prefix = "ss")]
height: f32,
}
#[test]
fn parsing_bbigras_namespace() {
use std::fs;
use yaserde::de::from_str;
let filename = "tests/data/bbigras-namespace.xml";
let content = fs::read_to_string(filename).expect("something went wrong reading the file");
let loaded: Workbook = from_str(&content).unwrap();
println!("{:?}", loaded);
let reference = Workbook {
worksheet: Worksheet {
ws_name: "some_name".to_string(),
table: Table {
expanded_column_count: 11,
expanded_row_count: 195,
full_columns: 1,
full_rows: 1,
style_id: "s64".to_string(),
default_column_width: 60.75,
default_column_height: 15.0,
rows: vec![Row {
auto_fit_height: 0.0,
height: 33.0,
}],
},
},
};
assert_eq!(loaded, reference);
}

118
examples/src/boscop.rs Normal file
View File

@ -0,0 +1,118 @@
// related to issue https://github.com/media-io/yaserde/issues/3
#[derive(Default, Debug, Clone, PartialEq, YaDeserialize)]
#[yaserde(root = "layout")]
pub struct Layout {
#[yaserde(attribute)]
pub version: u32,
#[yaserde(attribute)]
pub mode: u32,
#[yaserde(attribute)]
pub w: u32,
#[yaserde(attribute)]
pub h: u32,
#[yaserde(attribute)]
pub orientation: String,
pub tabpage: Vec<Tabpage>,
}
#[derive(Default, Debug, Clone, PartialEq, YaDeserialize)]
pub struct Tabpage {
#[yaserde(attribute, rename = "name")]
pub named: String,
#[yaserde(attribute)]
pub scalef: f32,
#[yaserde(attribute)]
pub scalet: f32,
#[yaserde(attribute)]
pub li_t: String,
#[yaserde(attribute)]
pub li_c: String,
#[yaserde(attribute)]
pub li_s: u32,
#[yaserde(attribute)]
pub li_o: bool,
#[yaserde(attribute)]
pub li_b: bool,
#[yaserde(attribute)]
pub la_t: String,
#[yaserde(attribute)]
pub la_c: String,
#[yaserde(attribute)]
pub la_s: u32,
#[yaserde(attribute)]
pub la_o: bool,
#[yaserde(attribute)]
pub la_b: bool,
pub control: Vec<Control>,
}
#[derive(Default, Debug, Clone, PartialEq, YaDeserialize)]
pub struct Control {
#[yaserde(attribute, rename = "name")]
pub named: String,
#[yaserde(attribute)]
pub x: u32,
#[yaserde(attribute)]
pub y: u32,
#[yaserde(attribute)]
pub w: u32,
#[yaserde(attribute)]
pub h: u32,
#[yaserde(attribute)]
pub color: String,
#[yaserde(attribute)]
pub scalef: f32,
#[yaserde(attribute)]
pub scalet: f32,
#[yaserde(attribute)]
pub local_off: bool,
#[yaserde(attribute)]
pub sp: bool,
#[yaserde(attribute)]
pub sr: bool,
pub midi: Vec<Midi>,
#[yaserde(attribute)]
pub response: String,
#[yaserde(attribute)]
pub inverted: String,
#[yaserde(attribute)]
pub centered: String,
#[yaserde(attribute)]
pub norollover: String,
}
#[derive(Default, Debug, Clone, PartialEq, YaDeserialize)]
pub struct Midi {
#[yaserde(attribute)]
pub var: String,
#[yaserde(attribute, rename = "type")]
pub typ: String,
#[yaserde(attribute)]
pub channel: String,
#[yaserde(attribute)]
pub data1: String,
#[yaserde(attribute)]
pub data2f: String,
#[yaserde(attribute)]
pub data2t: String,
#[yaserde(attribute)]
pub sysex: String,
}
#[test]
fn parsing_bbigras_namespace() {
use std::fs;
use yaserde::de::from_str;
let filename = "tests/data/boscop.xml";
let content = fs::read_to_string(filename).expect("something went wrong reading the file");
let loaded: Layout = from_str(&content).unwrap();
assert_eq!(loaded.tabpage.len(), 4);
assert_eq!(loaded.tabpage[0].control.len(), 13);
assert_eq!(loaded.tabpage[1].control.len(), 16);
assert_eq!(loaded.tabpage[2].control.len(), 65);
assert_eq!(loaded.tabpage[3].control.len(), 40);
}

7
examples/src/lib.rs Normal file
View File

@ -0,0 +1,7 @@
#[macro_use]
extern crate yaserde_derive;
mod bbigras_namespace;
mod boscop;
mod ln_dom;
mod svd;

81
examples/src/ln_dom.rs Normal file
View File

@ -0,0 +1,81 @@
// related to issue https://github.com/media-io/yaserde/issues/11
#[derive(YaDeserialize, Default, Debug, PartialEq)]
#[yaserde(root = "DOMSymbolItem")]
struct Level {
#[yaserde(attribute)]
last_modified: u64,
#[yaserde(attribute, rename = "name")]
named: String,
timeline: Timeline,
}
#[derive(YaDeserialize, Default, Debug, PartialEq)]
struct Timeline {
#[yaserde(rename = "DOMTimeline")]
timeline: DOMTimeline,
}
#[derive(YaDeserialize, Default, Debug, PartialEq)]
struct DOMTimeline {
#[yaserde(attribute, rename = "name")]
named: String,
#[yaserde(attribute)]
current_frame: u64,
#[yaserde(attribute)]
guides: u64,
layers: Layers,
}
#[derive(YaDeserialize, Default, Debug, PartialEq)]
struct Layers {
#[yaserde(rename = "DOMLayer")]
dom_layer: Vec<DOMLayer>,
}
#[derive(YaDeserialize, Default, Debug, PartialEq)]
struct DOMLayer {
#[yaserde(attribute, rename = "name")]
named: String,
#[yaserde(attribute)]
name2: String,
}
#[test]
fn parsing_ln_dom() {
use std::fs;
use yaserde::de::from_str;
let filename = "tests/data/ln-dom.xml";
let content = fs::read_to_string(filename).expect("something went wrong reading the file");
let loaded: Level = from_str(&content).unwrap();
println!("{:?}", loaded);
let reference = Level {
last_modified: 1414141442,
named: "dagger".to_string(),
timeline: Timeline {
timeline: DOMTimeline {
named: "dagger timeline name".to_string(),
current_frame: 7,
guides: 11,
layers: Layers {
dom_layer: vec![
DOMLayer {
named: "Layer 2".to_string(),
name2: "Lalayer 2".to_string(),
},
DOMLayer {
named: "Layer 1".to_string(),
name2: "Lalayer 1".to_string(),
},
],
},
},
},
};
assert_eq!(loaded, reference);
}

196
examples/src/svd.rs Normal file
View File

@ -0,0 +1,196 @@
use yaserde_derive::YaSerialize;
#[derive(Default, PartialEq, Debug, YaSerialize)]
struct CpuDef {
#[yaserde(child)]
name: String,
#[yaserde(child)]
revision: String,
#[yaserde(child)]
endian: String, // enum {LE, BE, ME}
#[yaserde(child)]
mpupresent: bool,
#[yaserde(child)]
fpupresent: bool,
//#[yaserde(child)]
//nvicpriobits: enum {8, 16, 32, 64, 128},
#[yaserde(child)]
vendorsystickconfig: bool,
}
#[derive(Default, PartialEq, Debug, YaSerialize)]
struct Field {
name: String,
#[yaserde(child)]
description: String,
#[yaserde(child)]
bitrange: String,
#[yaserde(child)]
access: String,
}
#[derive(Default, PartialEq, Debug, YaSerialize)]
struct Register {
#[yaserde(child)]
name: String,
#[yaserde(child)]
description: String,
#[yaserde(child)]
addressoffset: String,
#[yaserde(child)]
size: u8,
#[yaserde(child)]
access: String,
#[yaserde(child)]
resetvalue: String,
#[yaserde(child)]
resetmask: String,
#[yaserde(child)]
fields: Vec<Field>,
}
#[derive(Default, PartialEq, Debug, YaSerialize)]
struct Peripheral {
#[yaserde(child)]
name: String,
#[yaserde(child)]
version: String,
#[yaserde(child)]
description: String,
#[yaserde(child)]
groupname: String,
#[yaserde(child)]
baseaddress: String,
#[yaserde(child)]
size: u8,
#[yaserde(child)]
access: String,
#[yaserde(child)]
registers: Vec<Register>,
}
#[derive(Default, PartialEq, Debug, YaSerialize)]
struct DevAttrs {
#[yaserde(child)]
vendor: String,
#[yaserde(child)]
vendorid: String,
#[yaserde(child)]
name: String,
#[yaserde(child)]
series: String,
#[yaserde(child)]
version: String,
#[yaserde(child)]
description: String,
#[yaserde(child)]
licensetext: String,
#[yaserde(child)]
cpu: CpuDef,
#[yaserde(child)]
addressunitbits: u8,
#[yaserde(child)]
width: u8,
#[yaserde(child)]
size: u8,
#[yaserde(child)]
access: String,
#[yaserde(child)]
resetvalue: String,
#[yaserde(child)]
resetmask: String,
#[yaserde(child)]
peripherals: Vec<Peripheral>,
}
#[derive(Default, PartialEq, Debug, YaSerialize)]
#[yaserde(rename = "device")]
struct Device {
#[yaserde(attribute)]
schemaversion: String,
#[yaserde(attribute)]
xmlns: String,
#[yaserde(attribute)]
xsnonamespaceschemalocation: String,
#[yaserde(child)]
devattributes: DevAttrs,
}
#[test]
fn parsing_svd() {
use std::fs;
let register = Register {
name: "PRCMD".to_string(),
description: "This command register (PRCMD) is to protect the registers that may have a significant influence on the application system (PSC, PSM) from an inadvertent write access, so that the system does not stop in case of a program hang-up.".to_string(),
addressoffset: "0xFFFFF1FC".to_string(),
size: 8,
access: "read-write".to_string(),
resetvalue: "0x0000".to_string(),
resetmask: "0xFFFF".to_string(),
fields: vec![],
};
let vec_registers = vec![register];
let peripheral = Peripheral {
name: "Specific Registers".to_string(),
version: "1.0".to_string(),
description: "Specific Registers".to_string(),
groupname: "MCU".to_string(),
baseaddress: "0xFFFFF1FC".to_string(),
size: 16,
access: "read-write".to_string(),
registers: vec_registers,
};
let vec_peripherals = vec![peripheral];
let cpu_def = CpuDef {
name: "V850".to_string(),
revision: "r1".to_string(),
endian: "LE".to_string(), // enum {LE, BE, ME}
mpupresent: false,
fpupresent: false,
//nvicpriobits: enum {8, 16, 32, 64, 128},
vendorsystickconfig: false,
};
let dev_attrs = DevAttrs {
vendor: "Renesas".to_string(),
vendorid: "Renesas".to_string(),
name: "V850".to_string(),
series: "E1/E2/CA2".to_string(),
version: "1.2".to_string(),
description: "NEC/Renesas V850 automotive grade ICs".to_string(),
licensetext: "GPLv3".to_string(),
cpu: cpu_def,
addressunitbits: 8,
width: 32,
size: 32,
access: "read-write".to_string(),
resetvalue: "0x00000000".to_string(),
resetmask: "0xFFFFFFFF".to_string(),
peripherals: vec_peripherals,
};
let device = Device {
schemaversion: "foo".to_string(),
xmlns: "http://www.w3.org/2001/XMLSchema-instance".to_string(),
xsnonamespaceschemalocation: "CMSIS-SVD.xsd".to_string(),
devattributes: dev_attrs,
};
// Display pretty printed XML
let yaserde_cfg = yaserde::ser::Config {
perform_indent: true,
..Default::default()
};
let serialized = yaserde::ser::to_string_with_config(&device, &yaserde_cfg).unwrap();
let reference =
fs::read_to_string("tests/data/svd.xml").expect("something went wrong reading the file");
assert_eq!(reference, serialized)
}

View File

@ -0,0 +1,9 @@
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:x="urn:schemas-microsoft-com:office:excel">
<Worksheet ss:Name="some_name">
<Table ss:DefaultColumnWidth="60.75" ss:DefaultRowHeight="15" ss:ExpandedColumnCount="11" ss:ExpandedRowCount="195" ss:StyleID="s64" x:FullColumns="1" x:FullRows="1">
<Row ss:AutoFitHeight="0" ss:Height="33"/>
</Table>
</Worksheet>
</Workbook>

View File

@ -0,0 +1,291 @@
<?xml version="1.0" encoding="UTF-8"?>
<layout version="16" mode="3" w="460" h="736" orientation="vertical">
<tabpage name="MQ==" scalef="0.0" scalet="1.0" li_t="" li_c="gray" li_s="14" li_o="false" li_b="false" la_t="" la_c="gray" la_s="14" la_o="false" la_b="false">
<control name="ZmFkZXIx" x="59" y="7" w="215" h="50" color="yellow" scalef="0.0" scalet="1.0" type="faderh" response="absolute" inverted="false" centered="false">
<midi var="x" type="0" channel="1" data1="0" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMQ==" x="7" y="7" w="45" h="50" color="yellow" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="1" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZmFkZXIy" x="59" y="66" w="215" h="50" color="blue" scalef="0.0" scalet="1.0" type="faderh" response="absolute" inverted="false" centered="false">
<midi var="x" type="0" channel="1" data1="2" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMg==" x="7" y="66" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="3" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZmFkZXIz" x="59" y="125" w="215" h="50" color="blue" scalef="0.0" scalet="1.0" type="faderh" response="absolute" inverted="false" centered="false">
<midi var="x" type="0" channel="1" data1="4" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMw==" x="7" y="125" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="5" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZmFkZXI0" x="59" y="185" w="57" h="288" color="purple" scalef="0.0" scalet="1.0" type="faderv" response="absolute" inverted="false" centered="false">
<midi var="x" type="0" channel="1" data1="8" data2f="0" data2t="127" sysex="" />
</control>
<control name="cHVzaDE=" x="7" y="185" w="45" h="50" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true">
<midi var="x" type="0" channel="1" data1="9" data2f="0" data2t="127" sysex="" />
</control>
<control name="cHVzaDI=" x="7" y="244" w="45" h="50" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true">
<midi var="x" type="0" channel="1" data1="10" data2f="0" data2t="127" sysex="" />
</control>
<control name="cHVzaDM=" x="7" y="304" w="45" h="50" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true">
<midi var="x" type="0" channel="1" data1="11" data2f="0" data2t="127" sysex="" />
</control>
<control name="cHVzaDQ=" x="7" y="363" w="45" h="50" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true">
<midi var="x" type="0" channel="1" data1="12" data2f="0" data2t="127" sysex="" />
</control>
<control name="cHVzaDU=" x="7" y="423" w="45" h="50" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true">
<midi var="x" type="0" channel="1" data1="13" data2f="0" data2t="127" sysex="" />
</control>
<control name="eHk=" x="123" y="185" w="151" h="288" color="yellow" scalef="0.0" scalet="1.0" type="xy" inverted_x="false" inverted_y="false" rev_xy="false">
<midi var="x" type="0" channel="1" data1="6" data2f="0" data2t="127" sysex="" />
<midi var="y" type="0" channel="1" data1="7" data2f="0" data2t="127" sysex="" />
</control>
</tabpage>
<tabpage name="Mg==" scalef="0.0" scalet="1.0" li_t="" li_c="gray" li_s="14" li_o="false" li_b="false" la_t="" la_c="gray" la_s="14" la_o="false" la_b="false">
<control name="ZmFkZXIx" x="59" y="7" w="215" h="50" color="green" scalef="0.0" scalet="1.0" type="faderh" response="absolute" inverted="false" centered="false">
<midi var="x" type="0" channel="1" data1="14" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMQ==" x="7" y="7" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="15" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZmFkZXIy" x="59" y="66" w="215" h="50" color="green" scalef="0.0" scalet="1.0" type="faderh" response="absolute" inverted="false" centered="false">
<midi var="x" type="0" channel="1" data1="16" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMg==" x="7" y="66" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="17" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZmFkZXIz" x="59" y="125" w="215" h="50" color="green" scalef="0.0" scalet="1.0" type="faderh" response="absolute" inverted="false" centered="false">
<midi var="x" type="0" channel="1" data1="18" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMw==" x="7" y="125" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="19" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZmFkZXI0" x="59" y="185" w="215" h="50" color="green" scalef="0.0" scalet="1.0" type="faderh" response="absolute" inverted="false" centered="false">
<midi var="x" type="0" channel="1" data1="20" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlNA==" x="7" y="185" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="21" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZmFkZXI1" x="59" y="244" w="215" h="50" color="green" scalef="0.0" scalet="1.0" type="faderh" response="absolute" inverted="false" centered="false">
<midi var="x" type="0" channel="1" data1="22" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlNQ==" x="7" y="244" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="23" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZmFkZXI2" x="59" y="304" w="215" h="50" color="green" scalef="0.0" scalet="1.0" type="faderh" response="absolute" inverted="false" centered="false">
<midi var="x" type="0" channel="1" data1="24" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlNg==" x="7" y="304" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="25" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZmFkZXI3" x="59" y="363" w="215" h="50" color="green" scalef="0.0" scalet="1.0" type="faderh" response="absolute" inverted="false" centered="false">
<midi var="x" type="0" channel="1" data1="26" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlNw==" x="7" y="363" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="27" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZmFkZXI4" x="59" y="423" w="215" h="50" color="green" scalef="0.0" scalet="1.0" type="faderh" response="absolute" inverted="false" centered="false">
<midi var="x" type="0" channel="1" data1="28" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlOA==" x="7" y="423" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="29" data2f="0" data2t="127" sysex="" />
</control>
</tabpage>
<tabpage name="Mw==" scalef="0.0" scalet="1.0" li_t="" li_c="gray" li_s="14" li_o="false" li_b="false" la_t="" la_c="gray" la_s="14" la_o="false" la_b="false">
<control name="dG9nZ2xlMQ==" x="254" y="89" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="1" channel="1" data1="1" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMg==" x="254" y="166" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="33" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMw==" x="254" y="244" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="35" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlNA==" x="254" y="321" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="37" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlNQ==" x="254" y="399" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="39" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlNg==" x="254" y="476" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="41" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlNw==" x="254" y="554" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="43" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlOA==" x="198" y="12" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="45" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZW5jb2RlcjE=" x="352" y="86" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder">
<midi var="x" type="0" channel="1" data1="1" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZW5jb2RlcjI=" x="352" y="163" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder">
<midi var="x" type="0" channel="1" data1="2" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZW5jb2RlcjM=" x="352" y="241" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder">
<midi var="x" type="0" channel="1" data1="3" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZW5jb2RlcjQ=" x="352" y="318" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjU=" x="352" y="396" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjY=" x="352" y="473" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2Rlcjc=" x="352" y="551" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2Rlcjg=" x="132" y="9" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2Rlcjk=" x="132" y="86" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjEw" x="132" y="163" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjEx" x="132" y="241" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjEy" x="132" y="318" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjEz" x="132" y="396" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjE0" x="132" y="473" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjE1" x="132" y="551" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjE2" x="70" y="9" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjE3" x="70" y="86" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjE4" x="70" y="163" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjE5" x="70" y="241" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjIw" x="70" y="318" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjIx" x="70" y="396" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjIy" x="70" y="473" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjIz" x="70" y="551" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjI0" x="9" y="9" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjI1" x="9" y="86" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjI2" x="9" y="163" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjI3" x="9" y="241" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjI4" x="9" y="318" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjI5" x="9" y="396" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjMw" x="9" y="473" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjMx" x="9" y="551" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="ZW5jb2RlcjA=" x="352" y="9" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder">
<midi var="x" type="0" channel="1" data1="0" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlOQ==" x="198" y="89" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="31" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMTA=" x="198" y="166" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="33" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMTE=" x="198" y="244" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="35" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMTI=" x="198" y="321" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="37" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMTM=" x="198" y="399" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="39" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMTQ=" x="198" y="476" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="41" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMTU=" x="198" y="554" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="43" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMTY=" x="319" y="618" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="45" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMTc=" x="319" y="678" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="31" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMTg=" x="267" y="618" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="33" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMTk=" x="267" y="678" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="35" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMjA=" x="216" y="618" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="37" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMjE=" x="216" y="678" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="39" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMjI=" x="165" y="618" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="41" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMjM=" x="165" y="678" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="43" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMjQ=" x="113" y="745" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="45" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMjU=" x="114" y="801" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="31" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMjY=" x="63" y="618" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="33" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMjc=" x="63" y="678" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="35" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMjg=" x="12" y="618" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="37" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMjk=" x="12" y="678" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="0" channel="1" data1="39" data2f="0" data2t="127" sysex="" />
</control>
<control name="dG9nZ2xlMA==" x="254" y="12" w="45" h="50" color="blue" scalef="0.0" scalet="1.0" type="toggle" local_off="false">
<midi var="x" type="1" channel="1" data1="0" data2f="0" data2t="127" sysex="" />
<midi var="z" type="1" channel="1" data1="0" data2f="0" data2t="127" sysex="" />
</control>
<control name="cHVzaDI0" x="114" y="621" w="45" h="45" color="red" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true">
<midi var="x" type="1" channel="1" data1="24" data2f="0" data2t="127" sysex="" />
</control>
<control name="cHVzaDI1" x="114" y="680" w="45" h="45" color="red" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true">
<midi var="x" type="1" channel="1" data1="25" data2f="0" data2t="127" sysex="" />
</control>
<control name="cm90YXJ5MA==" x="14" y="569" w="100" h="100" color="red" scalef="0.0" scalet="1.0" type="rotaryh" response="absolute" inverted="false" centered="false" norollover="true">
<midi var="x" type="0" channel="1" data1="0" data2f="0" data2t="127" sysex="" />
</control>
</tabpage>
<tabpage name="NA==" scalef="0.0" scalet="1.0" li_t="" li_c="gray" li_s="14" li_o="false" li_b="false" la_t="" la_c="gray" la_s="14" la_o="false" la_b="false">
<control name="bXVsdGlmYWRlcjA=" x="119" y="8" w="119" h="465" color="green" scalef="0.0" scalet="1.0" type="multifaderh" inverted="false" centered="false" number="10">
<midi var="x3" type="0" channel="1" data1="72" data2f="0" data2t="127" sysex="" />
<midi var="x2" type="0" channel="1" data1="71" data2f="0" data2t="127" sysex="" />
<midi var="x1" type="0" channel="1" data1="70" data2f="0" data2t="127" sysex="" />
<midi var="x9" type="0" channel="1" data1="78" data2f="0" data2t="127" sysex="" />
<midi var="x8" type="0" channel="1" data1="77" data2f="0" data2t="127" sysex="" />
<midi var="x7" type="0" channel="1" data1="76" data2f="0" data2t="127" sysex="" />
<midi var="x6" type="0" channel="1" data1="75" data2f="0" data2t="127" sysex="" />
<midi var="x5" type="0" channel="1" data1="74" data2f="0" data2t="127" sysex="" />
<midi var="x10" type="0" channel="1" data1="79" data2f="0" data2t="127" sysex="" />
<midi var="x4" type="0" channel="1" data1="73" data2f="0" data2t="127" sysex="" />
</control>
<control name="ZmFkZXIz" x="0" y="151" w="120" h="40" color="blue" scalef="0.0" scalet="1.0" type="faderh" response="relative" inverted="false" centered="false" />
<control name="ZmFkZXIx" x="0" y="59" w="120" h="40" color="blue" scalef="0.0" scalet="1.0" type="faderh" response="relative" inverted="false" centered="false" />
<control name="ZmFkZXIy" x="0" y="105" w="120" h="40" color="blue" scalef="0.0" scalet="1.0" type="faderh" response="relative" inverted="false" centered="false" />
<control name="ZmFkZXI1" x="0" y="242" w="120" h="40" color="blue" scalef="0.0" scalet="1.0" type="faderh" response="relative" inverted="false" centered="false" />
<control name="ZmFkZXI2" x="0" y="288" w="120" h="40" color="blue" scalef="0.0" scalet="1.0" type="faderh" response="relative" inverted="false" centered="false" />
<control name="ZmFkZXI3" x="0" y="334" w="120" h="40" color="blue" scalef="0.0" scalet="1.0" type="faderh" response="relative" inverted="false" centered="false" />
<control name="ZmFkZXI4" x="0" y="380" w="120" h="40" color="blue" scalef="0.0" scalet="1.0" type="faderh" response="relative" inverted="false" centered="false" />
<control name="ZmFkZXIw" x="0" y="14" w="120" h="40" color="blue" scalef="0.0" scalet="1.0" type="faderh" response="relative" inverted="false" centered="false" />
<control name="ZmFkZXI0" x="0" y="197" w="120" h="40" color="blue" scalef="0.0" scalet="1.0" type="faderh" response="relative" inverted="false" centered="false" />
<control name="bGFiZWwx" x="234" y="54" w="20" h="51" color="green" type="labelv" text="bGFiZWwx" size="14" background="true" outline="false" />
<control name="bGFiZWwy" x="234" y="100" w="20" h="51" color="green" type="labelv" text="bGFiZWwy" size="14" background="true" outline="false" />
<control name="bGFiZWwz" x="234" y="146" w="20" h="51" color="green" type="labelv" text="bGFiZWwz" size="14" background="true" outline="false" />
<control name="bGFiZWw0" x="234" y="192" w="20" h="51" color="green" type="labelv" text="bGFiZWw0" size="14" background="true" outline="false" />
<control name="bGFiZWw1" x="234" y="238" w="20" h="51" color="green" type="labelv" text="bGFiZWw1" size="14" background="true" outline="false" />
<control name="bGFiZWw2" x="234" y="284" w="20" h="51" color="green" type="labelv" text="bGFiZWw2" size="14" background="true" outline="false" />
<control name="bGFiZWw3" x="234" y="330" w="20" h="51" color="green" type="labelv" text="bGFiZWw3" size="14" background="true" outline="false" />
<control name="bGFiZWw4" x="234" y="376" w="20" h="51" color="green" type="labelv" text="bGFiZWw4" size="14" background="true" outline="false" />
<control name="bGFiZWw5" x="234" y="423" w="20" h="51" color="green" type="labelv" text="bGFiZWw5" size="14" background="true" outline="false" />
<control name="bGFiZWww" x="234" y="8" w="20" h="51" color="green" type="labelv" text="bGFiZWww" size="14" background="true" outline="false" />
<control name="dGltZTA=" x="19" y="426" w="20" h="47" color="red" type="timev" size="14" background="true" outline="true" seconds="false" />
<control name="YmF0dGVyeTA=" x="0" y="426" w="20" h="47" color="red" type="batteryv" size="14" background="true" outline="true" />
<control name="bGFiZWwxMA==" x="95" y="419" w="25" h="62" color="red" type="labelv" text="bGFiZWwxMA==" size="14" background="true" outline="true" />
<control name="ZW5jb2RlcjA=" x="39" y="421" w="56" h="56" color="red" scalef="0.0" scalet="1.0" type="encoder" />
<control name="cHVzaDE=" x="253" y="36" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDI=" x="253" y="65" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDM=" x="253" y="94" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDQ=" x="253" y="123" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDU=" x="253" y="152" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDY=" x="253" y="181" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDc=" x="253" y="210" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDg=" x="253" y="239" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDk=" x="253" y="268" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDEw" x="253" y="297" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDEx" x="253" y="326" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDEy" x="253" y="355" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDEz" x="253" y="384" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDE0" x="253" y="413" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDE1" x="253" y="443" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
<control name="cHVzaDA=" x="253" y="7" w="25" h="31" color="purple" scalef="0.0" scalet="1.0" type="push" local_off="false" sp="true" sr="true" />
</tabpage>
</layout>

View File

@ -0,0 +1,12 @@
<DOMSymbolItem name="dagger" last_modified="1414141442">
<timeline>
<DOMTimeline name="dagger timeline name" current_frame="7" guides="11">
<layers>
<DOMLayer name="Layer 2" name2="Lalayer 2">
</DOMLayer>
<DOMLayer name="Layer 1" name2="Lalayer 1">
</DOMLayer>
</layers>
</DOMTimeline>
</timeline>
</DOMSymbolItem>

View File

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<device schemaversion="foo" xmlns="http://www.w3.org/2001/XMLSchema-instance" xsnonamespaceschemalocation="CMSIS-SVD.xsd">
<devattributes>
<vendor>Renesas</vendor>
<vendorid>Renesas</vendorid>
<name>V850</name>
<series>E1/E2/CA2</series>
<version>1.2</version>
<description>NEC/Renesas V850 automotive grade ICs</description>
<licensetext>GPLv3</licensetext>
<cpu>
<name>V850</name>
<revision>r1</revision>
<endian>LE</endian>
<mpupresent>false</mpupresent>
<fpupresent>false</fpupresent>
<vendorsystickconfig>false</vendorsystickconfig>
</cpu>
<addressunitbits>8</addressunitbits>
<width>32</width>
<size>32</size>
<access>read-write</access>
<resetvalue>0x00000000</resetvalue>
<resetmask>0xFFFFFFFF</resetmask>
<peripherals>
<name>Specific Registers</name>
<version>1.0</version>
<description>Specific Registers</description>
<groupname>MCU</groupname>
<baseaddress>0xFFFFF1FC</baseaddress>
<size>16</size>
<access>read-write</access>
<registers>
<name>PRCMD</name>
<description>This command register (PRCMD) is to protect the registers that may have a significant influence on the application system (PSC, PSM) from an inadvertent write access, so that the system does not stop in case of a program hang-up.</description>
<addressoffset>0xFFFFF1FC</addressoffset>
<size>8</size>
<access>read-write</access>
<resetvalue>0x0000</resetvalue>
<resetmask>0xFFFF</resetmask>
</registers>
</peripherals>
</devattributes>
</device>

View File

@ -2,6 +2,84 @@
//!
//! YaSerDe is a framework for ***ser***ializing and ***de***serializing Rust data
//! structures efficiently and generically from and into XML.
//!
//! YaSerDe makes it easy to serialize XML documents given an properly annotated struct.
//! Please refer to the `examples` directory for the complete code shown below.
//!
//! # Serialize
//!
//! For instance, let's say that one wants to generate a XML file for the
//! [Rust-Embedded community](https://github.com/rust-embedded/). A well known XML
//! file for microcontrollers is called [SVD](https://github.com/rust-embedded/svd/)
//! and it can be defined on YaSerDe via structs like so:
//!
//!```rust
//! use yaserde_derive::YaSerialize;
//!
//! #[derive(Default, PartialEq, Debug, YaSerialize)]
//! #[yaserde(rename = "device")]
//! struct Device {
//! #[yaserde(attribute)]
//! schemaversion: String,
//! #[yaserde(attribute)]
//! xmlns: String,
//! #[yaserde(attribute)]
//! xsnonamespaceschemalocation: String,
//! #[yaserde(child)]
//! attributes: DeviceAttributes
//! }
//!
//! #[derive(Default, PartialEq, Debug, YaSerialize)]
//! struct DeviceAttributes {
//! #[yaserde(child)]
//! vendor: String,
//! }
//!```
//!
//! The interspersed `#[yaserde()]` macros give some indication of what the resulting XML
//! Will look like, namely, a short snippet of the struct above in XML would be depending on
//! concrete values passed to the struct (not shown):
//!
//!```xml
//! (...)
//! <device schemaversion: "1.0-example", xmlns: "ns:.... example"
//! xsnonamespaceschemalocation: "foo_bar_baz">
//! <devattributes>
//! </devattributes>
//! (...)
//!```
//!
//! Notice the important difference in **XML output representation between `attributes` vs
//! `child`**, since SVD expects information in that particular arrangement. YaSerDe allows that
//! serialized XML to be valid unlike other Rust XML (de)serialization crates (i.e quick-xml).
//!
//! Also the last `DevAttrs` struct field is indeed another struct, so one can chain several
//! structs to compose the XML structure (again, see examples folder for the complete
//! example).
//!
//! Be mindful that the **Cargo.toml** should not only include `yaserde` and
//! `yaserde_derive`, but also a few necessary dependencies... [FIXME: THAT FOR SOME
//! USER-UNFRIENDLY REASON ARE NOT AUTOMATICALLY PULLED IN AS ONE WOULD EXPECT ;P ;P
//! ... I'm sure there are good reasons, just wanted to leave this like this so that the author
//! can chip in and comment about the reasons behind that decision.](https://github.com/media-io/yaserde/issues/22) ... **I personally think that issue #22 should be reopened and fixed properly (as in only requiring yaserde as a dependency, adding yaserde_derive as a feature).**
//!
//!```toml
//! [dependencies]
//! # serde = { version = "1.0.123", features = [ "derive" ] }
//! # quick-xml = { version = "0.21.0", features = [ "serialize" ] }
//! yaserde = "0.5.1"
//! yaserde_derive = "0.5.1"
//! xml-rs = "0.8.3"
//! log = "0.4"
//! ```
//!
//! Last but not least, in order to have a nice, pretty printed XML output one can do
//!
//! ```shell
//! PLEASE LET THE USERS KNOW HOW TO DO THAT CLEARLY ON YASERDE???
//! ```
//!
//! FIXME: For now I'm just resorting to online XML linters and formatters :_S
#[macro_use]
extern crate log;

View File

@ -15,29 +15,29 @@ fn basic_option_types() {
test_for_type!(Option::<String>, None, None);
test_for_type!(Option::<bool>, Some(true), Some("true"));
test_for_type!(Option::<bool>, None, None);
test_for_type!(Option::<u8>, Some(12 as u8), Some("12"));
test_for_type!(Option::<u8>, Some(12_u8), Some("12"));
test_for_type!(Option::<u8>, None, None);
test_for_type!(Option::<i8>, Some(12 as i8), Some("12"));
test_for_type!(Option::<i8>, Some(-12 as i8), Some("-12"));
test_for_type!(Option::<i8>, Some(12_i8), Some("12"));
test_for_type!(Option::<i8>, Some(-12_i8), Some("-12"));
test_for_type!(Option::<i8>, None, None);
test_for_type!(Option::<u16>, Some(12 as u16), Some("12"));
test_for_type!(Option::<u16>, Some(12_u16), Some("12"));
test_for_type!(Option::<u16>, None, None);
test_for_type!(Option::<i16>, Some(12 as i16), Some("12"));
test_for_type!(Option::<i16>, Some(-12 as i16), Some("-12"));
test_for_type!(Option::<i16>, Some(12_i16), Some("12"));
test_for_type!(Option::<i16>, Some(-12_i16), Some("-12"));
test_for_type!(Option::<i16>, None, None);
test_for_type!(Option::<u32>, Some(12 as u32), Some("12"));
test_for_type!(Option::<u32>, Some(12_u32), Some("12"));
test_for_type!(Option::<u32>, None, None);
test_for_type!(Option::<i32>, Some(12 as i32), Some("12"));
test_for_type!(Option::<i32>, Some(-12 as i32), Some("-12"));
test_for_type!(Option::<i32>, Some(12_i32), Some("12"));
test_for_type!(Option::<i32>, Some(-12_i32), Some("-12"));
test_for_type!(Option::<i32>, None, None);
test_for_type!(Option::<u64>, Some(12 as u64), Some("12"));
test_for_type!(Option::<u64>, Some(12_u64), Some("12"));
test_for_type!(Option::<u64>, None, None);
test_for_type!(Option::<i64>, Some(12 as i64), Some("12"));
test_for_type!(Option::<i64>, Some(-12 as i64), Some("-12"));
test_for_type!(Option::<i64>, Some(12_i64), Some("12"));
test_for_type!(Option::<i64>, Some(-12_i64), Some("-12"));
test_for_type!(Option::<i64>, None, None);
test_for_type!(Option::<f32>, Some(-12.5 as f32), Some("-12.5"));
test_for_type!(Option::<f32>, Some(-12.5_f32), Some("-12.5"));
test_for_type!(Option::<f32>, None, None);
test_for_type!(Option::<f64>, Some(-12.5 as f64), Some("-12.5"));
test_for_type!(Option::<f64>, Some(-12.5_f64), Some("-12.5"));
test_for_type!(Option::<f64>, None, None);
// TODO
@ -50,29 +50,29 @@ fn basic_option_types() {
test_for_attribute_type!(Option::<String>, None, None);
test_for_attribute_type!(Option::<bool>, Some(true), Some("true"));
test_for_attribute_type!(Option::<bool>, None, None);
test_for_attribute_type!(Option::<u8>, Some(12 as u8), Some("12"));
test_for_attribute_type!(Option::<u8>, Some(12_u8), Some("12"));
test_for_attribute_type!(Option::<u8>, None, None);
test_for_attribute_type!(Option::<i8>, Some(12 as i8), Some("12"));
test_for_attribute_type!(Option::<i8>, Some(-12 as i8), Some("-12"));
test_for_attribute_type!(Option::<i8>, Some(12_i8), Some("12"));
test_for_attribute_type!(Option::<i8>, Some(-12_i8), Some("-12"));
test_for_attribute_type!(Option::<i8>, None, None);
test_for_attribute_type!(Option::<u16>, Some(12 as u16), Some("12"));
test_for_attribute_type!(Option::<u16>, Some(12_u16), Some("12"));
test_for_attribute_type!(Option::<u16>, None, None);
test_for_attribute_type!(Option::<i16>, Some(12 as i16), Some("12"));
test_for_attribute_type!(Option::<i16>, Some(-12 as i16), Some("-12"));
test_for_attribute_type!(Option::<i16>, Some(12_i16), Some("12"));
test_for_attribute_type!(Option::<i16>, Some(-12_i16), Some("-12"));
test_for_attribute_type!(Option::<i16>, None, None);
test_for_attribute_type!(Option::<u32>, Some(12 as u32), Some("12"));
test_for_attribute_type!(Option::<u32>, Some(12_u32), Some("12"));
test_for_attribute_type!(Option::<u32>, None, None);
test_for_attribute_type!(Option::<i32>, Some(12 as i32), Some("12"));
test_for_attribute_type!(Option::<i32>, Some(-12 as i32), Some("-12"));
test_for_attribute_type!(Option::<i32>, Some(12_i32), Some("12"));
test_for_attribute_type!(Option::<i32>, Some(-12_i32), Some("-12"));
test_for_attribute_type!(Option::<i32>, None, None);
test_for_attribute_type!(Option::<u64>, Some(12 as u64), Some("12"));
test_for_attribute_type!(Option::<u64>, Some(12_u64), Some("12"));
test_for_attribute_type!(Option::<u64>, None, None);
test_for_attribute_type!(Option::<i64>, Some(12 as i64), Some("12"));
test_for_attribute_type!(Option::<i64>, Some(-12 as i64), Some("-12"));
test_for_attribute_type!(Option::<i64>, Some(12_i64), Some("12"));
test_for_attribute_type!(Option::<i64>, Some(-12_i64), Some("-12"));
test_for_attribute_type!(Option::<i64>, None, None);
test_for_attribute_type!(Option::<f32>, Some(-12.5 as f32), Some("-12.5"));
test_for_attribute_type!(Option::<f32>, Some(-12.5_f32), Some("-12.5"));
test_for_attribute_type!(Option::<f32>, None, None);
test_for_attribute_type!(Option::<f64>, Some(-12.5 as f64), Some("-12.5"));
test_for_attribute_type!(Option::<f64>, Some(-12.5_f64), Some("-12.5"));
test_for_attribute_type!(Option::<f64>, None, None);
}

View File

@ -34,7 +34,7 @@ fn skip_serializing_if_for_struct() {
}
impl XmlStruct {
fn check_string_function(&self, value: &String) -> bool {
fn check_string_function(&self, value: &str) -> bool {
value == "something"
}
@ -47,7 +47,7 @@ fn skip_serializing_if_for_struct() {
}
fn check_f32_function(&self, value: &f32) -> bool {
value == &0.0
(value - 0.0).abs() < f32::EPSILON
}
}

View File

@ -13,37 +13,37 @@ fn ser_type() {
test_for_type!(String, "test".to_string(), Some("test"));
test_for_type!(bool, true, Some("true"));
test_for_type!(u8, 12 as u8, Some("12"));
test_for_type!(i8, 12 as i8, Some("12"));
test_for_type!(i8, -12 as i8, Some("-12"));
test_for_type!(u16, 12 as u16, Some("12"));
test_for_type!(i16, 12 as i16, Some("12"));
test_for_type!(i16, -12 as i16, Some("-12"));
test_for_type!(u32, 12 as u32, Some("12"));
test_for_type!(i32, 12 as i32, Some("12"));
test_for_type!(i32, -12 as i32, Some("-12"));
test_for_type!(u64, 12 as u64, Some("12"));
test_for_type!(i64, 12 as i64, Some("12"));
test_for_type!(i64, -12 as i64, Some("-12"));
test_for_type!(f32, -12.5 as f32, Some("-12.5"));
test_for_type!(f64, -12.5 as f64, Some("-12.5"));
test_for_type!(u8, 12_u8, Some("12"));
test_for_type!(i8, 12_i8, Some("12"));
test_for_type!(i8, -12_i8, Some("-12"));
test_for_type!(u16, 12_u16, Some("12"));
test_for_type!(i16, 12_i16, Some("12"));
test_for_type!(i16, -12_i16, Some("-12"));
test_for_type!(u32, 12_u32, Some("12"));
test_for_type!(i32, 12_i32, Some("12"));
test_for_type!(i32, -12_i32, Some("-12"));
test_for_type!(u64, 12_u64, Some("12"));
test_for_type!(i64, 12_i64, Some("12"));
test_for_type!(i64, -12_i64, Some("-12"));
test_for_type!(f32, -12.5_f32, Some("-12.5"));
test_for_type!(f64, -12.5_f64, Some("-12.5"));
test_for_type!(Vec::<String>, vec![], None);
test_for_type!(Vec::<String>, vec!["test".to_string()], Some("test"));
test_for_attribute_type!(String, "test".to_string(), Some("test"));
test_for_attribute_type!(bool, true, Some("true"));
test_for_attribute_type!(u8, 12 as u8, Some("12"));
test_for_attribute_type!(i8, 12 as i8, Some("12"));
test_for_attribute_type!(i8, -12 as i8, Some("-12"));
test_for_attribute_type!(u16, 12 as u16, Some("12"));
test_for_attribute_type!(i16, 12 as i16, Some("12"));
test_for_attribute_type!(i16, -12 as i16, Some("-12"));
test_for_attribute_type!(u32, 12 as u32, Some("12"));
test_for_attribute_type!(i32, 12 as i32, Some("12"));
test_for_attribute_type!(i32, -12 as i32, Some("-12"));
test_for_attribute_type!(u64, 12 as u64, Some("12"));
test_for_attribute_type!(i64, 12 as i64, Some("12"));
test_for_attribute_type!(i64, -12 as i64, Some("-12"));
test_for_attribute_type!(f32, -12.5 as f32, Some("-12.5"));
test_for_attribute_type!(f64, -12.5 as f64, Some("-12.5"));
test_for_attribute_type!(u8, 12_u8, Some("12"));
test_for_attribute_type!(i8, 12_i8, Some("12"));
test_for_attribute_type!(i8, -12_i8, Some("-12"));
test_for_attribute_type!(u16, 12_u16, Some("12"));
test_for_attribute_type!(i16, 12_i16, Some("12"));
test_for_attribute_type!(i16, -12_i16, Some("-12"));
test_for_attribute_type!(u32, 12_u32, Some("12"));
test_for_attribute_type!(i32, 12_i32, Some("12"));
test_for_attribute_type!(i32, -12_i32, Some("-12"));
test_for_attribute_type!(u64, 12_u64, Some("12"));
test_for_attribute_type!(i64, 12_i64, Some("12"));
test_for_attribute_type!(i64, -12_i64, Some("-12"));
test_for_attribute_type!(f32, -12.5_f32, Some("-12.5"));
test_for_attribute_type!(f64, -12.5_f64, Some("-12.5"));
}