atsamd21g/usb/host/
hsofc.rs
1#[doc = "Register `HSOFC` reader"]
2pub type R = crate::R<HsofcSpec>;
3#[doc = "Register `HSOFC` writer"]
4pub type W = crate::W<HsofcSpec>;
5#[doc = "Field `FLENC` reader - Frame Length Control"]
6pub type FlencR = crate::FieldReader;
7#[doc = "Field `FLENC` writer - Frame Length Control"]
8pub type FlencW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
9#[doc = "Field `FLENCE` reader - Frame Length Control Enable"]
10pub type FlenceR = crate::BitReader;
11#[doc = "Field `FLENCE` writer - Frame Length Control Enable"]
12pub type FlenceW<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14 #[doc = "Bits 0:3 - Frame Length Control"]
15 #[inline(always)]
16 pub fn flenc(&self) -> FlencR {
17 FlencR::new(self.bits & 0x0f)
18 }
19 #[doc = "Bit 7 - Frame Length Control Enable"]
20 #[inline(always)]
21 pub fn flence(&self) -> FlenceR {
22 FlenceR::new(((self.bits >> 7) & 1) != 0)
23 }
24}
25impl W {
26 #[doc = "Bits 0:3 - Frame Length Control"]
27 #[inline(always)]
28 #[must_use]
29 pub fn flenc(&mut self) -> FlencW<HsofcSpec> {
30 FlencW::new(self, 0)
31 }
32 #[doc = "Bit 7 - Frame Length Control Enable"]
33 #[inline(always)]
34 #[must_use]
35 pub fn flence(&mut self) -> FlenceW<HsofcSpec> {
36 FlenceW::new(self, 7)
37 }
38}
39#[doc = "HOST Host Start Of Frame Control\n\nYou can [`read`](crate::Reg::read) this register and get [`hsofc::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`hsofc::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct HsofcSpec;
41impl crate::RegisterSpec for HsofcSpec {
42 type Ux = u8;
43}
44#[doc = "`read()` method returns [`hsofc::R`](R) reader structure"]
45impl crate::Readable for HsofcSpec {}
46#[doc = "`write(|w| ..)` method takes [`hsofc::W`](W) writer structure"]
47impl crate::Writable for HsofcSpec {
48 type Safety = crate::Unsafe;
49 const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
50 const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
51}
52#[doc = "`reset()` method sets HSOFC to value 0"]
53impl crate::Resettable for HsofcSpec {
54 const RESET_VALUE: u8 = 0;
55}