aarch32_cpu/register/hyp/
hcptr.rs1use crate::register::{SysReg, SysRegRead, SysRegWrite};
4
5#[bitbybit::bitfield(u32, debug, defmt_fields(feature = "defmt"))]
7#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8pub struct Hcptr {
9 #[bit(31, rw)]
11 tcpac: bool,
12 #[bit(20, rw)]
14 tta: bool,
15 #[bit(15, rw)]
17 tase: bool,
18 #[bit(10, rw)]
20 tcp: bool,
21}
22
23impl SysReg for Hcptr {
24 const CP: u32 = 15;
25 const CRN: u32 = 1;
26 const OP1: u32 = 4;
27 const CRM: u32 = 1;
28 const OP2: u32 = 2;
29}
30
31impl crate::register::SysRegRead for Hcptr {}
32
33impl Hcptr {
34 #[inline]
35 pub fn read() -> Hcptr {
37 Self::new_with_raw_value(<Self as SysRegRead>::read_raw())
38 }
39
40 #[inline]
42 pub fn modify<F>(f: F)
43 where
44 F: FnOnce(&mut Self),
45 {
46 let mut value = Self::read();
47 f(&mut value);
48 Self::write(value);
49 }
50}
51
52impl crate::register::SysRegWrite for Hcptr {}
53
54impl Hcptr {
55 #[inline]
56 pub fn write(value: Self) {
58 unsafe {
59 <Self as SysRegWrite>::write_raw(value.raw_value());
60 }
61 }
62}