bl616_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    #[must_use]
62    pub fn transmit_transfer(&mut self) -> TRANSMIT_TRANSFER_W<0> {
63        TRANSMIT_TRANSFER_W::new(self)
64    }
65    #[doc = "Bit 1 - Write 1 to clear receive transfer finish signal"]
66    #[inline(always)]
67    #[must_use]
68    pub fn receive_transfer(&mut self) -> RECEIVE_TRANSFER_W<1> {
69        RECEIVE_TRANSFER_W::new(self)
70    }
71    #[doc = "Bit 4 - Write 1 to clear receive timed-out"]
72    #[inline(always)]
73    #[must_use]
74    pub fn receive_timeout(&mut self) -> RECEIVE_TIMEOUT_W<4> {
75        RECEIVE_TIMEOUT_W::new(self)
76    }
77    #[doc = "Bit 5 - Write 1 to clear receive parity check failure"]
78    #[inline(always)]
79    #[must_use]
80    pub fn receive_parity(&mut self) -> RECEIVE_PARITY_W<5> {
81        RECEIVE_PARITY_W::new(self)
82    }
83    #[doc = "Bit 8 - Write 1 to clear receive LIN mode synchronization field error"]
84    #[inline(always)]
85    #[must_use]
86    pub fn receive_sync_error(&mut self) -> RECEIVE_SYNC_ERROR_W<8> {
87        RECEIVE_SYNC_ERROR_W::new(self)
88    }
89    #[doc = "Bit 9 - Write 1 to clear receive byte count reached"]
90    #[inline(always)]
91    #[must_use]
92    pub fn receive_byte_count(&mut self) -> RECEIVE_BYTE_COUNT_W<9> {
93        RECEIVE_BYTE_COUNT_W::new(self)
94    }
95    #[doc = "Bit 10 - Write 1 to clear receive auto baudrate detection finished using start bit"]
96    #[inline(always)]
97    #[must_use]
98    pub fn auto_baudrate_start_bit(&mut self) -> AUTO_BAUDRATE_START_BIT_W<10> {
99        AUTO_BAUDRATE_START_BIT_W::new(self)
100    }
101    #[doc = "Bit 11 - Write 1 to clear receive auto baudrate detection finished using 0x55"]
102    #[inline(always)]
103    #[must_use]
104    pub fn auto_baudrate_five_five(&mut self) -> AUTO_BAUDRATE_FIVE_FIVE_W<11> {
105        AUTO_BAUDRATE_FIVE_FIVE_W::new(self)
106    }
107    #[doc = "Writes raw bits to the register."]
108    #[inline(always)]
109    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
110        self.0.bits(bits);
111        self
112    }
113}
114#[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"]
115pub struct INTERRUPT_CLEAR_SPEC;
116impl crate::RegisterSpec for INTERRUPT_CLEAR_SPEC {
117    type Ux = u32;
118}
119#[doc = "`write(|w| ..)` method takes [interrupt_clear::W](W) writer structure"]
120impl crate::Writable for INTERRUPT_CLEAR_SPEC {
121    type Writer = W;
122    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
123    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
124}
125#[doc = "`reset()` method sets interrupt_clear to value 0"]
126impl crate::Resettable for INTERRUPT_CLEAR_SPEC {
127    const RESET_VALUE: Self::Ux = 0;
128}