1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
use crate::generic::*; #[doc = "Interrupt Enable"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Inte(pub u32); impl Inte { pub const fn alarm_3(&self) -> bool { let val = (self.0 >> 3u32) & 0x01; val != 0 } pub fn set_alarm_3(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 3u32)) | (((val as u32) & 0x01) << 3u32); } pub const fn alarm_2(&self) -> bool { let val = (self.0 >> 2u32) & 0x01; val != 0 } pub fn set_alarm_2(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 2u32)) | (((val as u32) & 0x01) << 2u32); } pub const fn alarm_1(&self) -> bool { let val = (self.0 >> 1u32) & 0x01; val != 0 } pub fn set_alarm_1(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 1u32)) | (((val as u32) & 0x01) << 1u32); } pub const fn alarm_0(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } pub fn set_alarm_0(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Inte { fn default() -> Inte { Inte(0) } } #[doc = "Set high to pause the timer"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Pause(pub u32); impl Pause { pub const fn pause(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } pub fn set_pause(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Pause { fn default() -> Pause { Pause(0) } } #[doc = "Interrupt Force"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Intf(pub u32); impl Intf { pub const fn alarm_3(&self) -> bool { let val = (self.0 >> 3u32) & 0x01; val != 0 } pub fn set_alarm_3(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 3u32)) | (((val as u32) & 0x01) << 3u32); } pub const fn alarm_2(&self) -> bool { let val = (self.0 >> 2u32) & 0x01; val != 0 } pub fn set_alarm_2(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 2u32)) | (((val as u32) & 0x01) << 2u32); } pub const fn alarm_1(&self) -> bool { let val = (self.0 >> 1u32) & 0x01; val != 0 } pub fn set_alarm_1(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 1u32)) | (((val as u32) & 0x01) << 1u32); } pub const fn alarm_0(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } pub fn set_alarm_0(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Intf { fn default() -> Intf { Intf(0) } } #[doc = "Set bits high to enable pause when the corresponding debug ports are active"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Dbgpause(pub u32); impl Dbgpause { #[doc = "Pause when processor 1 is in debug mode"] pub const fn dbg1(&self) -> bool { let val = (self.0 >> 2u32) & 0x01; val != 0 } #[doc = "Pause when processor 1 is in debug mode"] pub fn set_dbg1(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 2u32)) | (((val as u32) & 0x01) << 2u32); } #[doc = "Pause when processor 0 is in debug mode"] pub const fn dbg0(&self) -> bool { let val = (self.0 >> 1u32) & 0x01; val != 0 } #[doc = "Pause when processor 0 is in debug mode"] pub fn set_dbg0(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 1u32)) | (((val as u32) & 0x01) << 1u32); } } impl Default for Dbgpause { fn default() -> Dbgpause { Dbgpause(0) } } #[doc = "Raw Interrupts"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Intr(pub u32); impl Intr { pub const fn alarm_3(&self) -> bool { let val = (self.0 >> 3u32) & 0x01; val != 0 } pub fn set_alarm_3(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 3u32)) | (((val as u32) & 0x01) << 3u32); } pub const fn alarm_2(&self) -> bool { let val = (self.0 >> 2u32) & 0x01; val != 0 } pub fn set_alarm_2(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 2u32)) | (((val as u32) & 0x01) << 2u32); } pub const fn alarm_1(&self) -> bool { let val = (self.0 >> 1u32) & 0x01; val != 0 } pub fn set_alarm_1(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 1u32)) | (((val as u32) & 0x01) << 1u32); } pub const fn alarm_0(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } pub fn set_alarm_0(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Intr { fn default() -> Intr { Intr(0) } } #[doc = "Interrupt status after masking & forcing"] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Ints(pub u32); impl Ints { pub const fn alarm_3(&self) -> bool { let val = (self.0 >> 3u32) & 0x01; val != 0 } pub fn set_alarm_3(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 3u32)) | (((val as u32) & 0x01) << 3u32); } pub const fn alarm_2(&self) -> bool { let val = (self.0 >> 2u32) & 0x01; val != 0 } pub fn set_alarm_2(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 2u32)) | (((val as u32) & 0x01) << 2u32); } pub const fn alarm_1(&self) -> bool { let val = (self.0 >> 1u32) & 0x01; val != 0 } pub fn set_alarm_1(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 1u32)) | (((val as u32) & 0x01) << 1u32); } pub const fn alarm_0(&self) -> bool { let val = (self.0 >> 0u32) & 0x01; val != 0 } pub fn set_alarm_0(&mut self, val: bool) { self.0 = (self.0 & !(0x01 << 0u32)) | (((val as u32) & 0x01) << 0u32); } } impl Default for Ints { fn default() -> Ints { Ints(0) } } #[doc = "Indicates the armed/disarmed status of each alarm. A write to the corresponding ALARMx register arms the alarm. Alarms automatically disarm upon firing, but writing ones here will disarm immediately without waiting to fire."] #[repr(transparent)] #[derive(Copy, Clone)] pub struct Armed(pub u32); impl Armed { pub const fn armed(&self) -> u8 { let val = (self.0 >> 0u32) & 0x0f; val as u8 } pub fn set_armed(&mut self, val: u8) { self.0 = (self.0 & !(0x0f << 0u32)) | (((val as u32) & 0x0f) << 0u32); } } impl Default for Armed { fn default() -> Armed { Armed(0) } }