// -----------------------------------------------------------------------------
// USB Library "usblib"
// Target:  for lpc17xx
// Author:  Sychov A.
// Date:    12/10/2018
// Version: 1.0
// -----------------------------------------------------------------------------
// File:    USB-standard header
// Version: 1.0
// -----------------------------------------------------------------------------

#ifndef  _USBSPEC_H_
#define  _USBSPEC_H_

    #include <stdint.h>
    #include "usbd_def.h"

    #pragma pack( push, 1 )
    struct _USB_DESCRIPTOR_HEADER
    {
       uint8_t  bLength;
       uint8_t  bDescriptorType;
    };
    #pragma pack(pop)
    typedef struct _USB_DESCRIPTOR_HEADER sUSBDescriptorHeader_t;

    typedef USBD_SetupReqTypedef tUSBSetupPacket_t;

    //-- USB Standard Configuration Descriptor
    #pragma pack( push, 1 )
    struct _USB_CONFIGURATION_DESCRIPTOR
    {
       uint8_t  bLength;
       uint8_t  bDescriptorType;
       uint16_t wTotalLength;
       uint8_t  bNumInterfaces;
       uint8_t  bConfigurationValue;
       uint8_t  iConfiguration;
       uint8_t  bmAttributes;
       uint8_t  MaxPower;
    };
    typedef struct _USB_CONFIGURATION_DESCRIPTOR sUSBConfigurationDescriptor_t;
    #pragma pack(pop)

    //-- USB Standard Interface Descriptor
    #pragma pack( push, 1 )
    struct _USB_INTERFACE_DESCRIPTOR
    {
       uint8_t  bLength;
       uint8_t  bDescriptorType;
       uint8_t  bInterfaceNumber;
       uint8_t  bAlternateSetting;
       uint8_t  bNumEndpoints;
       uint8_t  bInterfaceClass;
       uint8_t  bInterfaceSubClass;
       uint8_t  bInterfaceProtocol;
       uint8_t  iInterface;
    };
    typedef struct _USB_INTERFACE_DESCRIPTOR sUSBInterfaceDescriptor_t;
    #pragma pack(pop)

    //-- USB Standard Endpoint Descriptor
    #pragma pack( push, 1 )
    struct _USB_ENDPOINT_DESCRIPTOR
    {
       uint8_t  bLength;
       uint8_t  bDescriptorType;
       uint8_t  bEndpointAddress;
       uint8_t  bmAttributes;
       uint16_t wMaxPacketSize;
       uint8_t  bInterval;
    };
    typedef struct _USB_ENDPOINT_DESCRIPTOR sUSBEndpointDescriptor_t;
    #pragma pack(pop)
      
    #define USB_LANG_EN   0x0409
    #define USB_LANG_RU   0x0419      
#endif


