lpc55s6x_pac/usbhsh/
fladj_frindex.rs1#[doc = "Reader of register FLADJ_FRINDEX"]
2pub type R = crate::R<u32, super::FLADJ_FRINDEX>;
3#[doc = "Writer for register FLADJ_FRINDEX"]
4pub type W = crate::W<u32, super::FLADJ_FRINDEX>;
5#[doc = "Register FLADJ_FRINDEX `reset()`'s with value 0x20"]
6impl crate::ResetValue for super::FLADJ_FRINDEX {
7 type Type = u32;
8 #[inline(always)]
9 fn reset_value() -> Self::Type {
10 0x20
11 }
12}
13#[doc = "Reader of field `FLADJ`"]
14pub type FLADJ_R = crate::R<u8, u8>;
15#[doc = "Write proxy for field `FLADJ`"]
16pub struct FLADJ_W<'a> {
17 w: &'a mut W,
18}
19impl<'a> FLADJ_W<'a> {
20 #[doc = r"Writes raw bits to the field"]
21 #[inline(always)]
22 pub unsafe fn bits(self, value: u8) -> &'a mut W {
23 self.w.bits = (self.w.bits & !0x3f) | ((value as u32) & 0x3f);
24 self.w
25 }
26}
27#[doc = "Reader of field `FRINDEX`"]
28pub type FRINDEX_R = crate::R<u16, u16>;
29#[doc = "Write proxy for field `FRINDEX`"]
30pub struct FRINDEX_W<'a> {
31 w: &'a mut W,
32}
33impl<'a> FRINDEX_W<'a> {
34 #[doc = r"Writes raw bits to the field"]
35 #[inline(always)]
36 pub unsafe fn bits(self, value: u16) -> &'a mut W {
37 self.w.bits = (self.w.bits & !(0x3fff << 16)) | (((value as u32) & 0x3fff) << 16);
38 self.w
39 }
40}
41impl R {
42 #[doc = "Bits 0:5 - Frame Length Timing Value."]
43 #[inline(always)]
44 pub fn fladj(&self) -> FLADJ_R {
45 FLADJ_R::new((self.bits & 0x3f) as u8)
46 }
47 #[doc = "Bits 16:29 - Frame Index: Bits 29 to16 in this register are used for the frame number field in the SOF packet."]
48 #[inline(always)]
49 pub fn frindex(&self) -> FRINDEX_R {
50 FRINDEX_R::new(((self.bits >> 16) & 0x3fff) as u16)
51 }
52}
53impl W {
54 #[doc = "Bits 0:5 - Frame Length Timing Value."]
55 #[inline(always)]
56 pub fn fladj(&mut self) -> FLADJ_W {
57 FLADJ_W { w: self }
58 }
59 #[doc = "Bits 16:29 - Frame Index: Bits 29 to16 in this register are used for the frame number field in the SOF packet."]
60 #[inline(always)]
61 pub fn frindex(&mut self) -> FRINDEX_W {
62 FRINDEX_W { w: self }
63 }
64}