aarch32_cpu/register/armv8r/
hsctlr.rs1use crate::register::{SysReg, SysRegRead, SysRegWrite};
4
5#[bitbybit::bitfield(u32, debug, defmt_bitfields(feature = "defmt"))]
7pub struct Hsctlr {
8 #[bits(30..=30, rw)]
10 te: bool,
11 #[bits(25..=25, rw)]
13 ee: bool,
14 #[bits(21..=21, rw)]
16 fi: bool,
17 #[bits(19..=19, rw)]
19 wxn: bool,
20 #[bits(17..=17, rw)]
22 br: bool,
23 #[bits(12..=12, rw)]
25 i: bool,
26 #[bits(8..=8, rw)]
28 sed: bool,
29 #[bits(7..=7, rw)]
31 itd: bool,
32 #[bits(5..=5, rw)]
34 cp15ben: bool,
35 #[bits(2..=2, rw)]
37 c: bool,
38 #[bits(1..=1, rw)]
40 a: bool,
41 #[bits(0..=0, rw)]
43 m: bool,
44}
45
46impl SysReg for Hsctlr {
47 const CP: u32 = 15;
48 const CRN: u32 = 1;
49 const OP1: u32 = 4;
50 const CRM: u32 = 0;
51 const OP2: u32 = 0;
52}
53
54impl crate::register::SysRegRead for Hsctlr {}
55
56impl Hsctlr {
57 #[inline]
58 pub fn read() -> Hsctlr {
60 unsafe { Self::new_with_raw_value(<Self as SysRegRead>::read_raw()) }
61 }
62}
63
64impl crate::register::SysRegWrite for Hsctlr {}
65
66impl Hsctlr {
67 #[inline]
68 pub fn write(value: Self) {
70 unsafe {
71 <Self as SysRegWrite>::write_raw(value.raw_value());
72 }
73 }
74 #[inline]
76 pub fn modify<F>(f: F)
77 where
78 F: FnOnce(&mut Self),
79 {
80 let mut val = Self::read();
81 f(&mut val);
82 Self::write(val);
83 }
84}