nrf52840_pac/usbd/halted/
epout.rs1#[doc = "Register `EPOUT[%s]` reader"]
2pub struct R(crate::R<EPOUT_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<EPOUT_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<EPOUT_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<EPOUT_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `GETSTATUS` reader - OUT endpoint halted status. Can be used as is as response to a GetStatus() request to endpoint."]
17pub type GETSTATUS_R = crate::FieldReader<u16, GETSTATUS_A>;
18#[doc = "OUT endpoint halted status. Can be used as is as response to a GetStatus() request to endpoint.\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq)]
20#[repr(u16)]
21pub enum GETSTATUS_A {
22 #[doc = "0: Endpoint is not halted"]
23 NOT_HALTED = 0,
24 #[doc = "1: Endpoint is halted"]
25 HALTED = 1,
26}
27impl From<GETSTATUS_A> for u16 {
28 #[inline(always)]
29 fn from(variant: GETSTATUS_A) -> Self {
30 variant as _
31 }
32}
33impl GETSTATUS_R {
34 #[doc = "Get enumerated values variant"]
35 #[inline(always)]
36 pub fn variant(&self) -> Option<GETSTATUS_A> {
37 match self.bits {
38 0 => Some(GETSTATUS_A::NOT_HALTED),
39 1 => Some(GETSTATUS_A::HALTED),
40 _ => None,
41 }
42 }
43 #[doc = "Checks if the value of the field is `NOT_HALTED`"]
44 #[inline(always)]
45 pub fn is_not_halted(&self) -> bool {
46 *self == GETSTATUS_A::NOT_HALTED
47 }
48 #[doc = "Checks if the value of the field is `HALTED`"]
49 #[inline(always)]
50 pub fn is_halted(&self) -> bool {
51 *self == GETSTATUS_A::HALTED
52 }
53}
54impl R {
55 #[doc = "Bits 0:15 - OUT endpoint halted status. Can be used as is as response to a GetStatus() request to endpoint."]
56 #[inline(always)]
57 pub fn getstatus(&self) -> GETSTATUS_R {
58 GETSTATUS_R::new((self.bits & 0xffff) as u16)
59 }
60}
61#[doc = "Description collection\\[n\\]: OUT endpoint halted status. Can be used as is as response to a GetStatus() request to endpoint.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [epout](index.html) module"]
62pub struct EPOUT_SPEC;
63impl crate::RegisterSpec for EPOUT_SPEC {
64 type Ux = u32;
65}
66#[doc = "`read()` method returns [epout::R](R) reader structure"]
67impl crate::Readable for EPOUT_SPEC {
68 type Reader = R;
69}
70#[doc = "`reset()` method sets EPOUT[%s]
71to value 0"]
72impl crate::Resettable for EPOUT_SPEC {
73 #[inline(always)]
74 fn reset_value() -> Self::Ux {
75 0
76 }
77}