µ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
37
namespace
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
70
constexpr
endpoint_t
ENDPOINT_NUMBER_MASK
= 0x0F;
71
constexpr
endpoint_t
ENDPOINT_DIRECTION_MASK
= 0x80;
72
73
// --------------------------------------------------------------------
74
75
using
endpoint_type_t
= uint8_t;
76
80
enum class
Endpoint_type
81
:
endpoint_type_t
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
101
constexpr
packet_size_t
ENDPOINT_MAX_PACKET_SIZE_MASK
= 0x07FF;
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_ */
os::driver::usb::speed_t
uint8_t speed_t
Definition
usb.h:46
os::driver::usb::endpoint_t
uint8_t endpoint_t
Definition
usb.h:68
os::driver::usb::pipe_t
uint32_t pipe_t
Definition
usb.h:109
os::driver::usb::ENDPOINT_MAX_PACKET_SIZE_MASK
constexpr packet_size_t ENDPOINT_MAX_PACKET_SIZE_MASK
Definition
usb.h:101
os::driver::usb::hub_addr_t
uint8_t hub_addr_t
Definition
usb.h:112
os::driver::usb::Speed
Speed
USB Speed.
Definition
usb.h:53
os::driver::usb::Speed::low
@ low
Low-speed USB.
os::driver::usb::Speed::high
@ high
os::driver::usb::Speed::full
@ full
High-speed USB.
os::driver::usb::ENDPOINT_DIRECTION_MASK
constexpr endpoint_t ENDPOINT_DIRECTION_MASK
Definition
usb.h:71
os::driver::usb::device_address_t
uint8_t device_address_t
Definition
usb.h:106
os::driver::usb::endpoint_type_t
uint8_t endpoint_type_t
Definition
usb.h:75
os::driver::usb::packet_size_t
uint16_t packet_size_t
Definition
usb.h:99
os::driver::usb::port_t
uint8_t port_t
Definition
usb.h:110
os::driver::usb::ENDPOINT_NUMBER_MASK
constexpr endpoint_t ENDPOINT_NUMBER_MASK
Definition
usb.h:70
os::driver::usb::polling_interval_t
uint8_t polling_interval_t
Definition
usb.h:115
os::driver::usb::hub_port_t
uint8_t hub_port_t
Definition
usb.h:113
os::driver::usb::frame_number_t
uint16_t frame_number_t
Definition
usb.h:104
os::driver::usb::Endpoint_type
Endpoint_type
Endpoint type.
Definition
usb.h:82
os::driver::usb::Endpoint_type::bulk
@ bulk
Interrupt Endpoint.
os::driver::usb::Endpoint_type::isochronous
@ isochronous
Bulk Endpoint.
os::driver::usb::Endpoint_type::interrupt
@ interrupt
os::driver::usb::Endpoint_type::control
@ control
Control Endpoint.
os
System namespace.
include
cmsis-plus
driver
usb.h
Generated by
1.9.7