#[doc = "Register `STATUS` reader"]
pub type R = crate::R<STATUS_SPEC>;
#[doc = "Register `STATUS` writer"]
pub type W = crate::W<STATUS_SPEC>;
#[doc = "Field `SPEED` reader - Speed Status"]
pub type SPEED_R = crate::FieldReader;
#[doc = "Field `SPEED` writer - Speed Status"]
pub type SPEED_W<'a, REG, const O: u8> = crate::FieldWriter<'a, REG, 2, O>;
#[doc = "Field `LINESTATE` reader - USB Line State Status"]
pub type LINESTATE_R = crate::FieldReader;
#[doc = "Field `LINESTATE` writer - USB Line State Status"]
pub type LINESTATE_W<'a, REG, const O: u8> = crate::FieldWriter<'a, REG, 2, O>;
impl R {
#[doc = "Bits 2:3 - Speed Status"]
#[inline(always)]
pub fn speed(&self) -> SPEED_R {
SPEED_R::new((self.bits >> 2) & 3)
}
#[doc = "Bits 6:7 - USB Line State Status"]
#[inline(always)]
pub fn linestate(&self) -> LINESTATE_R {
LINESTATE_R::new((self.bits >> 6) & 3)
}
}
impl W {
#[doc = "Bits 2:3 - Speed Status"]
#[inline(always)]
#[must_use]
pub fn speed(&mut self) -> SPEED_W<STATUS_SPEC, 2> {
SPEED_W::new(self)
}
#[doc = "Bits 6:7 - USB Line State Status"]
#[inline(always)]
#[must_use]
pub fn linestate(&mut self) -> LINESTATE_W<STATUS_SPEC, 6> {
LINESTATE_W::new(self)
}
#[doc = r" Writes raw bits to the register."]
#[doc = r""]
#[doc = r" # Safety"]
#[doc = r""]
#[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u8) -> &mut Self {
self.bits = bits;
self
}
}
#[doc = "HOST Status\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`status::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`status::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct STATUS_SPEC;
impl crate::RegisterSpec for STATUS_SPEC {
type Ux = u8;
}
#[doc = "`read()` method returns [`status::R`](R) reader structure"]
impl crate::Readable for STATUS_SPEC {}
#[doc = "`write(|w| ..)` method takes [`status::W`](W) writer structure"]
impl crate::Writable for STATUS_SPEC {
const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
}
#[doc = "`reset()` method sets STATUS to value 0"]
impl crate::Resettable for STATUS_SPEC {
const RESET_VALUE: Self::Ux = 0;
}