µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
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// ----------------------------------------------------------------------------
42
43#include <cstdint>
44
45#pragma GCC diagnostic push
46
47#if defined(__clang__)
48#pragma clang diagnostic ignored "-Wc++98-compat"
49#endif
50
51// ----------------------------------------------------------------------------
52
53namespace os
54{
55 namespace driver
56 {
57 namespace usb
58 {
59
60 // --------------------------------------------------------------------
61
62 using speed_t = uint8_t;
63
67 enum class Speed
68 : speed_t
69 {
70 //
71
73 low = 0,
74
76 full = 1,
77
79 high = 2,
80 };
81
82 // --------------------------------------------------------------------
83
84 using endpoint_t = uint8_t;
85
88
89 // --------------------------------------------------------------------
90
91 using endpoint_type_t = uint8_t;
92
96 enum class Endpoint_type
98 {
99 //
100
102 control = 0,
103
105 isochronous = 1,
106
108 bulk = 2,
109
111 interrupt = 3
112 };
113
114 // --------------------------------------------------------------------
115 using packet_size_t = uint16_t;
116
118
119 // --------------------------------------------------------------------
120 using frame_number_t = uint16_t;
121
122 using device_address_t = uint8_t;
123
124 //using ARM_USBH_PIPE_HANDLE = uint32_t;
125 using pipe_t = uint32_t;
126 using port_t = uint8_t;
127
128 using hub_addr_t = uint8_t;
129 using hub_port_t = uint8_t;
130
131 using polling_interval_t = uint8_t;
132
133 } /* namespace usb */
134 } /* namespace driver */
135} /* namespace os */
136
137#pragma GCC diagnostic pop
138
139// ----------------------------------------------------------------------------
140
141#endif /* __cplusplus */
142
143// ----------------------------------------------------------------------------
144
145#endif /* CMSIS_PLUS_DRIVER_USB_H_ */
uint8_t speed_t
Definition usb.h:62
uint8_t endpoint_t
Definition usb.h:84
uint32_t pipe_t
Definition usb.h:125
constexpr packet_size_t ENDPOINT_MAX_PACKET_SIZE_MASK
Definition usb.h:117
uint8_t hub_addr_t
Definition usb.h:128
Speed
USB Speed.
Definition usb.h:69
@ low
Low-speed USB.
@ full
High-speed USB.
constexpr endpoint_t ENDPOINT_DIRECTION_MASK
Definition usb.h:87
uint8_t device_address_t
Definition usb.h:122
uint8_t endpoint_type_t
Definition usb.h:91
uint16_t packet_size_t
Definition usb.h:115
uint8_t port_t
Definition usb.h:126
constexpr endpoint_t ENDPOINT_NUMBER_MASK
Definition usb.h:86
uint8_t polling_interval_t
Definition usb.h:131
uint8_t hub_port_t
Definition usb.h:129
uint16_t frame_number_t
Definition usb.h:120
Endpoint_type
Endpoint type.
Definition usb.h:98
@ bulk
Interrupt Endpoint.
@ control
Control Endpoint.
System namespace.