stm32g4/stm32g431/tim15/
af2.rs

1///Register `AF2` reader
2pub type R = crate::R<AF2rs>;
3///Register `AF2` writer
4pub type W = crate::W<AF2rs>;
5///Field `OCRSEL` reader - OCREF_CLR source selection
6pub type OCRSEL_R = crate::FieldReader;
7///Field `OCRSEL` writer - OCREF_CLR source selection
8pub type OCRSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
9impl R {
10    ///Bits 16:18 - OCREF_CLR source selection
11    #[inline(always)]
12    pub fn ocrsel(&self) -> OCRSEL_R {
13        OCRSEL_R::new(((self.bits >> 16) & 7) as u8)
14    }
15}
16impl core::fmt::Debug for R {
17    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
18        f.debug_struct("AF2")
19            .field("ocrsel", &self.ocrsel())
20            .finish()
21    }
22}
23impl W {
24    ///Bits 16:18 - OCREF_CLR source selection
25    #[inline(always)]
26    pub fn ocrsel(&mut self) -> OCRSEL_W<AF2rs> {
27        OCRSEL_W::new(self, 16)
28    }
29}
30/**TIM alternate function option register 2
31
32You can [`read`](crate::Reg::read) this register and get [`af2::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`af2::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
33
34See register [structure](https://stm32-rs.github.io/stm32-rs/STM32G431.html#TIM15:AF2)*/
35pub struct AF2rs;
36impl crate::RegisterSpec for AF2rs {
37    type Ux = u32;
38}
39///`read()` method returns [`af2::R`](R) reader structure
40impl crate::Readable for AF2rs {}
41///`write(|w| ..)` method takes [`af2::W`](W) writer structure
42impl crate::Writable for AF2rs {
43    type Safety = crate::Unsafe;
44}
45///`reset()` method sets AF2 to value 0
46impl crate::Resettable for AF2rs {}