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