stm32f1_staging/stm32f107/can1/
fmr.rs

1///Register `FMR` reader
2pub type R = crate::R<FMRrs>;
3///Register `FMR` writer
4pub type W = crate::W<FMRrs>;
5///Field `FINIT` reader - FINIT
6pub type FINIT_R = crate::BitReader;
7///Field `FINIT` writer - FINIT
8pub type FINIT_W<'a, REG> = crate::BitWriter<'a, REG>;
9///Field `CAN2SB` reader - CAN2SB
10pub type CAN2SB_R = crate::FieldReader;
11///Field `CAN2SB` writer - CAN2SB
12pub type CAN2SB_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
13impl R {
14    ///Bit 0 - FINIT
15    #[inline(always)]
16    pub fn finit(&self) -> FINIT_R {
17        FINIT_R::new((self.bits & 1) != 0)
18    }
19    ///Bits 8:13 - CAN2SB
20    #[inline(always)]
21    pub fn can2sb(&self) -> CAN2SB_R {
22        CAN2SB_R::new(((self.bits >> 8) & 0x3f) as u8)
23    }
24}
25impl core::fmt::Debug for R {
26    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
27        f.debug_struct("FMR")
28            .field("can2sb", &self.can2sb())
29            .field("finit", &self.finit())
30            .finish()
31    }
32}
33impl W {
34    ///Bit 0 - FINIT
35    #[inline(always)]
36    pub fn finit(&mut self) -> FINIT_W<FMRrs> {
37        FINIT_W::new(self, 0)
38    }
39    ///Bits 8:13 - CAN2SB
40    #[inline(always)]
41    pub fn can2sb(&mut self) -> CAN2SB_W<FMRrs> {
42        CAN2SB_W::new(self, 8)
43    }
44}
45/**CAN_FMR
46
47You can [`read`](crate::Reg::read) this register and get [`fmr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fmr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
48
49See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F107.html#CAN1:FMR)*/
50pub struct FMRrs;
51impl crate::RegisterSpec for FMRrs {
52    type Ux = u32;
53}
54///`read()` method returns [`fmr::R`](R) reader structure
55impl crate::Readable for FMRrs {}
56///`write(|w| ..)` method takes [`fmr::W`](W) writer structure
57impl crate::Writable for FMRrs {
58    type Safety = crate::Unsafe;
59}
60///`reset()` method sets FMR to value 0
61impl crate::Resettable for FMRrs {}