Numworks Epsilon  1.4.1
Graphing Calculator Operating System
device_descriptor.h
Go to the documentation of this file.
1 #ifndef ION_DEVICE_USB_STACK_DEVICE_DESCRIPTOR_H
2 #define ION_DEVICE_USB_STACK_DEVICE_DESCRIPTOR_H
3 
4 #include "descriptor.h"
5 
6 namespace Ion {
7 namespace USB {
8 namespace Device {
9 
10 class DeviceDescriptor : public Descriptor {
11 public:
12  constexpr DeviceDescriptor(
13  uint16_t bcdUSB,
14  uint8_t bDeviceClass,
15  uint8_t bDeviceSubClass,
16  uint8_t bDeviceProtocol,
17  uint8_t bMaxPacketSize0,
18  uint16_t idVendor,
19  uint16_t idProduct,
20  uint16_t bcdDevice,
21  uint8_t iManufacturer,
22  uint8_t iProduct,
23  uint8_t iSerialNumber,
24  uint8_t bNumConfigurations) :
25  Descriptor(0x01),
26  m_bcdUSB(bcdUSB),
27  m_bDeviceClass(bDeviceClass),
28  m_bDeviceSubClass(bDeviceSubClass),
29  m_bDeviceProtocol(bDeviceProtocol),
30  m_bMaxPacketSize0(bMaxPacketSize0),
31  m_idVendor(idVendor),
32  m_idProduct(idProduct),
33  m_bcdDevice(bcdDevice),
34  m_iManufacturer(iManufacturer),
35  m_iProduct(iProduct),
36  m_iSerialNumber(iSerialNumber),
37  m_bNumConfigurations(bNumConfigurations)
38  {
39  }
40 protected:
41  void push(Channel * c) const override;
42  virtual uint8_t bLength() const override;
43 private:
44  uint16_t m_bcdUSB;
45  uint8_t m_bDeviceClass;
46  uint8_t m_bDeviceSubClass;
47  uint8_t m_bDeviceProtocol;
48  uint8_t m_bMaxPacketSize0;
49  uint16_t m_idVendor;
50  uint16_t m_idProduct;
51  uint16_t m_bcdDevice;
52  uint8_t m_iManufacturer;
53  uint8_t m_iProduct;
54  uint8_t m_iSerialNumber;
55  uint8_t m_bNumConfigurations;
56 };
57 
58 }
59 }
60 }
61 
62 #endif
unsigned short uint16_t
Definition: stdint.h:5
void push(Channel *c) const override
unsigned char uint8_t
Definition: stdint.h:4
c(generic_all_nodes)
virtual uint8_t bLength() const override
Definition: app.cpp:5
constexpr DeviceDescriptor(uint16_t bcdUSB, uint8_t bDeviceClass, uint8_t bDeviceSubClass, uint8_t bDeviceProtocol, uint8_t bMaxPacketSize0, uint16_t idVendor, uint16_t idProduct, uint16_t bcdDevice, uint8_t iManufacturer, uint8_t iProduct, uint8_t iSerialNumber, uint8_t bNumConfigurations)
Definition: backlight.h:6