stm32f4/stm32f401/otg_fs_global/
dieptxf.rs

1///Register `DIEPTXF%s` reader
2pub type R = crate::R<DIEPTXFrs>;
3///Register `DIEPTXF%s` writer
4pub type W = crate::W<DIEPTXFrs>;
5///Field `INEPTXSA` reader - IN endpoint FIFO2 transmit RAM start address
6pub type INEPTXSA_R = crate::FieldReader<u16>;
7///Field `INEPTXSA` writer - IN endpoint FIFO2 transmit RAM start address
8pub type INEPTXSA_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9///Field `INEPTXFD` reader - IN endpoint TxFIFO depth
10pub type INEPTXFD_R = crate::FieldReader<u16>;
11///Field `INEPTXFD` writer - IN endpoint TxFIFO depth
12pub type INEPTXFD_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
13impl R {
14    ///Bits 0:15 - IN endpoint FIFO2 transmit RAM start address
15    #[inline(always)]
16    pub fn ineptxsa(&self) -> INEPTXSA_R {
17        INEPTXSA_R::new((self.bits & 0xffff) as u16)
18    }
19    ///Bits 16:31 - IN endpoint TxFIFO depth
20    #[inline(always)]
21    pub fn ineptxfd(&self) -> INEPTXFD_R {
22        INEPTXFD_R::new(((self.bits >> 16) & 0xffff) as u16)
23    }
24}
25impl core::fmt::Debug for R {
26    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
27        f.debug_struct("DIEPTXF")
28            .field("ineptxsa", &self.ineptxsa())
29            .field("ineptxfd", &self.ineptxfd())
30            .finish()
31    }
32}
33impl W {
34    ///Bits 0:15 - IN endpoint FIFO2 transmit RAM start address
35    #[inline(always)]
36    pub fn ineptxsa(&mut self) -> INEPTXSA_W<DIEPTXFrs> {
37        INEPTXSA_W::new(self, 0)
38    }
39    ///Bits 16:31 - IN endpoint TxFIFO depth
40    #[inline(always)]
41    pub fn ineptxfd(&mut self) -> INEPTXFD_W<DIEPTXFrs> {
42        INEPTXFD_W::new(self, 16)
43    }
44}
45/**OTG_FS device IN endpoint transmit FIFO size register
46
47You can [`read`](crate::Reg::read) this register and get [`dieptxf::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dieptxf::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/STM32F401.html#OTG_FS_GLOBAL:DIEPTXF[1])*/
50pub struct DIEPTXFrs;
51impl crate::RegisterSpec for DIEPTXFrs {
52    type Ux = u32;
53}
54///`read()` method returns [`dieptxf::R`](R) reader structure
55impl crate::Readable for DIEPTXFrs {}
56///`write(|w| ..)` method takes [`dieptxf::W`](W) writer structure
57impl crate::Writable for DIEPTXFrs {
58    type Safety = crate::Unsafe;
59}
60///`reset()` method sets DIEPTXF%s to value 0x0200_0400
61impl crate::Resettable for DIEPTXFrs {
62    const RESET_VALUE: u32 = 0x0200_0400;
63}