#[doc = "Register `CFG` reader"]
pub struct R(crate::R<CFG_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<CFG_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<CFG_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<CFG_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `CFG` writer"]
pub struct W(crate::W<CFG_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<CFG_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<CFG_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<CFG_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `SOURCE` reader - Source Enable Mode"]
pub type SOURCE_R = crate::FieldReader<u8, u8>;
#[doc = "Field `SOURCE` writer - Source Enable Mode"]
pub type SOURCE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFG_SPEC, u8, u8, 2, O>;
#[doc = "Field `ACTION` reader - Action to perform"]
pub type ACTION_R = crate::BitReader<bool>;
#[doc = "Field `ACTION` writer - Action to perform"]
pub type ACTION_W<'a, const O: u8> = crate::BitWriter<'a, u32, CFG_SPEC, bool, O>;
#[doc = "Field `MATCH` reader - Data Match"]
pub type MATCH_R = crate::FieldReader<u8, u8>;
#[doc = "Field `MATCH` writer - Data Match"]
pub type MATCH_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CFG_SPEC, u8, u8, 8, O>;
impl R {
#[doc = "Bits 0:1 - Source Enable Mode"]
#[inline(always)]
pub fn source(&self) -> SOURCE_R {
SOURCE_R::new((self.bits & 3) as u8)
}
#[doc = "Bit 2 - Action to perform"]
#[inline(always)]
pub fn action(&self) -> ACTION_R {
ACTION_R::new(((self.bits >> 2) & 1) != 0)
}
#[doc = "Bits 8:15 - Data Match"]
#[inline(always)]
pub fn match_(&self) -> MATCH_R {
MATCH_R::new(((self.bits >> 8) & 0xff) as u8)
}
}
impl W {
#[doc = "Bits 0:1 - Source Enable Mode"]
#[inline(always)]
#[must_use]
pub fn source(&mut self) -> SOURCE_W<0> {
SOURCE_W::new(self)
}
#[doc = "Bit 2 - Action to perform"]
#[inline(always)]
#[must_use]
pub fn action(&mut self) -> ACTION_W<2> {
ACTION_W::new(self)
}
#[doc = "Bits 8:15 - Data Match"]
#[inline(always)]
#[must_use]
pub fn match_(&mut self) -> MATCH_W<8> {
MATCH_W::new(self)
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Configuration Register\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)."]
pub struct CFG_SPEC;
impl crate::RegisterSpec for CFG_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [cfg::R](R) reader structure"]
impl crate::Readable for CFG_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cfg::W](W) writer structure"]
impl crate::Writable for CFG_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 CFG to value 0"]
impl crate::Resettable for CFG_SPEC {
const RESET_VALUE: Self::Ux = 0;
}