#[doc = "Register `CR2` reader"]
pub struct R(crate::R<CR2_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<CR2_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<CR2_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<CR2_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `CR2` writer"]
pub struct W(crate::W<CR2_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<CR2_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<CR2_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<CR2_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `RXDMAEN` reader - desc RXDMAEN"]
pub type RXDMAEN_R = crate::BitReader<bool>;
#[doc = "Field `RXDMAEN` writer - desc RXDMAEN"]
pub type RXDMAEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR2_SPEC, bool, O>;
#[doc = "Field `TXDMAEN` reader - desc TXDMAEN"]
pub type TXDMAEN_R = crate::BitReader<bool>;
#[doc = "Field `TXDMAEN` writer - desc TXDMAEN"]
pub type TXDMAEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR2_SPEC, bool, O>;
#[doc = "Field `SSOE` reader - desc SSOE"]
pub type SSOE_R = crate::BitReader<bool>;
#[doc = "Field `SSOE` writer - desc SSOE"]
pub type SSOE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR2_SPEC, bool, O>;
#[doc = "Field `CLRTXFIFO` reader - desc CLRTXFIFO"]
pub type CLRTXFIFO_R = crate::BitReader<bool>;
#[doc = "Field `CLRTXFIFO` writer - desc CLRTXFIFO"]
pub type CLRTXFIFO_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR2_SPEC, bool, O>;
#[doc = "Field `ERRIE` reader - desc ERRIE"]
pub type ERRIE_R = crate::BitReader<bool>;
#[doc = "Field `ERRIE` writer - desc ERRIE"]
pub type ERRIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR2_SPEC, bool, O>;
#[doc = "Field `RXNEIE` reader - desc RXNEIE"]
pub type RXNEIE_R = crate::BitReader<bool>;
#[doc = "Field `RXNEIE` writer - desc RXNEIE"]
pub type RXNEIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR2_SPEC, bool, O>;
#[doc = "Field `TXEIE` reader - desc TXEIE"]
pub type TXEIE_R = crate::BitReader<bool>;
#[doc = "Field `TXEIE` writer - desc TXEIE"]
pub type TXEIE_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR2_SPEC, bool, O>;
#[doc = "Field `FRXTH` reader - desc FRXTH"]
pub type FRXTH_R = crate::BitReader<bool>;
#[doc = "Field `FRXTH` writer - desc FRXTH"]
pub type FRXTH_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR2_SPEC, bool, O>;
#[doc = "Field `LDMA_RX` reader - desc LDMA_RX"]
pub type LDMA_RX_R = crate::BitReader<bool>;
#[doc = "Field `LDMA_RX` writer - desc LDMA_RX"]
pub type LDMA_RX_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR2_SPEC, bool, O>;
#[doc = "Field `LDMA_TX` reader - desc LDMA_TX"]
pub type LDMA_TX_R = crate::BitReader<bool>;
#[doc = "Field `LDMA_TX` writer - desc LDMA_TX"]
pub type LDMA_TX_W<'a, const O: u8> = crate::BitWriter<'a, u32, CR2_SPEC, bool, O>;
impl R {
#[doc = "Bit 0 - desc RXDMAEN"]
#[inline(always)]
pub fn rxdmaen(&self) -> RXDMAEN_R {
RXDMAEN_R::new((self.bits & 1) != 0)
}
#[doc = "Bit 1 - desc TXDMAEN"]
#[inline(always)]
pub fn txdmaen(&self) -> TXDMAEN_R {
TXDMAEN_R::new(((self.bits >> 1) & 1) != 0)
}
#[doc = "Bit 2 - desc SSOE"]
#[inline(always)]
pub fn ssoe(&self) -> SSOE_R {
SSOE_R::new(((self.bits >> 2) & 1) != 0)
}
#[doc = "Bit 4 - desc CLRTXFIFO"]
#[inline(always)]
pub fn clrtxfifo(&self) -> CLRTXFIFO_R {
CLRTXFIFO_R::new(((self.bits >> 4) & 1) != 0)
}
#[doc = "Bit 5 - desc ERRIE"]
#[inline(always)]
pub fn errie(&self) -> ERRIE_R {
ERRIE_R::new(((self.bits >> 5) & 1) != 0)
}
#[doc = "Bit 6 - desc RXNEIE"]
#[inline(always)]
pub fn rxneie(&self) -> RXNEIE_R {
RXNEIE_R::new(((self.bits >> 6) & 1) != 0)
}
#[doc = "Bit 7 - desc TXEIE"]
#[inline(always)]
pub fn txeie(&self) -> TXEIE_R {
TXEIE_R::new(((self.bits >> 7) & 1) != 0)
}
#[doc = "Bit 12 - desc FRXTH"]
#[inline(always)]
pub fn frxth(&self) -> FRXTH_R {
FRXTH_R::new(((self.bits >> 12) & 1) != 0)
}
#[doc = "Bit 13 - desc LDMA_RX"]
#[inline(always)]
pub fn ldma_rx(&self) -> LDMA_RX_R {
LDMA_RX_R::new(((self.bits >> 13) & 1) != 0)
}
#[doc = "Bit 14 - desc LDMA_TX"]
#[inline(always)]
pub fn ldma_tx(&self) -> LDMA_TX_R {
LDMA_TX_R::new(((self.bits >> 14) & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - desc RXDMAEN"]
#[inline(always)]
pub fn rxdmaen(&mut self) -> RXDMAEN_W<0> {
RXDMAEN_W::new(self)
}
#[doc = "Bit 1 - desc TXDMAEN"]
#[inline(always)]
pub fn txdmaen(&mut self) -> TXDMAEN_W<1> {
TXDMAEN_W::new(self)
}
#[doc = "Bit 2 - desc SSOE"]
#[inline(always)]
pub fn ssoe(&mut self) -> SSOE_W<2> {
SSOE_W::new(self)
}
#[doc = "Bit 4 - desc CLRTXFIFO"]
#[inline(always)]
pub fn clrtxfifo(&mut self) -> CLRTXFIFO_W<4> {
CLRTXFIFO_W::new(self)
}
#[doc = "Bit 5 - desc ERRIE"]
#[inline(always)]
pub fn errie(&mut self) -> ERRIE_W<5> {
ERRIE_W::new(self)
}
#[doc = "Bit 6 - desc RXNEIE"]
#[inline(always)]
pub fn rxneie(&mut self) -> RXNEIE_W<6> {
RXNEIE_W::new(self)
}
#[doc = "Bit 7 - desc TXEIE"]
#[inline(always)]
pub fn txeie(&mut self) -> TXEIE_W<7> {
TXEIE_W::new(self)
}
#[doc = "Bit 12 - desc FRXTH"]
#[inline(always)]
pub fn frxth(&mut self) -> FRXTH_W<12> {
FRXTH_W::new(self)
}
#[doc = "Bit 13 - desc LDMA_RX"]
#[inline(always)]
pub fn ldma_rx(&mut self) -> LDMA_RX_W<13> {
LDMA_RX_W::new(self)
}
#[doc = "Bit 14 - desc LDMA_TX"]
#[inline(always)]
pub fn ldma_tx(&mut self) -> LDMA_TX_W<14> {
LDMA_TX_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 = "desc CR2\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 [cr2](index.html) module"]
pub struct CR2_SPEC;
impl crate::RegisterSpec for CR2_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [cr2::R](R) reader structure"]
impl crate::Readable for CR2_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [cr2::W](W) writer structure"]
impl crate::Writable for CR2_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets CR2 to value 0"]
impl crate::Resettable for CR2_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}