µ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-2023 Liviu Ionescu. All rights reserved.
5 * Copyright (c) 2013-2014 ARM Ltd.
6 *
7 * Permission to use, copy, modify, and/or distribute this software
8 * for any purpose is hereby granted, under the terms of the MIT license.
9 *
10 * If a copy of the license was not distributed with this file, it can
11 * be obtained from https://opensource.org/licenses/mit/.
12 */
13
14/*
15 * The code is inspired by ARM CMSIS Driver_USB.h file, v2.00,
16 * and tries to remain functionally close to the CMSIS specifications.
17 */
18
19#ifndef CMSIS_PLUS_DRIVER_USB_H_
20#define CMSIS_PLUS_DRIVER_USB_H_
21
22// ----------------------------------------------------------------------------
23
24#ifdef __cplusplus
25
26// ----------------------------------------------------------------------------
27
28#include <cstdint>
29
30#pragma GCC diagnostic push
31#if defined(__clang__)
32#pragma clang diagnostic ignored "-Wc++98-compat"
33#endif
34
35// ----------------------------------------------------------------------------
36
37namespace os
38{
39 namespace driver
40 {
41 namespace usb
42 {
43
44 // --------------------------------------------------------------------
45
46 using speed_t = uint8_t;
47
51 enum class Speed
52 : speed_t
53 {
54 //
55
57 low = 0,
58
60 full = 1,
61
63 high = 2,
64 };
65
66 // --------------------------------------------------------------------
67
68 using endpoint_t = uint8_t;
69
72
73 // --------------------------------------------------------------------
74
75 using endpoint_type_t = uint8_t;
76
80 enum class Endpoint_type
82 {
83 //
84
86 control = 0,
87
89 isochronous = 1,
90
92 bulk = 2,
93
95 interrupt = 3
96 };
97
98 // --------------------------------------------------------------------
99 using packet_size_t = uint16_t;
100
102
103 // --------------------------------------------------------------------
104 using frame_number_t = uint16_t;
105
106 using device_address_t = uint8_t;
107
108 //using ARM_USBH_PIPE_HANDLE = uint32_t;
109 using pipe_t = uint32_t;
110 using port_t = uint8_t;
111
112 using hub_addr_t = uint8_t;
113 using hub_port_t = uint8_t;
114
115 using polling_interval_t = uint8_t;
116
117 } /* namespace usb */
118 } /* namespace driver */
119} /* namespace os */
120
121#pragma GCC diagnostic pop
122
123// ----------------------------------------------------------------------------
124
125#endif /* __cplusplus */
126
127// ----------------------------------------------------------------------------
128
129#endif /* CMSIS_PLUS_DRIVER_USB_H_ */
uint8_t speed_t
Definition usb.h:46
uint8_t endpoint_t
Definition usb.h:68
uint32_t pipe_t
Definition usb.h:109
constexpr packet_size_t ENDPOINT_MAX_PACKET_SIZE_MASK
Definition usb.h:101
uint8_t hub_addr_t
Definition usb.h:112
Speed
USB Speed.
Definition usb.h:53
@ low
Low-speed USB.
@ full
High-speed USB.
constexpr endpoint_t ENDPOINT_DIRECTION_MASK
Definition usb.h:71
uint8_t device_address_t
Definition usb.h:106
uint8_t endpoint_type_t
Definition usb.h:75
uint16_t packet_size_t
Definition usb.h:99
uint8_t port_t
Definition usb.h:110
constexpr endpoint_t ENDPOINT_NUMBER_MASK
Definition usb.h:70
uint8_t polling_interval_t
Definition usb.h:115
uint8_t hub_port_t
Definition usb.h:113
uint16_t frame_number_t
Definition usb.h:104
Endpoint_type
Endpoint type.
Definition usb.h:82
@ bulk
Interrupt Endpoint.
@ control
Control Endpoint.
System namespace.