Skip to main content

ADuCM302x/tmr0/
clrint.rs

1#[doc = "Writer for register CLRINT"]
2pub type W = crate::W<u16, super::CLRINT>;
3#[doc = "Register CLRINT `reset()`'s with value 0"]
4impl crate::ResetValue for super::CLRINT {
5    type Type = u16;
6    #[inline(always)]
7    fn reset_value() -> Self::Type {
8        0
9    }
10}
11#[doc = "Write proxy for field `TIMEOUT`"]
12pub struct TIMEOUT_W<'a> {
13    w: &'a mut W,
14}
15impl<'a> TIMEOUT_W<'a> {
16    #[doc = r"Sets the field bit"]
17    #[inline(always)]
18    pub fn set_bit(self) -> &'a mut W {
19        self.bit(true)
20    }
21    #[doc = r"Clears the field bit"]
22    #[inline(always)]
23    pub fn clear_bit(self) -> &'a mut W {
24        self.bit(false)
25    }
26    #[doc = r"Writes raw bits to the field"]
27    #[inline(always)]
28    pub fn bit(self, value: bool) -> &'a mut W {
29        self.w.bits = (self.w.bits & !0x01) | ((value as u16) & 0x01);
30        self.w
31    }
32}
33#[doc = "Write proxy for field `EVTCAPT`"]
34pub struct EVTCAPT_W<'a> {
35    w: &'a mut W,
36}
37impl<'a> EVTCAPT_W<'a> {
38    #[doc = r"Sets the field bit"]
39    #[inline(always)]
40    pub fn set_bit(self) -> &'a mut W {
41        self.bit(true)
42    }
43    #[doc = r"Clears the field bit"]
44    #[inline(always)]
45    pub fn clear_bit(self) -> &'a mut W {
46        self.bit(false)
47    }
48    #[doc = r"Writes raw bits to the field"]
49    #[inline(always)]
50    pub fn bit(self, value: bool) -> &'a mut W {
51        self.w.bits = (self.w.bits & !(0x01 << 1)) | (((value as u16) & 0x01) << 1);
52        self.w
53    }
54}
55impl W {
56    #[doc = "Bit 0 - Clear Timeout Interrupt"]
57    #[inline(always)]
58    pub fn timeout(&mut self) -> TIMEOUT_W {
59        TIMEOUT_W { w: self }
60    }
61    #[doc = "Bit 1 - Clear Captured Event Interrupt"]
62    #[inline(always)]
63    pub fn evtcapt(&mut self) -> EVTCAPT_W {
64        EVTCAPT_W { w: self }
65    }
66}