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 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
#[doc = "Reader of register MASK"] pub type R = crate::R<u16, super::MASK>; #[doc = "Writer for register MASK"] pub type W = crate::W<u16, super::MASK>; #[doc = "Register MASK `reset()`'s with value 0"] impl crate::ResetValue for super::MASK { type Type = u16; #[inline(always)] fn reset_value() -> Self::Type { 0 } } #[doc = "PWM_X Masks\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum MASKX_A { #[doc = "0: PWM_X output normal."] MASKX_0 = 0, #[doc = "1: PWM_X output masked."] MASKX_1 = 1, } impl From<MASKX_A> for u8 { #[inline(always)] fn from(variant: MASKX_A) -> Self { variant as _ } } #[doc = "Reader of field `MASKX`"] pub type MASKX_R = crate::R<u8, MASKX_A>; impl MASKX_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Variant<u8, MASKX_A> { use crate::Variant::*; match self.bits { 0 => Val(MASKX_A::MASKX_0), 1 => Val(MASKX_A::MASKX_1), i => Res(i), } } #[doc = "Checks if the value of the field is `MASKX_0`"] #[inline(always)] pub fn is_maskx_0(&self) -> bool { *self == MASKX_A::MASKX_0 } #[doc = "Checks if the value of the field is `MASKX_1`"] #[inline(always)] pub fn is_maskx_1(&self) -> bool { *self == MASKX_A::MASKX_1 } } #[doc = "Write proxy for field `MASKX`"] pub struct MASKX_W<'a> { w: &'a mut W, } impl<'a> MASKX_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MASKX_A) -> &'a mut W { unsafe { self.bits(variant.into()) } } #[doc = "PWM_X output normal."] #[inline(always)] pub fn maskx_0(self) -> &'a mut W { self.variant(MASKX_A::MASKX_0) } #[doc = "PWM_X output masked."] #[inline(always)] pub fn maskx_1(self) -> &'a mut W { self.variant(MASKX_A::MASKX_1) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !0x0f) | ((value as u16) & 0x0f); self.w } } #[doc = "PWM_B Masks\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum MASKB_A { #[doc = "0: PWM_B output normal."] MASKB_0 = 0, #[doc = "1: PWM_B output masked."] MASKB_1 = 1, } impl From<MASKB_A> for u8 { #[inline(always)] fn from(variant: MASKB_A) -> Self { variant as _ } } #[doc = "Reader of field `MASKB`"] pub type MASKB_R = crate::R<u8, MASKB_A>; impl MASKB_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Variant<u8, MASKB_A> { use crate::Variant::*; match self.bits { 0 => Val(MASKB_A::MASKB_0), 1 => Val(MASKB_A::MASKB_1), i => Res(i), } } #[doc = "Checks if the value of the field is `MASKB_0`"] #[inline(always)] pub fn is_maskb_0(&self) -> bool { *self == MASKB_A::MASKB_0 } #[doc = "Checks if the value of the field is `MASKB_1`"] #[inline(always)] pub fn is_maskb_1(&self) -> bool { *self == MASKB_A::MASKB_1 } } #[doc = "Write proxy for field `MASKB`"] pub struct MASKB_W<'a> { w: &'a mut W, } impl<'a> MASKB_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MASKB_A) -> &'a mut W { unsafe { self.bits(variant.into()) } } #[doc = "PWM_B output normal."] #[inline(always)] pub fn maskb_0(self) -> &'a mut W { self.variant(MASKB_A::MASKB_0) } #[doc = "PWM_B output masked."] #[inline(always)] pub fn maskb_1(self) -> &'a mut W { self.variant(MASKB_A::MASKB_1) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x0f << 4)) | (((value as u16) & 0x0f) << 4); self.w } } #[doc = "PWM_A Masks\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum MASKA_A { #[doc = "0: PWM_A output normal."] MASKA_0 = 0, #[doc = "1: PWM_A output masked."] MASKA_1 = 1, } impl From<MASKA_A> for u8 { #[inline(always)] fn from(variant: MASKA_A) -> Self { variant as _ } } #[doc = "Reader of field `MASKA`"] pub type MASKA_R = crate::R<u8, MASKA_A>; impl MASKA_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Variant<u8, MASKA_A> { use crate::Variant::*; match self.bits { 0 => Val(MASKA_A::MASKA_0), 1 => Val(MASKA_A::MASKA_1), i => Res(i), } } #[doc = "Checks if the value of the field is `MASKA_0`"] #[inline(always)] pub fn is_maska_0(&self) -> bool { *self == MASKA_A::MASKA_0 } #[doc = "Checks if the value of the field is `MASKA_1`"] #[inline(always)] pub fn is_maska_1(&self) -> bool { *self == MASKA_A::MASKA_1 } } #[doc = "Write proxy for field `MASKA`"] pub struct MASKA_W<'a> { w: &'a mut W, } impl<'a> MASKA_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: MASKA_A) -> &'a mut W { unsafe { self.bits(variant.into()) } } #[doc = "PWM_A output normal."] #[inline(always)] pub fn maska_0(self) -> &'a mut W { self.variant(MASKA_A::MASKA_0) } #[doc = "PWM_A output masked."] #[inline(always)] pub fn maska_1(self) -> &'a mut W { self.variant(MASKA_A::MASKA_1) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x0f << 8)) | (((value as u16) & 0x0f) << 8); self.w } } #[doc = "Update Mask Bits Immediately\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum UPDATE_MASK_AW { #[doc = "0: Normal operation. MASK* bits within the corresponding submodule are not updated until a FORCE_OUT event occurs within the submodule."] UPDATE_MASK_0 = 0, #[doc = "1: Immediate operation. MASK* bits within the corresponding submodule are updated on the following clock edge after setting this bit."] UPDATE_MASK_1 = 1, } impl From<UPDATE_MASK_AW> for u8 { #[inline(always)] fn from(variant: UPDATE_MASK_AW) -> Self { variant as _ } } #[doc = "Write proxy for field `UPDATE_MASK`"] pub struct UPDATE_MASK_W<'a> { w: &'a mut W, } impl<'a> UPDATE_MASK_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: UPDATE_MASK_AW) -> &'a mut W { unsafe { self.bits(variant.into()) } } #[doc = "Normal operation. MASK* bits within the corresponding submodule are not updated until a FORCE_OUT event occurs within the submodule."] #[inline(always)] pub fn update_mask_0(self) -> &'a mut W { self.variant(UPDATE_MASK_AW::UPDATE_MASK_0) } #[doc = "Immediate operation. MASK* bits within the corresponding submodule are updated on the following clock edge after setting this bit."] #[inline(always)] pub fn update_mask_1(self) -> &'a mut W { self.variant(UPDATE_MASK_AW::UPDATE_MASK_1) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x0f << 12)) | (((value as u16) & 0x0f) << 12); self.w } } impl R { #[doc = "Bits 0:3 - PWM_X Masks"] #[inline(always)] pub fn maskx(&self) -> MASKX_R { MASKX_R::new((self.bits & 0x0f) as u8) } #[doc = "Bits 4:7 - PWM_B Masks"] #[inline(always)] pub fn maskb(&self) -> MASKB_R { MASKB_R::new(((self.bits >> 4) & 0x0f) as u8) } #[doc = "Bits 8:11 - PWM_A Masks"] #[inline(always)] pub fn maska(&self) -> MASKA_R { MASKA_R::new(((self.bits >> 8) & 0x0f) as u8) } } impl W { #[doc = "Bits 0:3 - PWM_X Masks"] #[inline(always)] pub fn maskx(&mut self) -> MASKX_W { MASKX_W { w: self } } #[doc = "Bits 4:7 - PWM_B Masks"] #[inline(always)] pub fn maskb(&mut self) -> MASKB_W { MASKB_W { w: self } } #[doc = "Bits 8:11 - PWM_A Masks"] #[inline(always)] pub fn maska(&mut self) -> MASKA_W { MASKA_W { w: self } } #[doc = "Bits 12:15 - Update Mask Bits Immediately"] #[inline(always)] pub fn update_mask(&mut self) -> UPDATE_MASK_W { UPDATE_MASK_W { w: self } } }