xmc4300/usb0/
gnptxfsiz_hostmode.rs

1#[doc = "Register `GNPTXFSIZ_HOSTMODE` reader"]
2pub type R = crate::R<GNPTXFSIZ_HOSTMODE_SPEC>;
3#[doc = "Register `GNPTXFSIZ_HOSTMODE` writer"]
4pub type W = crate::W<GNPTXFSIZ_HOSTMODE_SPEC>;
5#[doc = "Field `NPTxFStAddr` reader - Non-periodic Transmit RAM Start Address"]
6pub type NPTX_FST_ADDR_R = crate::FieldReader<u16>;
7#[doc = "Field `NPTxFStAddr` writer - Non-periodic Transmit RAM Start Address"]
8pub type NPTX_FST_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `NPTxFDep` reader - Non-periodic TxFIFO Depth"]
10pub type NPTX_FDEP_R = crate::FieldReader<u16>;
11#[doc = "Field `NPTxFDep` writer - Non-periodic TxFIFO Depth"]
12pub type NPTX_FDEP_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
13impl R {
14    #[doc = "Bits 0:15 - Non-periodic Transmit RAM Start Address"]
15    #[inline(always)]
16    pub fn nptx_fst_addr(&self) -> NPTX_FST_ADDR_R {
17        NPTX_FST_ADDR_R::new((self.bits & 0xffff) as u16)
18    }
19    #[doc = "Bits 16:31 - Non-periodic TxFIFO Depth"]
20    #[inline(always)]
21    pub fn nptx_fdep(&self) -> NPTX_FDEP_R {
22        NPTX_FDEP_R::new(((self.bits >> 16) & 0xffff) as u16)
23    }
24}
25impl W {
26    #[doc = "Bits 0:15 - Non-periodic Transmit RAM Start Address"]
27    #[inline(always)]
28    pub fn nptx_fst_addr(&mut self) -> NPTX_FST_ADDR_W<GNPTXFSIZ_HOSTMODE_SPEC> {
29        NPTX_FST_ADDR_W::new(self, 0)
30    }
31    #[doc = "Bits 16:31 - Non-periodic TxFIFO Depth"]
32    #[inline(always)]
33    pub fn nptx_fdep(&mut self) -> NPTX_FDEP_W<GNPTXFSIZ_HOSTMODE_SPEC> {
34        NPTX_FDEP_W::new(self, 16)
35    }
36}
37#[doc = "Non-Periodic Transmit FIFO Size Register \\[HOSTMODE\\]\n\nYou can [`read`](crate::Reg::read) this register and get [`gnptxfsiz_hostmode::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gnptxfsiz_hostmode::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
38pub struct GNPTXFSIZ_HOSTMODE_SPEC;
39impl crate::RegisterSpec for GNPTXFSIZ_HOSTMODE_SPEC {
40    type Ux = u32;
41}
42#[doc = "`read()` method returns [`gnptxfsiz_hostmode::R`](R) reader structure"]
43impl crate::Readable for GNPTXFSIZ_HOSTMODE_SPEC {}
44#[doc = "`write(|w| ..)` method takes [`gnptxfsiz_hostmode::W`](W) writer structure"]
45impl crate::Writable for GNPTXFSIZ_HOSTMODE_SPEC {
46    type Safety = crate::Unsafe;
47    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
48    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
49}
50#[doc = "`reset()` method sets GNPTXFSIZ_HOSTMODE to value 0x0010_011a"]
51impl crate::Resettable for GNPTXFSIZ_HOSTMODE_SPEC {
52    const RESET_VALUE: u32 = 0x0010_011a;
53}