diff --git a/src/lib.rs b/src/lib.rs index 80199cf9..c85c4314 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -75,6 +75,16 @@ pub struct Device { pub cpu: Option, pub peripherals: Vec, pub defaults: Defaults, + pub vendor: Option, + pub vendor_id: Option, + pub series: Option, + pub version: Option, + pub description: Option, + pub license_text: Option, + pub header_system_filename: Option, + pub header_definitions_prefix: Option, + pub address_unit_bits: u64, + pub width: u64, // Reserve the right to add more fields to this struct _extensible: (), } @@ -97,6 +107,16 @@ impl Device { .map(Peripheral::parse) .collect(), defaults: Defaults::parse(tree), + vendor: tree.get_child_text("vendor"), + vendor_id: tree.get_child_text("vendorID"), + series: tree.get_child_text("series"), + version: tree.get_child_text("version"), + description: tree.get_child_text("description"), + license_text: tree.get_child_text("licenseText"), + header_system_filename: tree.get_child_text("headerSystemFilename"), + header_definitions_prefix: tree.get_child_text("headerDefinitionsPrefix"), + address_unit_bits: try!(tree.get_child_text("addressUnitBits").map(|x| x.parse::().unwrap())), + width: try!(tree.get_child_text("width").map(|x| x.parse::().unwrap())), _extensible: (), } }