bl808_pac/uart/
interrupt_clear.rs

1#[doc = "Register `interrupt_clear` writer"]
2pub struct W(crate::W<INTERRUPT_CLEAR_SPEC>);
3impl core::ops::Deref for W {
4    type Target = crate::W<INTERRUPT_CLEAR_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<INTERRUPT_CLEAR_SPEC>> for W {
17    #[inline(always)]
18    fn from(writer: crate::W<INTERRUPT_CLEAR_SPEC>) -> Self {
19        W(writer)
20    }
21}
22#[doc = "Field `transmit_transfer` writer - Write 1 to clear transmit transfer finish signal"]
23pub use AUTO_BAUDRATE_FIVE_FIVE_W as TRANSMIT_TRANSFER_W;
24#[doc = "Field `receive_transfer` writer - Write 1 to clear receive transfer finish signal"]
25pub use AUTO_BAUDRATE_FIVE_FIVE_W as RECEIVE_TRANSFER_W;
26#[doc = "Field `receive_timeout` writer - Write 1 to clear receive timed-out"]
27pub use AUTO_BAUDRATE_FIVE_FIVE_W as RECEIVE_TIMEOUT_W;
28#[doc = "Field `receive_parity` writer - Write 1 to clear receive parity check failure"]
29pub use AUTO_BAUDRATE_FIVE_FIVE_W as RECEIVE_PARITY_W;
30#[doc = "Field `receive_sync_error` writer - Write 1 to clear receive LIN mode synchronization field error"]
31pub use AUTO_BAUDRATE_FIVE_FIVE_W as RECEIVE_SYNC_ERROR_W;
32#[doc = "Field `receive_byte_count` writer - Write 1 to clear receive byte count reached"]
33pub use AUTO_BAUDRATE_FIVE_FIVE_W as RECEIVE_BYTE_COUNT_W;
34#[doc = "Field `auto_baudrate_start_bit` writer - Write 1 to clear receive auto baudrate detection finished using start bit"]
35pub use AUTO_BAUDRATE_FIVE_FIVE_W as AUTO_BAUDRATE_START_BIT_W;
36#[doc = "Write 1 to clear receive auto baudrate detection finished using 0x55\n\nValue on reset: 0"]
37#[derive(Clone, Copy, Debug, PartialEq, Eq)]
38pub enum INTERRUPT_CLEAR_AW {
39    #[doc = "1: Write 1 to clear interrupt state"]
40    CLEAR = 1,
41}
42impl From<INTERRUPT_CLEAR_AW> for bool {
43    #[inline(always)]
44    fn from(variant: INTERRUPT_CLEAR_AW) -> Self {
45        variant as u8 != 0
46    }
47}
48#[doc = "Field `auto_baudrate_five_five` writer - Write 1 to clear receive auto baudrate detection finished using 0x55"]
49pub type AUTO_BAUDRATE_FIVE_FIVE_W<'a, const O: u8> =
50    crate::BitWriter<'a, u32, INTERRUPT_CLEAR_SPEC, INTERRUPT_CLEAR_AW, O>;
51impl<'a, const O: u8> AUTO_BAUDRATE_FIVE_FIVE_W<'a, O> {
52    #[doc = "Write 1 to clear interrupt state"]
53    #[inline(always)]
54    pub fn clear(self) -> &'a mut W {
55        self.variant(INTERRUPT_CLEAR_AW::CLEAR)
56    }
57}
58impl W {
59    #[doc = "Bit 0 - Write 1 to clear transmit transfer finish signal"]
60    #[inline(always)]
61    pub fn transmit_transfer(&mut self) -> TRANSMIT_TRANSFER_W<0> {
62        TRANSMIT_TRANSFER_W::new(self)
63    }
64    #[doc = "Bit 1 - Write 1 to clear receive transfer finish signal"]
65    #[inline(always)]
66    pub fn receive_transfer(&mut self) -> RECEIVE_TRANSFER_W<1> {
67        RECEIVE_TRANSFER_W::new(self)
68    }
69    #[doc = "Bit 4 - Write 1 to clear receive timed-out"]
70    #[inline(always)]
71    pub fn receive_timeout(&mut self) -> RECEIVE_TIMEOUT_W<4> {
72        RECEIVE_TIMEOUT_W::new(self)
73    }
74    #[doc = "Bit 5 - Write 1 to clear receive parity check failure"]
75    #[inline(always)]
76    pub fn receive_parity(&mut self) -> RECEIVE_PARITY_W<5> {
77        RECEIVE_PARITY_W::new(self)
78    }
79    #[doc = "Bit 8 - Write 1 to clear receive LIN mode synchronization field error"]
80    #[inline(always)]
81    pub fn receive_sync_error(&mut self) -> RECEIVE_SYNC_ERROR_W<8> {
82        RECEIVE_SYNC_ERROR_W::new(self)
83    }
84    #[doc = "Bit 9 - Write 1 to clear receive byte count reached"]
85    #[inline(always)]
86    pub fn receive_byte_count(&mut self) -> RECEIVE_BYTE_COUNT_W<9> {
87        RECEIVE_BYTE_COUNT_W::new(self)
88    }
89    #[doc = "Bit 10 - Write 1 to clear receive auto baudrate detection finished using start bit"]
90    #[inline(always)]
91    pub fn auto_baudrate_start_bit(&mut self) -> AUTO_BAUDRATE_START_BIT_W<10> {
92        AUTO_BAUDRATE_START_BIT_W::new(self)
93    }
94    #[doc = "Bit 11 - Write 1 to clear receive auto baudrate detection finished using 0x55"]
95    #[inline(always)]
96    pub fn auto_baudrate_five_five(&mut self) -> AUTO_BAUDRATE_FIVE_FIVE_W<11> {
97        AUTO_BAUDRATE_FIVE_FIVE_W::new(self)
98    }
99    #[doc = "Writes raw bits to the register."]
100    #[inline(always)]
101    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
102        self.0.bits(bits);
103        self
104    }
105}
106#[doc = "Clear interrupt 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 [interrupt_clear](index.html) module"]
107pub struct INTERRUPT_CLEAR_SPEC;
108impl crate::RegisterSpec for INTERRUPT_CLEAR_SPEC {
109    type Ux = u32;
110}
111#[doc = "`write(|w| ..)` method takes [interrupt_clear::W](W) writer structure"]
112impl crate::Writable for INTERRUPT_CLEAR_SPEC {
113    type Writer = W;
114}
115#[doc = "`reset()` method sets interrupt_clear to value 0"]
116impl crate::Resettable for INTERRUPT_CLEAR_SPEC {
117    #[inline(always)]
118    fn reset_value() -> Self::Ux {
119        0
120    }
121}