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
#[doc = "Reader of register CLK_RECOVER_INT_STATUS"]
pub type R = crate::R<u8, super::CLK_RECOVER_INT_STATUS>;
#[doc = "Writer for register CLK_RECOVER_INT_STATUS"]
pub type W = crate::W<u8, super::CLK_RECOVER_INT_STATUS>;
#[doc = "Register CLK_RECOVER_INT_STATUS `reset()`'s with value 0"]
impl crate::ResetValue for super::CLK_RECOVER_INT_STATUS {
    type Type = u8;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0
    }
}
#[doc = "Indicates that the USB clock recovery algorithm has detected that the frequency trim adjustment needed for the IRC48M output clock is outside the available TRIM_FINE adjustment range for the IRC48M module\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum OVF_ERROR_A {
    #[doc = "0: No interrupt is reported"]
    _0,
    #[doc = "1: Unmasked interrupt has been generated"]
    _1,
}
impl From<OVF_ERROR_A> for bool {
    #[inline(always)]
    fn from(variant: OVF_ERROR_A) -> Self {
        match variant {
            OVF_ERROR_A::_0 => false,
            OVF_ERROR_A::_1 => true,
        }
    }
}
#[doc = "Reader of field `OVF_ERROR`"]
pub type OVF_ERROR_R = crate::R<bool, OVF_ERROR_A>;
impl OVF_ERROR_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> OVF_ERROR_A {
        match self.bits {
            false => OVF_ERROR_A::_0,
            true => OVF_ERROR_A::_1,
        }
    }
    #[doc = "Checks if the value of the field is `_0`"]
    #[inline(always)]
    pub fn is_0(&self) -> bool {
        *self == OVF_ERROR_A::_0
    }
    #[doc = "Checks if the value of the field is `_1`"]
    #[inline(always)]
    pub fn is_1(&self) -> bool {
        *self == OVF_ERROR_A::_1
    }
}
#[doc = "Write proxy for field `OVF_ERROR`"]
pub struct OVF_ERROR_W<'a> {
    w: &'a mut W,
}
impl<'a> OVF_ERROR_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: OVF_ERROR_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "No interrupt is reported"]
    #[inline(always)]
    pub fn _0(self) -> &'a mut W {
        self.variant(OVF_ERROR_A::_0)
    }
    #[doc = "Unmasked interrupt has been generated"]
    #[inline(always)]
    pub fn _1(self) -> &'a mut W {
        self.variant(OVF_ERROR_A::_1)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 4)) | (((value as u8) & 0x01) << 4);
        self.w
    }
}
impl R {
    #[doc = "Bit 4 - Indicates that the USB clock recovery algorithm has detected that the frequency trim adjustment needed for the IRC48M output clock is outside the available TRIM_FINE adjustment range for the IRC48M module"]
    #[inline(always)]
    pub fn ovf_error(&self) -> OVF_ERROR_R {
        OVF_ERROR_R::new(((self.bits >> 4) & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bit 4 - Indicates that the USB clock recovery algorithm has detected that the frequency trim adjustment needed for the IRC48M output clock is outside the available TRIM_FINE adjustment range for the IRC48M module"]
    #[inline(always)]
    pub fn ovf_error(&mut self) -> OVF_ERROR_W {
        OVF_ERROR_W { w: self }
    }
}