svd_generator/svd/peripheral/
jh7110_ispcrg.rs1use crate::svd::create_peripheral;
2use crate::Result;
3
4pub mod registers;
5
6pub struct Jh7110IspCrg {
8 peripheral: svd::Peripheral,
9}
10
11impl Jh7110IspCrg {
12 pub fn create(
14 name: &str,
15 base_address: u64,
16 size: u32,
17 interrupt: Option<Vec<svd::Interrupt>>,
18 ) -> Result<Self> {
19 let peripheral = create_peripheral(
20 name,
21 format!("StarFive JH7110 ISP CRG: {name}").as_str(),
22 base_address,
23 size,
24 interrupt,
25 Some(registers::create()?),
26 None,
27 )?;
28
29 Ok(Self { peripheral })
30 }
31
32 pub const fn peripheral(&self) -> &svd::Peripheral {
34 &self.peripheral
35 }
36
37 pub fn peripheral_mut(&mut self) -> &mut svd::Peripheral {
39 &mut self.peripheral
40 }
41
42 pub fn to_inner(self) -> svd::Peripheral {
44 self.peripheral
45 }
46}