WCH_CH57x_PAC/src/eth/r8_eth_erxfcon.rs
Yilin Sun 4efd89758a
Initial commit.
Signed-off-by: Yilin Sun <imi415@imi.moe>
2023-01-27 20:39:58 +08:00

178 lines
6.6 KiB
Rust

#[doc = "Register `R8_ETH_ERXFCON` reader"]
pub struct R(crate::R<R8_ETH_ERXFCON_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<R8_ETH_ERXFCON_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<R8_ETH_ERXFCON_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<R8_ETH_ERXFCON_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `R8_ETH_ERXFCON` writer"]
pub struct W(crate::W<R8_ETH_ERXFCON_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<R8_ETH_ERXFCON_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<R8_ETH_ERXFCON_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<R8_ETH_ERXFCON_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `RB_ETH_ERXFCON_BCEN` reader - soso"]
pub type RB_ETH_ERXFCON_BCEN_R = crate::BitReader<bool>;
#[doc = "Field `RB_ETH_ERXFCON_BCEN` writer - soso"]
pub type RB_ETH_ERXFCON_BCEN_W<'a, const O: u8> =
crate::BitWriter<'a, u8, R8_ETH_ERXFCON_SPEC, bool, O>;
#[doc = "Field `RB_ETH_ERXFCON_MCEN` reader - soso"]
pub type RB_ETH_ERXFCON_MCEN_R = crate::BitReader<bool>;
#[doc = "Field `RB_ETH_ERXFCON_MCEN` writer - soso"]
pub type RB_ETH_ERXFCON_MCEN_W<'a, const O: u8> =
crate::BitWriter<'a, u8, R8_ETH_ERXFCON_SPEC, bool, O>;
#[doc = "Field `RB_ETH_ERXFCON_HTEN` reader - soso"]
pub type RB_ETH_ERXFCON_HTEN_R = crate::BitReader<bool>;
#[doc = "Field `RB_ETH_ERXFCON_HTEN` writer - soso"]
pub type RB_ETH_ERXFCON_HTEN_W<'a, const O: u8> =
crate::BitWriter<'a, u8, R8_ETH_ERXFCON_SPEC, bool, O>;
#[doc = "Field `RB_ETH_ERXFCON_MPEN` reader - soso"]
pub type RB_ETH_ERXFCON_MPEN_R = crate::BitReader<bool>;
#[doc = "Field `RB_ETH_ERXFCON_MPEN` writer - soso"]
pub type RB_ETH_ERXFCON_MPEN_W<'a, const O: u8> =
crate::BitWriter<'a, u8, R8_ETH_ERXFCON_SPEC, bool, O>;
#[doc = "Field `RB_ETH_ERXFCON_CRCEN` reader - soso"]
pub type RB_ETH_ERXFCON_CRCEN_R = crate::BitReader<bool>;
#[doc = "Field `RB_ETH_ERXFCON_CRCEN` writer - soso"]
pub type RB_ETH_ERXFCON_CRCEN_W<'a, const O: u8> =
crate::BitWriter<'a, u8, R8_ETH_ERXFCON_SPEC, bool, O>;
#[doc = "Field `RB_ETH_ERXFCON_ANDOR` reader - soso"]
pub type RB_ETH_ERXFCON_ANDOR_R = crate::BitReader<bool>;
#[doc = "Field `RB_ETH_ERXFCON_ANDOR` writer - soso"]
pub type RB_ETH_ERXFCON_ANDOR_W<'a, const O: u8> =
crate::BitWriter<'a, u8, R8_ETH_ERXFCON_SPEC, bool, O>;
#[doc = "Field `RB_ETH_ERXFCON_UCEN` reader - soso"]
pub type RB_ETH_ERXFCON_UCEN_R = crate::BitReader<bool>;
#[doc = "Field `RB_ETH_ERXFCON_UCEN` writer - soso"]
pub type RB_ETH_ERXFCON_UCEN_W<'a, const O: u8> =
crate::BitWriter<'a, u8, R8_ETH_ERXFCON_SPEC, bool, O>;
impl R {
#[doc = "Bit 0 - soso"]
#[inline(always)]
pub fn rb_eth_erxfcon_bcen(&self) -> RB_ETH_ERXFCON_BCEN_R {
RB_ETH_ERXFCON_BCEN_R::new((self.bits & 1) != 0)
}
#[doc = "Bit 1 - soso"]
#[inline(always)]
pub fn rb_eth_erxfcon_mcen(&self) -> RB_ETH_ERXFCON_MCEN_R {
RB_ETH_ERXFCON_MCEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[doc = "Bit 2 - soso"]
#[inline(always)]
pub fn rb_eth_erxfcon_hten(&self) -> RB_ETH_ERXFCON_HTEN_R {
RB_ETH_ERXFCON_HTEN_R::new(((self.bits >> 2) & 1) != 0)
}
#[doc = "Bit 3 - soso"]
#[inline(always)]
pub fn rb_eth_erxfcon_mpen(&self) -> RB_ETH_ERXFCON_MPEN_R {
RB_ETH_ERXFCON_MPEN_R::new(((self.bits >> 3) & 1) != 0)
}
#[doc = "Bit 5 - soso"]
#[inline(always)]
pub fn rb_eth_erxfcon_crcen(&self) -> RB_ETH_ERXFCON_CRCEN_R {
RB_ETH_ERXFCON_CRCEN_R::new(((self.bits >> 5) & 1) != 0)
}
#[doc = "Bit 6 - soso"]
#[inline(always)]
pub fn rb_eth_erxfcon_andor(&self) -> RB_ETH_ERXFCON_ANDOR_R {
RB_ETH_ERXFCON_ANDOR_R::new(((self.bits >> 6) & 1) != 0)
}
#[doc = "Bit 7 - soso"]
#[inline(always)]
pub fn rb_eth_erxfcon_ucen(&self) -> RB_ETH_ERXFCON_UCEN_R {
RB_ETH_ERXFCON_UCEN_R::new(((self.bits >> 7) & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - soso"]
#[inline(always)]
#[must_use]
pub fn rb_eth_erxfcon_bcen(&mut self) -> RB_ETH_ERXFCON_BCEN_W<0> {
RB_ETH_ERXFCON_BCEN_W::new(self)
}
#[doc = "Bit 1 - soso"]
#[inline(always)]
#[must_use]
pub fn rb_eth_erxfcon_mcen(&mut self) -> RB_ETH_ERXFCON_MCEN_W<1> {
RB_ETH_ERXFCON_MCEN_W::new(self)
}
#[doc = "Bit 2 - soso"]
#[inline(always)]
#[must_use]
pub fn rb_eth_erxfcon_hten(&mut self) -> RB_ETH_ERXFCON_HTEN_W<2> {
RB_ETH_ERXFCON_HTEN_W::new(self)
}
#[doc = "Bit 3 - soso"]
#[inline(always)]
#[must_use]
pub fn rb_eth_erxfcon_mpen(&mut self) -> RB_ETH_ERXFCON_MPEN_W<3> {
RB_ETH_ERXFCON_MPEN_W::new(self)
}
#[doc = "Bit 5 - soso"]
#[inline(always)]
#[must_use]
pub fn rb_eth_erxfcon_crcen(&mut self) -> RB_ETH_ERXFCON_CRCEN_W<5> {
RB_ETH_ERXFCON_CRCEN_W::new(self)
}
#[doc = "Bit 6 - soso"]
#[inline(always)]
#[must_use]
pub fn rb_eth_erxfcon_andor(&mut self) -> RB_ETH_ERXFCON_ANDOR_W<6> {
RB_ETH_ERXFCON_ANDOR_W::new(self)
}
#[doc = "Bit 7 - soso"]
#[inline(always)]
#[must_use]
pub fn rb_eth_erxfcon_ucen(&mut self) -> RB_ETH_ERXFCON_UCEN_W<7> {
RB_ETH_ERXFCON_UCEN_W::new(self)
}
#[doc = "Writes raw bits to the register."]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "soso\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 [r8_eth_erxfcon](index.html) module"]
pub struct R8_ETH_ERXFCON_SPEC;
impl crate::RegisterSpec for R8_ETH_ERXFCON_SPEC {
type Ux = u8;
}
#[doc = "`read()` method returns [r8_eth_erxfcon::R](R) reader structure"]
impl crate::Readable for R8_ETH_ERXFCON_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [r8_eth_erxfcon::W](W) writer structure"]
impl crate::Writable for R8_ETH_ERXFCON_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 R8_ETH_ERXFCON to value 0"]
impl crate::Resettable for R8_ETH_ERXFCON_SPEC {
const RESET_VALUE: Self::Ux = 0;
}