µ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
36
namespace
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
66
constexpr
endpoint_t
ENDPOINT_NUMBER_MASK
= 0x0F;
67
constexpr
endpoint_t
ENDPOINT_DIRECTION_MASK
= 0x80;
68
69
// ----------------------------------------------------------------------
70
71
using
endpoint_type_t
= uint8_t;
72
76
enum class
Endpoint_type
:
endpoint_type_t
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
94
constexpr
packet_size_t
ENDPOINT_MAX_PACKET_SIZE_MASK
= 0x07FF;
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_ */
os::driver::usb::speed_t
uint8_t speed_t
Definition
usb.h:45
os::driver::usb::endpoint_t
uint8_t endpoint_t
Definition
usb.h:64
os::driver::usb::pipe_t
uint32_t pipe_t
Definition
usb.h:102
os::driver::usb::ENDPOINT_MAX_PACKET_SIZE_MASK
constexpr packet_size_t ENDPOINT_MAX_PACKET_SIZE_MASK
Definition
usb.h:94
os::driver::usb::hub_addr_t
uint8_t hub_addr_t
Definition
usb.h:105
os::driver::usb::Speed
Speed
USB Speed.
Definition
usb.h:51
os::driver::usb::Speed::low
@ low
Low-speed USB.
os::driver::usb::Speed::high
@ high
High-speed USB.
os::driver::usb::Speed::full
@ full
Full-speed USB.
os::driver::usb::ENDPOINT_DIRECTION_MASK
constexpr endpoint_t ENDPOINT_DIRECTION_MASK
Definition
usb.h:67
os::driver::usb::device_address_t
uint8_t device_address_t
Definition
usb.h:99
os::driver::usb::endpoint_type_t
uint8_t endpoint_type_t
Definition
usb.h:71
os::driver::usb::packet_size_t
uint16_t packet_size_t
Definition
usb.h:92
os::driver::usb::port_t
uint8_t port_t
Definition
usb.h:103
os::driver::usb::ENDPOINT_NUMBER_MASK
constexpr endpoint_t ENDPOINT_NUMBER_MASK
Definition
usb.h:66
os::driver::usb::polling_interval_t
uint8_t polling_interval_t
Definition
usb.h:108
os::driver::usb::hub_port_t
uint8_t hub_port_t
Definition
usb.h:106
os::driver::usb::frame_number_t
uint16_t frame_number_t
Definition
usb.h:97
os::driver::usb::Endpoint_type
Endpoint_type
Endpoint type.
Definition
usb.h:77
os::driver::usb::Endpoint_type::bulk
@ bulk
Bulk Endpoint.
os::driver::usb::Endpoint_type::isochronous
@ isochronous
Isochronous Endpoint.
os::driver::usb::Endpoint_type::interrupt
@ interrupt
Interrupt Endpoint.
os::driver::usb::Endpoint_type::control
@ control
Control Endpoint.
os
System namespace.
include
cmsis-plus
driver
usb.h
Generated by
1.9.7