v853_pac/uart/
fcr.rs

1#[doc = "Register `fcr` writer"]
2pub struct W(crate::W<FCR_SPEC>);
3impl core::ops::Deref for W {
4    type Target = crate::W<FCR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl core::ops::DerefMut for W {
11    #[inline(always)]
12    fn deref_mut(&mut self) -> &mut Self::Target {
13        &mut self.0
14    }
15}
16impl From<crate::W<FCR_SPEC>> for W {
17    #[inline(always)]
18    fn from(writer: crate::W<FCR_SPEC>) -> Self {
19        W(writer)
20    }
21}
22#[doc = "\n\nValue on reset: 0"]
23#[derive(Clone, Copy, Debug, PartialEq)]
24#[repr(u8)]
25pub enum RT_AW {
26    #[doc = "0: `0`"]
27    ONE_CHARACTER = 0,
28    #[doc = "1: `1`"]
29    QUARTER_FULL = 1,
30    #[doc = "2: `10`"]
31    HALF_FULL = 2,
32    #[doc = "3: `11`"]
33    TWO_LESS_THAN_FULL = 3,
34}
35impl From<RT_AW> for u8 {
36    #[inline(always)]
37    fn from(variant: RT_AW) -> Self {
38        variant as _
39    }
40}
41#[doc = "Field `rt` writer - "]
42pub type RT_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, FCR_SPEC, u8, RT_AW, 2, O>;
43impl<'a, const O: u8> RT_W<'a, O> {
44    #[doc = "`0`"]
45    #[inline(always)]
46    pub fn one_character(self) -> &'a mut W {
47        self.variant(RT_AW::ONE_CHARACTER)
48    }
49    #[doc = "`1`"]
50    #[inline(always)]
51    pub fn quarter_full(self) -> &'a mut W {
52        self.variant(RT_AW::QUARTER_FULL)
53    }
54    #[doc = "`10`"]
55    #[inline(always)]
56    pub fn half_full(self) -> &'a mut W {
57        self.variant(RT_AW::HALF_FULL)
58    }
59    #[doc = "`11`"]
60    #[inline(always)]
61    pub fn two_less_than_full(self) -> &'a mut W {
62        self.variant(RT_AW::TWO_LESS_THAN_FULL)
63    }
64}
65#[doc = "\n\nValue on reset: 0"]
66#[derive(Clone, Copy, Debug, PartialEq)]
67#[repr(u8)]
68pub enum TFT_AW {
69    #[doc = "0: `0`"]
70    EMPTY = 0,
71    #[doc = "1: `1`"]
72    TWO_CHARACTERS = 1,
73    #[doc = "2: `10`"]
74    QUARTER_FULL = 2,
75    #[doc = "3: `11`"]
76    HALF_FULL = 3,
77}
78impl From<TFT_AW> for u8 {
79    #[inline(always)]
80    fn from(variant: TFT_AW) -> Self {
81        variant as _
82    }
83}
84#[doc = "Field `tft` writer - "]
85pub type TFT_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, FCR_SPEC, u8, TFT_AW, 2, O>;
86impl<'a, const O: u8> TFT_W<'a, O> {
87    #[doc = "`0`"]
88    #[inline(always)]
89    pub fn empty(self) -> &'a mut W {
90        self.variant(TFT_AW::EMPTY)
91    }
92    #[doc = "`1`"]
93    #[inline(always)]
94    pub fn two_characters(self) -> &'a mut W {
95        self.variant(TFT_AW::TWO_CHARACTERS)
96    }
97    #[doc = "`10`"]
98    #[inline(always)]
99    pub fn quarter_full(self) -> &'a mut W {
100        self.variant(TFT_AW::QUARTER_FULL)
101    }
102    #[doc = "`11`"]
103    #[inline(always)]
104    pub fn half_full(self) -> &'a mut W {
105        self.variant(TFT_AW::HALF_FULL)
106    }
107}
108#[doc = "\n\nValue on reset: 0"]
109#[derive(Clone, Copy, Debug, PartialEq)]
110pub enum DMAM_AW {
111    #[doc = "0: `0`"]
112    MODE_0 = 0,
113    #[doc = "1: `1`"]
114    MODE_1 = 1,
115}
116impl From<DMAM_AW> for bool {
117    #[inline(always)]
118    fn from(variant: DMAM_AW) -> Self {
119        variant as u8 != 0
120    }
121}
122#[doc = "Field `dmam` writer - "]
123pub type DMAM_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCR_SPEC, DMAM_AW, O>;
124impl<'a, const O: u8> DMAM_W<'a, O> {
125    #[doc = "`0`"]
126    #[inline(always)]
127    pub fn mode_0(self) -> &'a mut W {
128        self.variant(DMAM_AW::MODE_0)
129    }
130    #[doc = "`1`"]
131    #[inline(always)]
132    pub fn mode_1(self) -> &'a mut W {
133        self.variant(DMAM_AW::MODE_1)
134    }
135}
136#[doc = "Field `xfifor` writer - "]
137pub type XFIFOR_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCR_SPEC, bool, O>;
138#[doc = "Field `rfifor` writer - "]
139pub type RFIFOR_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCR_SPEC, bool, O>;
140#[doc = "Field `fifoe` writer - "]
141pub type FIFOE_W<'a, const O: u8> = crate::BitWriter<'a, u32, FCR_SPEC, bool, O>;
142impl W {
143    #[doc = "Bits 6:7"]
144    #[inline(always)]
145    pub fn rt(&mut self) -> RT_W<6> {
146        RT_W::new(self)
147    }
148    #[doc = "Bits 4:5"]
149    #[inline(always)]
150    pub fn tft(&mut self) -> TFT_W<4> {
151        TFT_W::new(self)
152    }
153    #[doc = "Bit 3"]
154    #[inline(always)]
155    pub fn dmam(&mut self) -> DMAM_W<3> {
156        DMAM_W::new(self)
157    }
158    #[doc = "Bit 2"]
159    #[inline(always)]
160    pub fn xfifor(&mut self) -> XFIFOR_W<2> {
161        XFIFOR_W::new(self)
162    }
163    #[doc = "Bit 1"]
164    #[inline(always)]
165    pub fn rfifor(&mut self) -> RFIFOR_W<1> {
166        RFIFOR_W::new(self)
167    }
168    #[doc = "Bit 0"]
169    #[inline(always)]
170    pub fn fifoe(&mut self) -> FIFOE_W<0> {
171        FIFOE_W::new(self)
172    }
173    #[doc = "Writes raw bits to the register."]
174    #[inline(always)]
175    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
176        self.0.bits(bits);
177        self
178    }
179}
180#[doc = "UART FIFO Control Register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fcr](index.html) module"]
181pub struct FCR_SPEC;
182impl crate::RegisterSpec for FCR_SPEC {
183    type Ux = u32;
184}
185#[doc = "`write(|w| ..)` method takes [fcr::W](W) writer structure"]
186impl crate::Writable for FCR_SPEC {
187    type Writer = W;
188}
189#[doc = "`reset()` method sets fcr to value 0"]
190impl crate::Resettable for FCR_SPEC {
191    #[inline(always)]
192    fn reset_value() -> Self::Ux {
193        0
194    }
195}