Numworks Epsilon
1.4.1
Graphing Calculator Operating System
setup_packet.cpp
Go to the documentation of this file.
1
#include "
setup_packet.h
"
2
#include <string.h>
3
4
namespace
Ion
{
5
namespace
USB
{
6
namespace
Device {
7
8
SetupPacket::SetupPacket
(
void
* buffer) {
9
memcpy
(
this
, buffer,
sizeof
(
SetupPacket
));
10
}
11
12
SetupPacket::TransactionType
SetupPacket::followingTransaction
()
const
{
13
if
(m_wLength == 0 || (m_bmRequestType & 0b10000000) != 0) {
14
return
TransactionType::InTransaction
;
15
}
else
{
16
return
TransactionType::OutTransaction
;
17
}
18
}
19
20
SetupPacket::RequestType
SetupPacket::requestType
()
const
{
21
return
(
RequestType
) ((m_bmRequestType & 0b01100000) >> 5);
22
}
23
24
SetupPacket::RecipientType
SetupPacket::recipientType
()
const
{
25
return
(
RecipientType
) (m_bmRequestType & 0b00001111);
26
}
27
28
int
SetupPacket::descriptorIndex
() {
29
return
m_wValue & 0xFF;
30
}
31
32
int
SetupPacket::descriptorType
() {
33
return
m_wValue >> 8;
34
}
35
36
}
37
}
38
}
Ion::USB::Device::SetupPacket
Definition:
setup_packet.h:10
Ion::USB::Device::SetupPacket::SetupPacket
constexpr SetupPacket()
Definition:
setup_packet.h:31
Ion::USB::Device::SetupPacket::descriptorIndex
int descriptorIndex()
Definition:
setup_packet.cpp:28
Ion::USB::Device::SetupPacket::descriptorType
int descriptorType()
Definition:
setup_packet.cpp:32
Ion::USB::Device::SetupPacket::TransactionType::OutTransaction
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::TransactionType::InTransaction
Ion::USB::Device::SetupPacket::TransactionType
TransactionType
Definition:
setup_packet.h:12
Ion::USB::Device::SetupPacket::requestType
RequestType requestType() const
Definition:
setup_packet.cpp:20
Ion::USB::Device::SetupPacket::RecipientType
RecipientType
Definition:
setup_packet.h:24
setup_packet.h
Ion
Definition:
backlight.h:6
Ion::USB::Device::SetupPacket::RequestType
RequestType
Definition:
setup_packet.h:18
memcpy
void * memcpy(void *dst, const void *src, size_t n)
Definition:
memcpy.c:3
epsilon
ion
src
device
usb
setup_packet.cpp
Generated by
1.8.14