nrf52840_pac/usbd/
brequest.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#[doc = "Register `BREQUEST` reader"]
pub struct R(crate::R<BREQUEST_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<BREQUEST_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<BREQUEST_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<BREQUEST_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Field `BREQUEST` reader - SETUP data, byte 1, bRequest. Values provided for standard requests only, user must implement class and vendor values."]
pub type BREQUEST_R = crate::FieldReader<u8, BREQUEST_A>;
#[doc = "SETUP data, byte 1, bRequest. Values provided for standard requests only, user must implement class and vendor values.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum BREQUEST_A {
    #[doc = "0: Standard request GET_STATUS"]
    STD_GET_STATUS = 0,
    #[doc = "1: Standard request CLEAR_FEATURE"]
    STD_CLEAR_FEATURE = 1,
    #[doc = "3: Standard request SET_FEATURE"]
    STD_SET_FEATURE = 3,
    #[doc = "5: Standard request SET_ADDRESS"]
    STD_SET_ADDRESS = 5,
    #[doc = "6: Standard request GET_DESCRIPTOR"]
    STD_GET_DESCRIPTOR = 6,
    #[doc = "7: Standard request SET_DESCRIPTOR"]
    STD_SET_DESCRIPTOR = 7,
    #[doc = "8: Standard request GET_CONFIGURATION"]
    STD_GET_CONFIGURATION = 8,
    #[doc = "9: Standard request SET_CONFIGURATION"]
    STD_SET_CONFIGURATION = 9,
    #[doc = "10: Standard request GET_INTERFACE"]
    STD_GET_INTERFACE = 10,
    #[doc = "11: Standard request SET_INTERFACE"]
    STD_SET_INTERFACE = 11,
    #[doc = "12: Standard request SYNCH_FRAME"]
    STD_SYNCH_FRAME = 12,
}
impl From<BREQUEST_A> for u8 {
    #[inline(always)]
    fn from(variant: BREQUEST_A) -> Self {
        variant as _
    }
}
impl BREQUEST_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> Option<BREQUEST_A> {
        match self.bits {
            0 => Some(BREQUEST_A::STD_GET_STATUS),
            1 => Some(BREQUEST_A::STD_CLEAR_FEATURE),
            3 => Some(BREQUEST_A::STD_SET_FEATURE),
            5 => Some(BREQUEST_A::STD_SET_ADDRESS),
            6 => Some(BREQUEST_A::STD_GET_DESCRIPTOR),
            7 => Some(BREQUEST_A::STD_SET_DESCRIPTOR),
            8 => Some(BREQUEST_A::STD_GET_CONFIGURATION),
            9 => Some(BREQUEST_A::STD_SET_CONFIGURATION),
            10 => Some(BREQUEST_A::STD_GET_INTERFACE),
            11 => Some(BREQUEST_A::STD_SET_INTERFACE),
            12 => Some(BREQUEST_A::STD_SYNCH_FRAME),
            _ => None,
        }
    }
    #[doc = "Checks if the value of the field is `STD_GET_STATUS`"]
    #[inline(always)]
    pub fn is_std_get_status(&self) -> bool {
        *self == BREQUEST_A::STD_GET_STATUS
    }
    #[doc = "Checks if the value of the field is `STD_CLEAR_FEATURE`"]
    #[inline(always)]
    pub fn is_std_clear_feature(&self) -> bool {
        *self == BREQUEST_A::STD_CLEAR_FEATURE
    }
    #[doc = "Checks if the value of the field is `STD_SET_FEATURE`"]
    #[inline(always)]
    pub fn is_std_set_feature(&self) -> bool {
        *self == BREQUEST_A::STD_SET_FEATURE
    }
    #[doc = "Checks if the value of the field is `STD_SET_ADDRESS`"]
    #[inline(always)]
    pub fn is_std_set_address(&self) -> bool {
        *self == BREQUEST_A::STD_SET_ADDRESS
    }
    #[doc = "Checks if the value of the field is `STD_GET_DESCRIPTOR`"]
    #[inline(always)]
    pub fn is_std_get_descriptor(&self) -> bool {
        *self == BREQUEST_A::STD_GET_DESCRIPTOR
    }
    #[doc = "Checks if the value of the field is `STD_SET_DESCRIPTOR`"]
    #[inline(always)]
    pub fn is_std_set_descriptor(&self) -> bool {
        *self == BREQUEST_A::STD_SET_DESCRIPTOR
    }
    #[doc = "Checks if the value of the field is `STD_GET_CONFIGURATION`"]
    #[inline(always)]
    pub fn is_std_get_configuration(&self) -> bool {
        *self == BREQUEST_A::STD_GET_CONFIGURATION
    }
    #[doc = "Checks if the value of the field is `STD_SET_CONFIGURATION`"]
    #[inline(always)]
    pub fn is_std_set_configuration(&self) -> bool {
        *self == BREQUEST_A::STD_SET_CONFIGURATION
    }
    #[doc = "Checks if the value of the field is `STD_GET_INTERFACE`"]
    #[inline(always)]
    pub fn is_std_get_interface(&self) -> bool {
        *self == BREQUEST_A::STD_GET_INTERFACE
    }
    #[doc = "Checks if the value of the field is `STD_SET_INTERFACE`"]
    #[inline(always)]
    pub fn is_std_set_interface(&self) -> bool {
        *self == BREQUEST_A::STD_SET_INTERFACE
    }
    #[doc = "Checks if the value of the field is `STD_SYNCH_FRAME`"]
    #[inline(always)]
    pub fn is_std_synch_frame(&self) -> bool {
        *self == BREQUEST_A::STD_SYNCH_FRAME
    }
}
impl R {
    #[doc = "Bits 0:7 - SETUP data, byte 1, bRequest. Values provided for standard requests only, user must implement class and vendor values."]
    #[inline(always)]
    pub fn brequest(&self) -> BREQUEST_R {
        BREQUEST_R::new((self.bits & 0xff) as u8)
    }
}
#[doc = "SETUP data, byte 1, bRequest\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 [brequest](index.html) module"]
pub struct BREQUEST_SPEC;
impl crate::RegisterSpec for BREQUEST_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [brequest::R](R) reader structure"]
impl crate::Readable for BREQUEST_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets BREQUEST to value 0"]
impl crate::Resettable for BREQUEST_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}