atsamd51g/usb/host/
status.rs
1#[doc = "Register `STATUS` reader"]
2pub type R = crate::R<StatusSpec>;
3#[doc = "Register `STATUS` writer"]
4pub type W = crate::W<StatusSpec>;
5#[doc = "Field `SPEED` reader - Speed Status"]
6pub type SpeedR = crate::FieldReader;
7#[doc = "Field `SPEED` writer - Speed Status"]
8pub type SpeedW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `LINESTATE` reader - USB Line State Status"]
10pub type LinestateR = crate::FieldReader;
11#[doc = "Field `LINESTATE` writer - USB Line State Status"]
12pub type LinestateW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13impl R {
14 #[doc = "Bits 2:3 - Speed Status"]
15 #[inline(always)]
16 pub fn speed(&self) -> SpeedR {
17 SpeedR::new((self.bits >> 2) & 3)
18 }
19 #[doc = "Bits 6:7 - USB Line State Status"]
20 #[inline(always)]
21 pub fn linestate(&self) -> LinestateR {
22 LinestateR::new((self.bits >> 6) & 3)
23 }
24}
25impl W {
26 #[doc = "Bits 2:3 - Speed Status"]
27 #[inline(always)]
28 #[must_use]
29 pub fn speed(&mut self) -> SpeedW<StatusSpec> {
30 SpeedW::new(self, 2)
31 }
32 #[doc = "Bits 6:7 - USB Line State Status"]
33 #[inline(always)]
34 #[must_use]
35 pub fn linestate(&mut self) -> LinestateW<StatusSpec> {
36 LinestateW::new(self, 6)
37 }
38}
39#[doc = "HOST Status\n\nYou can [`read`](crate::Reg::read) this register and get [`status::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`status::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct StatusSpec;
41impl crate::RegisterSpec for StatusSpec {
42 type Ux = u8;
43}
44#[doc = "`read()` method returns [`status::R`](R) reader structure"]
45impl crate::Readable for StatusSpec {}
46#[doc = "`write(|w| ..)` method takes [`status::W`](W) writer structure"]
47impl crate::Writable for StatusSpec {
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 STATUS to value 0"]
53impl crate::Resettable for StatusSpec {
54 const RESET_VALUE: u8 = 0;
55}