MDK-ARM Keil, MDK-ARM Datasheet - Page 135

KIT REALVIEW MCU DEVELOPMENT

MDK-ARM

Manufacturer Part Number
MDK-ARM
Description
KIT REALVIEW MCU DEVELOPMENT
Manufacturer
Keil
Type
Compiler and IDEr
Datasheets

Specifications of MDK-ARM

For Use With/related Products
ARM MCUs
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Getting Started: Building Applications with RL-ARM
//
The Endpoint descriptor is added beneath the existing Endpoint 1 descriptor. We
must also make sure that the overall descriptor size reflects the addition of a new
Endpoint. This is done within the configuration descriptor as shown below.
USB_CONFIGURATION_DESC_SIZE
You must also adjust the number of Endpoints defined in the interface descriptor.
USB_INTERFACE_DESCRIPTOR_TYPE,
Once the additional Endpoint is defined, the HID driver will stop sending data as
set_report control transfers on Endpoint 0. It will then begin sending OUT
packets on Endpoint 1. Now we must add code to receive the new OUT packets
on Endpoint 1. Remember that the physical Endpoints are unidirectional, but
they are grouped as logical pairs. Each logical Endpoint has a physical IN
Endpoint and a physical OUT Endpoint.
void USB_EndPoint1 (DWORD event)
}
This now gives 64 byte IN and OUT packets, which are handled symmetrically
on logical Endpoint 1. The SetOutReport() and GetInReport() functions can now
be modified to read and write the application data into the new InReport[] and
OutReport[] arrays.
USB_ENDPOINT_DESC_SIZE,
USB_ENDPOINT_DESCRIPTOR_TYPE,
USB_ENDPOINT_OUT(1),
USB_ENDPOINT_TYPE_INTERRUPT,
WBVAL(0x0040),
0x20,
0x00,
0x00,
0x02,
switch (event)
}
Endpoint, HID Interrupt Out
USB_INTERFACE_DESC_SIZE
HID_DESC_SIZE
USB_ENDPOINT_DESC_SIZE
USB_ENDPOINT_DESC_SIZE
case USB_EVT_IN:
case USB_EVT_OUT:
GetInReport ();
USB_WriteEP (0x81, &InReport, sizeof (InReport));
break;
USB_ReadEP (0x01, &OutReport);
SetOutReport ();
break;
{
+
+
+
+
{
// bmAttributes
// wMaxPacketSize= 64
// EP1 IN
// New EP1 OUT descriptor
// bDescriptorType
// bInterfaceNumber
// bAlternateSetting
// bNumEndpoints
// bLength
// bDescriptorType
// bEndpointAddress
135

Related parts for MDK-ARM