atsamd21g/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;
11impl R {
12 #[doc = "Bits 2:3 - Speed Status"]
13 #[inline(always)]
14 pub fn speed(&self) -> SpeedR {
15 SpeedR::new((self.bits >> 2) & 3)
16 }
17 #[doc = "Bits 6:7 - USB Line State Status"]
18 #[inline(always)]
19 pub fn linestate(&self) -> LinestateR {
20 LinestateR::new((self.bits >> 6) & 3)
21 }
22}
23impl W {
24 #[doc = "Bits 2:3 - Speed Status"]
25 #[inline(always)]
26 #[must_use]
27 pub fn speed(&mut self) -> SpeedW<StatusSpec> {
28 SpeedW::new(self, 2)
29 }
30}
31#[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)."]
32pub struct StatusSpec;
33impl crate::RegisterSpec for StatusSpec {
34 type Ux = u8;
35}
36#[doc = "`read()` method returns [`status::R`](R) reader structure"]
37impl crate::Readable for StatusSpec {}
38#[doc = "`write(|w| ..)` method takes [`status::W`](W) writer structure"]
39impl crate::Writable for StatusSpec {
40 type Safety = crate::Unsafe;
41 const ZERO_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
42 const ONE_TO_MODIFY_FIELDS_BITMAP: u8 = 0;
43}
44#[doc = "`reset()` method sets STATUS to value 0"]
45impl crate::Resettable for StatusSpec {
46 const RESET_VALUE: u8 = 0;
47}