svd_parser/
registerproperties.rs

1use super::*;
2use crate::svd::{Access, Protection, RegisterProperties};
3
4impl Parse for RegisterProperties {
5    type Object = Self;
6    type Error = SVDErrorAt;
7    type Config = Config;
8
9    fn parse(tree: &Node, config: &Self::Config) -> Result<Self, Self::Error> {
10        RegisterProperties::new()
11            .size(optional::<u32>("size", tree, &())?)
12            .access(optional::<Access>("access", tree, config)?)
13            .protection(optional::<Protection>("protection", tree, config)?)
14            .reset_value(optional::<u64>("resetValue", tree, &())?)
15            .reset_mask(optional::<u64>("resetMask", tree, &())?)
16            .build(config.validate_level)
17            .map_err(|e| SVDError::from(e).at(tree.id()))
18    }
19}