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
#[doc = "Reader of register PIGEON_2_1"] pub type R = crate::R<u32, super::PIGEON_2_1>; #[doc = "Writer for register PIGEON_2_1"] pub type W = crate::W<u32, super::PIGEON_2_1>; #[doc = "Register PIGEON_2_1 `reset()`'s with value 0"] impl crate::ResetValue for super::PIGEON_2_1 { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0 } } #[doc = "Assert signal output when counter match this value\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u16)] pub enum SET_CNT_A { #[doc = "0: Start as active"] START_ACTIVE = 0, } impl From<SET_CNT_A> for u16 { #[inline(always)] fn from(variant: SET_CNT_A) -> Self { variant as _ } } #[doc = "Reader of field `SET_CNT`"] pub type SET_CNT_R = crate::R<u16, SET_CNT_A>; impl SET_CNT_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Variant<u16, SET_CNT_A> { use crate::Variant::*; match self.bits { 0 => Val(SET_CNT_A::START_ACTIVE), i => Res(i), } } #[doc = "Checks if the value of the field is `START_ACTIVE`"] #[inline(always)] pub fn is_start_active(&self) -> bool { *self == SET_CNT_A::START_ACTIVE } } #[doc = "Write proxy for field `SET_CNT`"] pub struct SET_CNT_W<'a> { w: &'a mut W, } impl<'a> SET_CNT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: SET_CNT_A) -> &'a mut W { unsafe { self.bits(variant.into()) } } #[doc = "Start as active"] #[inline(always)] pub fn start_active(self) -> &'a mut W { self.variant(SET_CNT_A::START_ACTIVE) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { self.w.bits = (self.w.bits & !0xffff) | ((value as u32) & 0xffff); self.w } } #[doc = "Deassert signal output when counter match this value\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u16)] pub enum CLR_CNT_A { #[doc = "0: Keep active until mask off"] CLEAR_USING_MASK = 0, } impl From<CLR_CNT_A> for u16 { #[inline(always)] fn from(variant: CLR_CNT_A) -> Self { variant as _ } } #[doc = "Reader of field `CLR_CNT`"] pub type CLR_CNT_R = crate::R<u16, CLR_CNT_A>; impl CLR_CNT_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> crate::Variant<u16, CLR_CNT_A> { use crate::Variant::*; match self.bits { 0 => Val(CLR_CNT_A::CLEAR_USING_MASK), i => Res(i), } } #[doc = "Checks if the value of the field is `CLEAR_USING_MASK`"] #[inline(always)] pub fn is_clear_using_mask(&self) -> bool { *self == CLR_CNT_A::CLEAR_USING_MASK } } #[doc = "Write proxy for field `CLR_CNT`"] pub struct CLR_CNT_W<'a> { w: &'a mut W, } impl<'a> CLR_CNT_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: CLR_CNT_A) -> &'a mut W { unsafe { self.bits(variant.into()) } } #[doc = "Keep active until mask off"] #[inline(always)] pub fn clear_using_mask(self) -> &'a mut W { self.variant(CLR_CNT_A::CLEAR_USING_MASK) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u16) -> &'a mut W { self.w.bits = (self.w.bits & !(0xffff << 16)) | (((value as u32) & 0xffff) << 16); self.w } } impl R { #[doc = "Bits 0:15 - Assert signal output when counter match this value"] #[inline(always)] pub fn set_cnt(&self) -> SET_CNT_R { SET_CNT_R::new((self.bits & 0xffff) as u16) } #[doc = "Bits 16:31 - Deassert signal output when counter match this value"] #[inline(always)] pub fn clr_cnt(&self) -> CLR_CNT_R { CLR_CNT_R::new(((self.bits >> 16) & 0xffff) as u16) } } impl W { #[doc = "Bits 0:15 - Assert signal output when counter match this value"] #[inline(always)] pub fn set_cnt(&mut self) -> SET_CNT_W { SET_CNT_W { w: self } } #[doc = "Bits 16:31 - Deassert signal output when counter match this value"] #[inline(always)] pub fn clr_cnt(&mut self) -> CLR_CNT_W { CLR_CNT_W { w: self } } }