efm32gg_pac/efm32gg995/usb/
hptxfsiz.rs1#[doc = "Register `HPTXFSIZ` reader"]
2pub struct R(crate::R<HPTXFSIZ_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<HPTXFSIZ_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<HPTXFSIZ_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<HPTXFSIZ_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `HPTXFSIZ` writer"]
17pub struct W(crate::W<HPTXFSIZ_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<HPTXFSIZ_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<HPTXFSIZ_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<HPTXFSIZ_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `PTXFSTADDR` reader - Host Periodic TxFIFO Start Address"]
38pub type PTXFSTADDR_R = crate::FieldReader<u16, u16>;
39#[doc = "Field `PTXFSTADDR` writer - Host Periodic TxFIFO Start Address"]
40pub type PTXFSTADDR_W<'a, const O: u8> =
41 crate::FieldWriter<'a, u32, HPTXFSIZ_SPEC, u16, u16, 11, O>;
42#[doc = "Field `PTXFSIZE` reader - Host Periodic TxFIFO Depth"]
43pub type PTXFSIZE_R = crate::FieldReader<u16, u16>;
44#[doc = "Field `PTXFSIZE` writer - Host Periodic TxFIFO Depth"]
45pub type PTXFSIZE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, HPTXFSIZ_SPEC, u16, u16, 10, O>;
46impl R {
47 #[doc = "Bits 0:10 - Host Periodic TxFIFO Start Address"]
48 #[inline(always)]
49 pub fn ptxfstaddr(&self) -> PTXFSTADDR_R {
50 PTXFSTADDR_R::new((self.bits & 0x07ff) as u16)
51 }
52 #[doc = "Bits 16:25 - Host Periodic TxFIFO Depth"]
53 #[inline(always)]
54 pub fn ptxfsize(&self) -> PTXFSIZE_R {
55 PTXFSIZE_R::new(((self.bits >> 16) & 0x03ff) as u16)
56 }
57}
58impl W {
59 #[doc = "Bits 0:10 - Host Periodic TxFIFO Start Address"]
60 #[inline(always)]
61 #[must_use]
62 pub fn ptxfstaddr(&mut self) -> PTXFSTADDR_W<0> {
63 PTXFSTADDR_W::new(self)
64 }
65 #[doc = "Bits 16:25 - Host Periodic TxFIFO Depth"]
66 #[inline(always)]
67 #[must_use]
68 pub fn ptxfsize(&mut self) -> PTXFSIZE_W<16> {
69 PTXFSIZE_W::new(self)
70 }
71 #[doc = "Writes raw bits to the register."]
72 #[inline(always)]
73 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
74 self.0.bits(bits);
75 self
76 }
77}
78#[doc = "Host Periodic Transmit FIFO Size Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hptxfsiz](index.html) module"]
79pub struct HPTXFSIZ_SPEC;
80impl crate::RegisterSpec for HPTXFSIZ_SPEC {
81 type Ux = u32;
82}
83#[doc = "`read()` method returns [hptxfsiz::R](R) reader structure"]
84impl crate::Readable for HPTXFSIZ_SPEC {
85 type Reader = R;
86}
87#[doc = "`write(|w| ..)` method takes [hptxfsiz::W](W) writer structure"]
88impl crate::Writable for HPTXFSIZ_SPEC {
89 type Writer = W;
90 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
91 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
92}
93#[doc = "`reset()` method sets HPTXFSIZ to value 0x0200_0400"]
94impl crate::Resettable for HPTXFSIZ_SPEC {
95 const RESET_VALUE: Self::Ux = 0x0200_0400;
96}