rp2040 0.1.0

Peripheral access API for rp2040 microcontrollers (generated using svd2rust)
Documentation
#[doc = "Reader of register INTE"]
pub type R = crate::R<u32, super::INTE>;
#[doc = "Writer for register INTE"]
pub type W = crate::W<u32, super::INTE>;
#[doc = "Register INTE `reset()`'s with value 0"]
impl crate::ResetValue for super::INTE {
    type Type = u32;
    #[inline(always)]
    fn reset_value() -> Self::Type {
        0
    }
}
#[doc = "Reader of field `ALARM_3`"]
pub type ALARM_3_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `ALARM_3`"]
pub struct ALARM_3_W<'a> {
    w: &'a mut W,
}
impl<'a> ALARM_3_W<'a> {
    #[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 << 3)) | (((value as u32) & 0x01) << 3);
        self.w
    }
}
#[doc = "Reader of field `ALARM_2`"]
pub type ALARM_2_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `ALARM_2`"]
pub struct ALARM_2_W<'a> {
    w: &'a mut W,
}
impl<'a> ALARM_2_W<'a> {
    #[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 << 2)) | (((value as u32) & 0x01) << 2);
        self.w
    }
}
#[doc = "Reader of field `ALARM_1`"]
pub type ALARM_1_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `ALARM_1`"]
pub struct ALARM_1_W<'a> {
    w: &'a mut W,
}
impl<'a> ALARM_1_W<'a> {
    #[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 << 1)) | (((value as u32) & 0x01) << 1);
        self.w
    }
}
#[doc = "Reader of field `ALARM_0`"]
pub type ALARM_0_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `ALARM_0`"]
pub struct ALARM_0_W<'a> {
    w: &'a mut W,
}
impl<'a> ALARM_0_W<'a> {
    #[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) | ((value as u32) & 0x01);
        self.w
    }
}
impl R {
    #[doc = "Bit 3"]
    #[inline(always)]
    pub fn alarm_3(&self) -> ALARM_3_R {
        ALARM_3_R::new(((self.bits >> 3) & 0x01) != 0)
    }
    #[doc = "Bit 2"]
    #[inline(always)]
    pub fn alarm_2(&self) -> ALARM_2_R {
        ALARM_2_R::new(((self.bits >> 2) & 0x01) != 0)
    }
    #[doc = "Bit 1"]
    #[inline(always)]
    pub fn alarm_1(&self) -> ALARM_1_R {
        ALARM_1_R::new(((self.bits >> 1) & 0x01) != 0)
    }
    #[doc = "Bit 0"]
    #[inline(always)]
    pub fn alarm_0(&self) -> ALARM_0_R {
        ALARM_0_R::new((self.bits & 0x01) != 0)
    }
}
impl W {
    #[doc = "Bit 3"]
    #[inline(always)]
    pub fn alarm_3(&mut self) -> ALARM_3_W {
        ALARM_3_W { w: self }
    }
    #[doc = "Bit 2"]
    #[inline(always)]
    pub fn alarm_2(&mut self) -> ALARM_2_W {
        ALARM_2_W { w: self }
    }
    #[doc = "Bit 1"]
    #[inline(always)]
    pub fn alarm_1(&mut self) -> ALARM_1_W {
        ALARM_1_W { w: self }
    }
    #[doc = "Bit 0"]
    #[inline(always)]
    pub fn alarm_0(&mut self) -> ALARM_0_W {
        ALARM_0_W { w: self }
    }
}