stm32g4/stm32g484/fmac/
ybufcfg.rs

1///Register `YBUFCFG` reader
2pub type R = crate::R<YBUFCFGrs>;
3///Register `YBUFCFG` writer
4pub type W = crate::W<YBUFCFGrs>;
5///Field `Y_BASE` reader - X1_BASE
6pub type Y_BASE_R = crate::FieldReader;
7///Field `Y_BASE` writer - X1_BASE
8pub type Y_BASE_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9///Field `Y_BUF_SIZE` reader - X1_BUF_SIZE
10pub type Y_BUF_SIZE_R = crate::FieldReader;
11///Field `Y_BUF_SIZE` writer - X1_BUF_SIZE
12pub type Y_BUF_SIZE_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13///Field `EMPTY_WM` reader - EMPTY_WM
14pub type EMPTY_WM_R = crate::FieldReader;
15///Field `EMPTY_WM` writer - EMPTY_WM
16pub type EMPTY_WM_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
17impl R {
18    ///Bits 0:7 - X1_BASE
19    #[inline(always)]
20    pub fn y_base(&self) -> Y_BASE_R {
21        Y_BASE_R::new((self.bits & 0xff) as u8)
22    }
23    ///Bits 8:15 - X1_BUF_SIZE
24    #[inline(always)]
25    pub fn y_buf_size(&self) -> Y_BUF_SIZE_R {
26        Y_BUF_SIZE_R::new(((self.bits >> 8) & 0xff) as u8)
27    }
28    ///Bits 24:25 - EMPTY_WM
29    #[inline(always)]
30    pub fn empty_wm(&self) -> EMPTY_WM_R {
31        EMPTY_WM_R::new(((self.bits >> 24) & 3) as u8)
32    }
33}
34impl core::fmt::Debug for R {
35    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
36        f.debug_struct("YBUFCFG")
37            .field("y_base", &self.y_base())
38            .field("y_buf_size", &self.y_buf_size())
39            .field("empty_wm", &self.empty_wm())
40            .finish()
41    }
42}
43impl W {
44    ///Bits 0:7 - X1_BASE
45    #[inline(always)]
46    pub fn y_base(&mut self) -> Y_BASE_W<YBUFCFGrs> {
47        Y_BASE_W::new(self, 0)
48    }
49    ///Bits 8:15 - X1_BUF_SIZE
50    #[inline(always)]
51    pub fn y_buf_size(&mut self) -> Y_BUF_SIZE_W<YBUFCFGrs> {
52        Y_BUF_SIZE_W::new(self, 8)
53    }
54    ///Bits 24:25 - EMPTY_WM
55    #[inline(always)]
56    pub fn empty_wm(&mut self) -> EMPTY_WM_W<YBUFCFGrs> {
57        EMPTY_WM_W::new(self, 24)
58    }
59}
60/**FMAC Y Buffer Configuration register
61
62You can [`read`](crate::Reg::read) this register and get [`ybufcfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ybufcfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
63
64See register [structure](https://stm32-rs.github.io/stm32-rs/STM32G484.html#FMAC:YBUFCFG)*/
65pub struct YBUFCFGrs;
66impl crate::RegisterSpec for YBUFCFGrs {
67    type Ux = u32;
68}
69///`read()` method returns [`ybufcfg::R`](R) reader structure
70impl crate::Readable for YBUFCFGrs {}
71///`write(|w| ..)` method takes [`ybufcfg::W`](W) writer structure
72impl crate::Writable for YBUFCFGrs {
73    type Safety = crate::Unsafe;
74}
75///`reset()` method sets YBUFCFG to value 0
76impl crate::Resettable for YBUFCFGrs {}