ra2a1 0.2.0

Peripheral access API for ra2a1 microcontrollers (generated using svd2rust)
Documentation
#[doc = "Register `ELSR%s` reader"]
pub struct R(crate::R<ELSR_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<ELSR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<ELSR_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<ELSR_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `ELSR%s` writer"]
pub struct W(crate::W<ELSR_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<ELSR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<ELSR_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<ELSR_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `ELS` reader - Event Link Select"]
pub type ELS_R = crate::FieldReader<u8, ELS_A>;
#[doc = "Event Link Select\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ELS_A {
    #[doc = "0: Event output to the corresponding peripheral module is disabled."]
    _0X000 = 0,
}
impl From<ELS_A> for u8 {
    #[inline(always)]
    fn from(variant: ELS_A) -> Self {
        variant as _
    }
}
impl ELS_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<ELS_A> {
        match self.bits {
            0 => Some(ELS_A::_0X000),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `_0X000`"]
    #[inline(always)]
    pub fn is_0x000(&self) -> bool {
        *self == ELS_A::_0X000
    }
}
#[doc = "Field `ELS` writer - Event Link Select"]
pub type ELS_W<'a, const O: u8> = crate::FieldWriter<'a, u16, ELSR_SPEC, u8, ELS_A, 8, O>;
impl<'a, const O: u8> ELS_W<'a, O> {
    #[doc = "Event output to the corresponding peripheral module is disabled."]
    #[inline(always)]
    pub fn _0x000(self) -> &'a mut W {
        self.variant(ELS_A::_0X000)
    }
}
impl R {
    #[doc = "Bits 0:7 - Event Link Select"]
    #[inline(always)]
    pub fn els(&self) -> ELS_R {
        ELS_R::new((self.bits & 0xff) as u8)
    }
}
impl W {
    #[doc = "Bits 0:7 - Event Link Select"]
    #[inline(always)]
    #[must_use]
    pub fn els(&mut self) -> ELS_W<0> {
        ELS_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Event Link Setting Register %s\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [elsr](index.html) module"]
pub struct ELSR_SPEC;
impl crate::RegisterSpec for ELSR_SPEC {
    type Ux = u16;
}
#[doc = "`read()` method returns [elsr::R](R) reader structure"]
impl crate::Readable for ELSR_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [elsr::W](W) writer structure"]
impl crate::Writable for ELSR_SPEC {
    type Writer = W;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets ELSR%s to value 0"]
impl crate::Resettable for ELSR_SPEC {
    const RESET_VALUE: Self::Ux = 0;
}