bl702_pac/uart/
uart_sw_mode.rs

1#[doc = "Register `uart_sw_mode` reader"]
2pub struct R(crate::R<UART_SW_MODE_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<UART_SW_MODE_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<UART_SW_MODE_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<UART_SW_MODE_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `uart_sw_mode` writer"]
17pub struct W(crate::W<UART_SW_MODE_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<UART_SW_MODE_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<UART_SW_MODE_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<UART_SW_MODE_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `cr_utx_txd_sw_mode` reader - "]
38pub type CR_UTX_TXD_SW_MODE_R = crate::BitReader<bool>;
39#[doc = "Field `cr_utx_txd_sw_mode` writer - "]
40pub type CR_UTX_TXD_SW_MODE_W<'a, const O: u8> =
41    crate::BitWriter<'a, u32, UART_SW_MODE_SPEC, bool, O>;
42#[doc = "Field `cr_utx_txd_sw_val` reader - "]
43pub type CR_UTX_TXD_SW_VAL_R = crate::BitReader<bool>;
44#[doc = "Field `cr_utx_txd_sw_val` writer - "]
45pub type CR_UTX_TXD_SW_VAL_W<'a, const O: u8> =
46    crate::BitWriter<'a, u32, UART_SW_MODE_SPEC, bool, O>;
47#[doc = "Field `cr_urx_rts_sw_mode` reader - "]
48pub type CR_URX_RTS_SW_MODE_R = crate::BitReader<bool>;
49#[doc = "Field `cr_urx_rts_sw_mode` writer - "]
50pub type CR_URX_RTS_SW_MODE_W<'a, const O: u8> =
51    crate::BitWriter<'a, u32, UART_SW_MODE_SPEC, bool, O>;
52#[doc = "Field `cr_urx_rts_sw_val` reader - "]
53pub type CR_URX_RTS_SW_VAL_R = crate::BitReader<bool>;
54#[doc = "Field `cr_urx_rts_sw_val` writer - "]
55pub type CR_URX_RTS_SW_VAL_W<'a, const O: u8> =
56    crate::BitWriter<'a, u32, UART_SW_MODE_SPEC, bool, O>;
57impl R {
58    #[doc = "Bit 0"]
59    #[inline(always)]
60    pub fn cr_utx_txd_sw_mode(&self) -> CR_UTX_TXD_SW_MODE_R {
61        CR_UTX_TXD_SW_MODE_R::new((self.bits & 1) != 0)
62    }
63    #[doc = "Bit 1"]
64    #[inline(always)]
65    pub fn cr_utx_txd_sw_val(&self) -> CR_UTX_TXD_SW_VAL_R {
66        CR_UTX_TXD_SW_VAL_R::new(((self.bits >> 1) & 1) != 0)
67    }
68    #[doc = "Bit 2"]
69    #[inline(always)]
70    pub fn cr_urx_rts_sw_mode(&self) -> CR_URX_RTS_SW_MODE_R {
71        CR_URX_RTS_SW_MODE_R::new(((self.bits >> 2) & 1) != 0)
72    }
73    #[doc = "Bit 3"]
74    #[inline(always)]
75    pub fn cr_urx_rts_sw_val(&self) -> CR_URX_RTS_SW_VAL_R {
76        CR_URX_RTS_SW_VAL_R::new(((self.bits >> 3) & 1) != 0)
77    }
78}
79impl W {
80    #[doc = "Bit 0"]
81    #[inline(always)]
82    #[must_use]
83    pub fn cr_utx_txd_sw_mode(&mut self) -> CR_UTX_TXD_SW_MODE_W<0> {
84        CR_UTX_TXD_SW_MODE_W::new(self)
85    }
86    #[doc = "Bit 1"]
87    #[inline(always)]
88    #[must_use]
89    pub fn cr_utx_txd_sw_val(&mut self) -> CR_UTX_TXD_SW_VAL_W<1> {
90        CR_UTX_TXD_SW_VAL_W::new(self)
91    }
92    #[doc = "Bit 2"]
93    #[inline(always)]
94    #[must_use]
95    pub fn cr_urx_rts_sw_mode(&mut self) -> CR_URX_RTS_SW_MODE_W<2> {
96        CR_URX_RTS_SW_MODE_W::new(self)
97    }
98    #[doc = "Bit 3"]
99    #[inline(always)]
100    #[must_use]
101    pub fn cr_urx_rts_sw_val(&mut self) -> CR_URX_RTS_SW_VAL_W<3> {
102        CR_URX_RTS_SW_VAL_W::new(self)
103    }
104    #[doc = "Writes raw bits to the register."]
105    #[inline(always)]
106    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
107        self.0.bits(bits);
108        self
109    }
110}
111#[doc = "uart_sw_mode.\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 [uart_sw_mode](index.html) module"]
112pub struct UART_SW_MODE_SPEC;
113impl crate::RegisterSpec for UART_SW_MODE_SPEC {
114    type Ux = u32;
115}
116#[doc = "`read()` method returns [uart_sw_mode::R](R) reader structure"]
117impl crate::Readable for UART_SW_MODE_SPEC {
118    type Reader = R;
119}
120#[doc = "`write(|w| ..)` method takes [uart_sw_mode::W](W) writer structure"]
121impl crate::Writable for UART_SW_MODE_SPEC {
122    type Writer = W;
123    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
124    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
125}
126#[doc = "`reset()` method sets uart_sw_mode to value 0"]
127impl crate::Resettable for UART_SW_MODE_SPEC {
128    const RESET_VALUE: Self::Ux = 0;
129}