Numworks Epsilon
1.4.1
Graphing Calculator Operating System
setup_packet.h
Go to the documentation of this file.
1
#ifndef ION_DEVICE_USB_SETUP_PACKET_H
2
#define ION_DEVICE_USB_SETUP_PACKET_H
3
4
#include <
stdint.h
>
5
6
namespace
Ion
{
7
namespace
USB
{
8
namespace
Device {
9
10
class
SetupPacket
{
11
public
:
12
enum class
TransactionType
{
13
SetupTransaction
,
14
InTransaction
,
15
OutTransaction
16
};
17
18
enum class
RequestType
{
19
Standard
= 0,
20
Class
= 1,
21
Vendor
= 2
22
};
23
24
enum class
RecipientType
{
25
Device
= 0,
26
Interface
= 1,
27
Endpoint
= 2,
28
Other
= 3
29
};
30
31
constexpr
SetupPacket
() :
32
m_bmRequestType(0),
33
m_bRequest(0),
34
m_wValue(0),
35
m_wIndex(0),
36
m_wLength(0)
37
{
38
}
39
40
SetupPacket
(
void
* buffer);
41
TransactionType
followingTransaction
()
const
;
42
RequestType
requestType
()
const
;
43
RecipientType
recipientType
()
const
;
44
int
descriptorIndex
();
45
int
descriptorType
();
46
uint8_t
bmRequestType
() {
return
m_bmRequestType; }
47
uint8_t
bRequest
() {
return
m_bRequest; }
48
uint16_t
wValue
() {
return
m_wValue; }
49
uint16_t
wIndex
() {
return
m_wIndex; }
50
uint16_t
wLength
() {
return
m_wLength; }
51
private
:
52
uint8_t
m_bmRequestType;
53
uint8_t
m_bRequest;
54
uint16_t
m_wValue;
55
uint16_t
m_wIndex;
56
uint16_t
m_wLength;
57
};
58
59
static_assert(
sizeof
(SetupPacket) == 8,
"SetupData must be packed"
);
60
61
}
62
}
63
}
64
65
#endif
Ion::USB::Device::SetupPacket
Definition:
setup_packet.h:10
Ion::USB::Device::Interface
Definition:
interface.h:12
Ion::USB::Device::SetupPacket::SetupPacket
constexpr SetupPacket()
Definition:
setup_packet.h:31
uint16_t
unsigned short uint16_t
Definition:
stdint.h:5
Ion::USB::Device::SetupPacket::RecipientType::Endpoint
uint8_t
unsigned char uint8_t
Definition:
stdint.h:4
Ion::USB::Device::SetupPacket::descriptorIndex
int descriptorIndex()
Definition:
setup_packet.cpp:28
Ion::USB::Device::SetupPacket::RequestType::Standard
Ion::USB::Device::SetupPacket::descriptorType
int descriptorType()
Definition:
setup_packet.cpp:32
Ion::USB::Device::SetupPacket::TransactionType::SetupTransaction
Ion::USB::Device::SetupPacket::wLength
uint16_t wLength()
Definition:
setup_packet.h:50
Ion::USB::Device::SetupPacket::TransactionType::OutTransaction
Ion::USB::Device::SetupPacket::wIndex
uint16_t wIndex()
Definition:
setup_packet.h:49
USB
Definition:
app.cpp:5
Ion::USB::Device::SetupPacket::followingTransaction
TransactionType followingTransaction() const
Definition:
setup_packet.cpp:12
Ion::USB::Device::SetupPacket::recipientType
RecipientType recipientType() const
Definition:
setup_packet.cpp:24
Ion::USB::Device::SetupPacket::RequestType::Class
Ion::USB::Device::Device
Definition:
device.h:15
Ion::USB::Device::SetupPacket::TransactionType::InTransaction
Ion::USB::Device::SetupPacket::TransactionType
TransactionType
Definition:
setup_packet.h:12
stdint.h
Ion::USB::Device::SetupPacket::bmRequestType
uint8_t bmRequestType()
Definition:
setup_packet.h:46
Ion::USB::Device::SetupPacket::RequestType::Vendor
Ion::USB::Device::SetupPacket::bRequest
uint8_t bRequest()
Definition:
setup_packet.h:47
Ion::USB::Device::SetupPacket::RecipientType::Other
Ion::USB::Device::SetupPacket::requestType
RequestType requestType() const
Definition:
setup_packet.cpp:20
Ion::USB::Device::SetupPacket::RecipientType
RecipientType
Definition:
setup_packet.h:24
Ion::USB::Device::SetupPacket::wValue
uint16_t wValue()
Definition:
setup_packet.h:48
Ion
Definition:
backlight.h:6
Ion::USB::Device::SetupPacket::RequestType
RequestType
Definition:
setup_packet.h:18
epsilon
ion
src
device
usb
setup_packet.h
Generated by
1.8.14