nrf52832_pac/uart0/
pselrts.rs

1#[doc = "Register `PSELRTS` reader"]
2pub struct R(crate::R<PSELRTS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PSELRTS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PSELRTS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PSELRTS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `PSELRTS` writer"]
17pub struct W(crate::W<PSELRTS_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<PSELRTS_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<PSELRTS_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<PSELRTS_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `PSELRTS` reader - Pin number configuration for UART RTS signal"]
38pub type PSELRTS_R = crate::FieldReader<u32, PSELRTS_A>;
39#[doc = "Pin number configuration for UART RTS signal\n\nValue on reset: 4294967295"]
40#[derive(Clone, Copy, Debug, PartialEq)]
41#[repr(u32)]
42pub enum PSELRTS_A {
43    #[doc = "4294967295: Disconnect"]
44    DISCONNECTED = 4294967295,
45}
46impl From<PSELRTS_A> for u32 {
47    #[inline(always)]
48    fn from(variant: PSELRTS_A) -> Self {
49        variant as _
50    }
51}
52impl PSELRTS_R {
53    #[doc = "Get enumerated values variant"]
54    #[inline(always)]
55    pub fn variant(&self) -> Option<PSELRTS_A> {
56        match self.bits {
57            4294967295 => Some(PSELRTS_A::DISCONNECTED),
58            _ => None,
59        }
60    }
61    #[doc = "Checks if the value of the field is `DISCONNECTED`"]
62    #[inline(always)]
63    pub fn is_disconnected(&self) -> bool {
64        *self == PSELRTS_A::DISCONNECTED
65    }
66}
67#[doc = "Field `PSELRTS` writer - Pin number configuration for UART RTS signal"]
68pub type PSELRTS_W<'a, const O: u8> =
69    crate::FieldWriter<'a, u32, PSELRTS_SPEC, u32, PSELRTS_A, 32, O>;
70impl<'a, const O: u8> PSELRTS_W<'a, O> {
71    #[doc = "Disconnect"]
72    #[inline(always)]
73    pub fn disconnected(self) -> &'a mut W {
74        self.variant(PSELRTS_A::DISCONNECTED)
75    }
76}
77impl R {
78    #[doc = "Bits 0:31 - Pin number configuration for UART RTS signal"]
79    #[inline(always)]
80    pub fn pselrts(&self) -> PSELRTS_R {
81        PSELRTS_R::new(self.bits)
82    }
83}
84impl W {
85    #[doc = "Bits 0:31 - Pin number configuration for UART RTS signal"]
86    #[inline(always)]
87    pub fn pselrts(&mut self) -> PSELRTS_W<0> {
88        PSELRTS_W::new(self)
89    }
90    #[doc = "Writes raw bits to the register."]
91    #[inline(always)]
92    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
93        self.0.bits(bits);
94        self
95    }
96}
97#[doc = "Pin select for RTS\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 [pselrts](index.html) module"]
98pub struct PSELRTS_SPEC;
99impl crate::RegisterSpec for PSELRTS_SPEC {
100    type Ux = u32;
101}
102#[doc = "`read()` method returns [pselrts::R](R) reader structure"]
103impl crate::Readable for PSELRTS_SPEC {
104    type Reader = R;
105}
106#[doc = "`write(|w| ..)` method takes [pselrts::W](W) writer structure"]
107impl crate::Writable for PSELRTS_SPEC {
108    type Writer = W;
109}
110#[doc = "`reset()` method sets PSELRTS to value 0xffff_ffff"]
111impl crate::Resettable for PSELRTS_SPEC {
112    #[inline(always)]
113    fn reset_value() -> Self::Ux {
114        0xffff_ffff
115    }
116}