µOS++ IIIe Reference  v6.3.15
“Perfekt ist nicht gut genug”
The third edition of µOS++, a POSIX inspired open source system, written in C++.
usb.h
Go to the documentation of this file.
1 /*
2  * This file is part of the µOS++ distribution.
3  * (https://github.com/micro-os-plus)
4  * Copyright (c) 2016 Liviu Ionescu.
5  * Copyright (c) 2013-2014 ARM Ltd.
6  *
7  * Permission is hereby granted, free of charge, to any person
8  * obtaining a copy of this software and associated documentation
9  * files (the "Software"), to deal in the Software without
10  * restriction, including without limitation the rights to use,
11  * copy, modify, merge, publish, distribute, sublicense, and/or
12  * sell copies of the Software, and to permit persons to whom
13  * the Software is furnished to do so, subject to the following
14  * conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
21  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
23  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26  * OTHER DEALINGS IN THE SOFTWARE.
27  */
28 
29 /*
30  * The code is inspired by ARM CMSIS Driver_USB.h file, v2.00,
31  * and tries to remain functionally close to the CMSIS specifications.
32  */
33 
34 #ifndef CMSIS_PLUS_DRIVER_USB_H_
35 #define CMSIS_PLUS_DRIVER_USB_H_
36 
37 // ----------------------------------------------------------------------------
38 
39 #ifdef __cplusplus
40 
41 #include <cstdint>
42 
43 namespace os
44 {
45  namespace driver
46  {
47  namespace usb
48  {
49 
50  // --------------------------------------------------------------------
51 
52  using speed_t = uint8_t;
53 
57  enum class Speed
58  : speed_t
59  {
60  //
61 
63  low = 0,
64 
66  full = 1,
67 
69  high = 2,
70  };
71 
72  // --------------------------------------------------------------------
73 
74  using endpoint_t = uint8_t;
75 
76  constexpr endpoint_t ENDPOINT_NUMBER_MASK = 0x0F;
78 
79  // --------------------------------------------------------------------
80 
81  using endpoint_type_t = uint8_t;
82 
86  enum class Endpoint_type
88  {
89  //
90 
92  control = 0,
93 
95  isochronous = 1,
96 
98  bulk = 2,
99 
101  interrupt = 3
102  };
103 
104  // --------------------------------------------------------------------
105  using packet_size_t = uint16_t;
106 
108 
109  // --------------------------------------------------------------------
110  using frame_number_t = uint16_t;
111 
112  using device_address_t = uint8_t;
113 
114  //using ARM_USBH_PIPE_HANDLE = uint32_t;
115  using pipe_t = uint32_t;
116  using port_t = uint8_t;
117 
118  using hub_addr_t = uint8_t;
119  using hub_port_t = uint8_t;
120 
121  using polling_interval_t = uint8_t;
122 
123  } /* namespace usb */
124  } /* namespace driver */
125 } /* namespace os */
126 
127 #endif /* __cplusplus */
128 
129 // ----------------------------------------------------------------------------
130 
131 #endif /* CMSIS_PLUS_DRIVER_USB_H_ */
uint8_t port_t
Definition: usb.h:116
Speed
USB Speed.
Definition: usb.h:57
uint8_t polling_interval_t
Definition: usb.h:121
System namespace.
uint8_t endpoint_t
Definition: usb.h:74
constexpr endpoint_t ENDPOINT_DIRECTION_MASK
Definition: usb.h:77
Endpoint_type
Endpoint type.
Definition: usb.h:86
constexpr endpoint_t ENDPOINT_NUMBER_MASK
Definition: usb.h:76
uint8_t hub_addr_t
Definition: usb.h:118
uint8_t device_address_t
Definition: usb.h:112
constexpr packet_size_t ENDPOINT_MAX_PACKET_SIZE_MASK
Definition: usb.h:107
uint32_t pipe_t
Definition: usb.h:115
uint8_t speed_t
Definition: usb.h:52
uint8_t hub_port_t
Definition: usb.h:119
uint16_t packet_size_t
Definition: usb.h:105
uint8_t endpoint_type_t
Definition: usb.h:81
uint16_t frame_number_t
Definition: usb.h:110