stm32wb_pac/exti/
ftsr1.rs

1#[doc = "Reader of register FTSR1"]
2pub type R = crate::R<u32, super::FTSR1>;
3#[doc = "Writer for register FTSR1"]
4pub type W = crate::W<u32, super::FTSR1>;
5#[doc = "Register FTSR1 `reset()`'s with value 0"]
6impl crate::ResetValue for super::FTSR1 {
7    type Type = u32;
8    #[inline(always)]
9    fn reset_value() -> Self::Type {
10        0
11    }
12}
13#[doc = "Reader of field `FT`"]
14pub type FT_R = crate::R<u32, u32>;
15#[doc = "Write proxy for field `FT`"]
16pub struct FT_W<'a> {
17    w: &'a mut W,
18}
19impl<'a> FT_W<'a> {
20    #[doc = r"Writes raw bits to the field"]
21    #[inline(always)]
22    pub unsafe fn bits(self, value: u32) -> &'a mut W {
23        self.w.bits = (self.w.bits & !0x003f_ffff) | ((value as u32) & 0x003f_ffff);
24        self.w
25    }
26}
27#[doc = "Reader of field `FT_31`"]
28pub type FT_31_R = crate::R<bool, bool>;
29#[doc = "Write proxy for field `FT_31`"]
30pub struct FT_31_W<'a> {
31    w: &'a mut W,
32}
33impl<'a> FT_31_W<'a> {
34    #[doc = r"Sets the field bit"]
35    #[inline(always)]
36    pub fn set_bit(self) -> &'a mut W {
37        self.bit(true)
38    }
39    #[doc = r"Clears the field bit"]
40    #[inline(always)]
41    pub fn clear_bit(self) -> &'a mut W {
42        self.bit(false)
43    }
44    #[doc = r"Writes raw bits to the field"]
45    #[inline(always)]
46    pub fn bit(self, value: bool) -> &'a mut W {
47        self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31);
48        self.w
49    }
50}
51impl R {
52    #[doc = "Bits 0:21 - Falling trigger event configuration bit of Configurable Event input"]
53    #[inline(always)]
54    pub fn ft(&self) -> FT_R {
55        FT_R::new((self.bits & 0x003f_ffff) as u32)
56    }
57    #[doc = "Bit 31 - Falling trigger event configuration bit of Configurable Event input"]
58    #[inline(always)]
59    pub fn ft_31(&self) -> FT_31_R {
60        FT_31_R::new(((self.bits >> 31) & 0x01) != 0)
61    }
62}
63impl W {
64    #[doc = "Bits 0:21 - Falling trigger event configuration bit of Configurable Event input"]
65    #[inline(always)]
66    pub fn ft(&mut self) -> FT_W {
67        FT_W { w: self }
68    }
69    #[doc = "Bit 31 - Falling trigger event configuration bit of Configurable Event input"]
70    #[inline(always)]
71    pub fn ft_31(&mut self) -> FT_31_W {
72        FT_31_W { w: self }
73    }
74}