MSP430F5529: MSP430 USB HID for windows brightness control

Part Number: MSP430F5529
Other Parts Discussed in Thread: MSP430WARE

Tool/software:

We are implementing USB keyboard using MSP430F5529. The keyboard has two keys for Brightness UP and Brightness Down to control Windows brightness for LCD.

Usage IDs are obtained from below link

https://learn.microsoft.com/en-us/windows-hardware/drivers/hid/display-brightness-control

After adding HEX values in keyboard.h file in the project, we are not getting brightness control.

Pls suggest how to implement.

  • Add comments from microsoft website:

    Troubleshooting common errors
    Tip #1: Brightness increment/decrement HID usages only operate only on Mobile systems (battery powered) and require Windows 8.
    
    Tip #2: If the system is attached to an external monitor, the brightness increment/decrement will not function as legacy monitor transports do not support the ability to channel HID messages to them / from them.

     Note
    
     These HID usages operate only on mobile systems (battery powered) and require Windows 8.

    After adding HEX values in keyboard.h file in the project, we are not getting brightness control.

    Pls suggest how to implement.

    Some comments from MCU side:

    First, need to confirm what's USB message need to send.

    Any SDK or protocol reference?

    ----------------------------------------------------

    Here are the comment steps to create a HID device with MSP430:

    1. Create a HID report descriptor array following https://learn.microsoft.com/en-us/windows-hardware/drivers/hid/display-brightness-control description.

    2. Config MSP430 as a HID device.

    3. Add GPIO interrupt detection.

    C:\ti\MSP430Ware_3_80_14_01\examples\devices\MSP430F5xx_6xx\MSP430F55xx_Code_Examples\C

    MSP430F55xx_P1_02.c

    4. Report to windows when detect GPIO key is pressed.

    -------------------------------------------------

    Some debug comments here:

    1. When plug in USB, find MSP430 HID device in windows' device manager.

    2. Test GPIO button detection function, make sure you can entering GPIO interrupt first. (In MSP430 debug mode)

    3. Test USB message (You can use some HID Debug Tool to monitor the report message from MSP430.)

    For the usage of MSP430 device, please refer to

    C:/ti/MSP430Ware_3_80_14_01/usblib430/release_notes.html

    There are HID device guidance in this document.

  • Hi Helic,

    All the alpha numeric keys are working correctly, is there something to change to enable brightness control keys in terms of interrupt?

    Firstly, can you share a sample of the HID report descriptor array - 

    Usage Page (Consumer)
    Usage (Consumer Control)
    Collection (Application)
    Logical Minimum (0x00)
    Logical Maximum (0x3FF)
    Usage Minimum (0x00)
    Usage Maximum (0x3FF)
    Report Size (16)
    Report Count (1)
    Input (Data, Array, Absolute)
    End Collection

    3. Add GPIO interrupt detection.

    Using Polling mode to detect keys. As there are only few keys
    C:\ti\MSP430Ware_3_80_14_01\examples\devices\MSP430F5xx_6xx\MSP430F55xx_Code_Examples\C
    MSP430F55xx_P1_02.c

    Best Regards,

    Madhurya 

  • Please refer to this document: https://www.ti.com/lit/an/slaa514/slaa514.pdf

    There are HID device example in this doc's code.

    Src\USB_config\descriptors.c

  • Are you referring to this document - usbkbd_430FW_1_1.zip

  • Yes, there are HID implement example in it.

  • Hi Helic,
    Is this the implementation for brightness control in desktop?

    BYTE const report_desc_HID0[]=
    {
        0x05, 0x01, 	                	// Usage Page (Generic Desktop)
        0x09, 0x06,		                // Usage (Keyboard)
        0xA1, 0x01,		                // Collection (Application)
        0x05, 0x07,		                // Usage Page (Key Codes)
        0x19, 0xE0,		                // Usage Minimum (224)
        0x29, 0xE7,		                // Usage Maximum (231)
        0x15, 0x00,		                // Logical Minimum (0)
        0x25, 0x01,		                // Logical Maximum (1)
        0x75, 0x01,		                // Report Size (1)
        0x95, 0x08,		                // Report Count (8)
        0x81, 0x02,		                // Input (Data, Variable, Absolute) -- Modifier byte
        0x95, 0x01,		                // Report Count (1)
        0x75, 0x08,	 	                // Report Size (8)
        0x81, 0x03,		 				// (81 01) Input (Constant) -- Reserved byte
        0x95, 0x05,		  				// Report Count (5)
        0x75, 0x01,						// Report Size (1)
        0x05, 0x08,						// Usage Page (Page# for LEDs)
        0x19, 0x01,						// Usage Minimum (1)
        0x29, 0x05,						// Usage Maximum (5)
        0x91, 0x02,						// Output (Data, Variable, Absolute) -- LED report
        0x95, 0x01,						// Report Count (1)
        0x75, 0x03,						// Report Size (3)
        0x91, 0x03,						// (91 03) Output (Constant) -- LED report padding
        0x95, 0x06,						// Report Count (6)
        0x75, 0x08,						// Report Size (8)
        0x15, 0x00,						// Logical Minimum (0)
        0x25, 0x66,						// Logical Maximum(102)  // was 0x65
        0x05, 0x07,						// Usage Page (Key Codes)
        0x19, 0x00,						// Usage Minimum (0)
        0x29, 0x66,						// Usage Maximum (102) // was 0x65
        0x81, 0x00,						// Input (Data, Array) -- Key arrays (6 bytes)
        0xC0								// End Collection
    };
    BYTE const report_desc_HID1[]=
    {
        0x06, 0x00, 0xff,	// Usage Page (Vendor Defined)
        0x09, 0x01,	// Usage Page (Vendor Defined)
        0xa1, 0x01,	// COLLECTION (Application)
        0x85, 0x3f,	// Report ID (Vendor Defined)
        0x95, MAX_PACKET_SIZE-1,	// Report Count
        0x75, 0x08,	// Report Size
        0x25, 0x01,	// Usage Maximum
        0x15, 0x01,	// Usage Minimum
        0x09, 0x01,	// Vendor Usage
        0x81, 0x02,	// Input (Data,Var,Abs)
        0x85, 0x3f,	// Report ID (Vendor Defined)
        0x95, MAX_PACKET_SIZE-1,	// Report Count
        0x75, 0x08,	// Report Size
        0x25, 0x01,	// Usage Maximum
        0x15, 0x01,	// Usage Minimum
        0x09, 0x01,	// Vendor Usage
        0x91 ,0x02,	// Ouput (Data,Var,Abs)
        0xc0	// end Application Collection

  • This should be in MSP430's USB descritor.x file.

    Please refer to these content to add customer's brightness control HID descriptor.

    Anyway, all the USB HID related thing can be found in this project.

  • Hi Helic,

    I downloaded https://www.ti.com/tool/MSP430USBDEVPACK tool to generated the attached file. What are the next steps after this? 

    /* --COPYRIGHT--,BSD
     * Copyright (c) 2015, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     * --/COPYRIGHT--*/
    
    
    // Generated by MSP USB Descriptor Tool: Mon Sep 01 19:10:18 IST 2025
    
    /*-----------------------------------------------------------------------------+
    | Include files 
    |-----------------------------------------------------------------------------*/
    #include <USB_API/USB_Common/device.h>
    #include <USB_API/USB_Common/defMSP430USB.h>
    #include <USB_API/USB_Common/usb.h>              // USB-specific Data Structures
    #include "descriptors.h"
    #include <USB_API/USB_CDC_API/UsbCdc.h>
    #include <USB_API/USB_HID_API/UsbHidReq.h>
    
    uint16_t const report_desc_size[HID_NUM_INTERFACES] =
    {
        63,
        36
    };
    uint8_t const report_len_input[HID_NUM_INTERFACES] =
    {
        8,
        64
    };
    
    /*-----------------------------------------------------------------------------+
    | Device Descriptor 
    |-----------------------------------------------------------------------------*/
    uint8_t const abromDeviceDescriptor[SIZEOF_DEVICE_DESCRIPTOR] = {
        SIZEOF_DEVICE_DESCRIPTOR,               // Length of this descriptor
        DESC_TYPE_DEVICE,                       // Type code of this descriptor
        0x00, 0x02,                             // Release of USB spec
        0x00,                                   // Device's base class code
        0x00,                                   // Device's sub class code
        0x00,                                   // Device's protocol type code
        EP0_PACKET_SIZE,                        // End point 0's packet size
        USB_VID&0xFF, USB_VID>>8,               // Vendor ID for device, TI=0x0451
                                                // You can order your own VID at www.usb.org"
        USB_PID&0xFF, USB_PID>>8,               // Product ID for device,
                                                // this ID is to only with this example
        VER_FW_L, VER_FW_H,                     // Revision level of device
        1,                                      // Index of manufacturer name string desc
        2,                                      // Index of product name string desc
        USB_STR_INDEX_SERNUM,                   // Index of serial number string desc
        1                                       //  Number of configurations supported
    };
    
    /*-----------------------------------------------------------------------------+
    | Configuration Descriptor                                                     |
    |-----------------------------------------------------------------------------*/
    const struct abromConfigurationDescriptorGroup abromConfigurationDescriptorGroup=
    {
        /* Generic part */
        {
            // CONFIGURATION DESCRIPTOR (9 bytes)
            SIZEOF_CONFIG_DESCRIPTOR,                          // bLength
            DESC_TYPE_CONFIG,                                  // bDescriptorType
            DESCRIPTOR_TOTAL_LENGTH, 0x00,                     // wTotalLength
            USB_NUM_INTERFACES,                                // bNumInterfaces
            USB_CONFIG_VALUE,                                  // bConfigurationvalue
            CONFIG_STRING_INDEX,                               // iConfiguration Description offset
            USB_SUPPORT_SELF_POWERED | USB_SUPPORT_REM_WAKE,   // bmAttributes, bus power, remote wakeup
            USB_MAX_POWER                                      // Max. Power Consumption
        },
        /******************************************************* start of HID*************************************/
        {
        /*start HID[0] Here */
            {
                //-------- Descriptor for HID class device -------------------------------------
                // INTERFACE DESCRIPTOR (9 bytes)
                SIZEOF_INTERFACE_DESCRIPTOR,        // bLength
                DESC_TYPE_INTERFACE,                // bDescriptorType: 4
                HID0_REPORT_INTERFACE,              // bInterfaceNumber
                0x00,                               // bAlternateSetting
                2,                                  // bNumEndpoints
                0x03,                               // bInterfaceClass: 3 = HID Device
                1,                                  // bInterfaceSubClass:
                1,                                  // bInterfaceProtocol:
                INTF_STRING_INDEX + 0,              // iInterface:1
    
                // HID DESCRIPTOR (9 bytes)
                0x09,                                 // bLength of HID descriptor
                0x21,                                 // HID Descriptor Type: 0x21
                0x01,0x01,                            // HID Revision number 1.01
                0x00,                                // Target country, nothing specified (00h)
                0x01,                                // Number of HID classes to follow
                0x22,                                // Report descriptor type
                (report_desc_size_HID0 & 0x0ff),  // Total length of report descriptor
                (report_desc_size_HID0  >> 8),
    
                SIZEOF_ENDPOINT_DESCRIPTOR,         // bLength
                DESC_TYPE_ENDPOINT,                 // bDescriptorType
                HID0_INEP_ADDR,                     // bEndpointAddress; bit7=1 for IN, bits 3-0=1 for ep1
                EP_DESC_ATTR_TYPE_INT,              // bmAttributes, interrupt transfers
                0x40, 0x00,                         // wMaxPacketSize, 64 bytes
                15,                                  // bInterval, ms
    
                SIZEOF_ENDPOINT_DESCRIPTOR,         // bLength
                DESC_TYPE_ENDPOINT,                 // bDescriptorType
                HID0_OUTEP_ADDR,                    // bEndpointAddress; bit7=1 for IN, bits 3-0=1 for ep1
                EP_DESC_ATTR_TYPE_INT,              // bmAttributes, interrupt transfers
                0x40, 0x00,                         // wMaxPacketSize, 64 bytes
                15,                                  // bInterval, ms
                /* end of HID[0]*/
            },
    
        /*start HID[1] Here */
            {
                //-------- Descriptor for HID class device -------------------------------------
                // INTERFACE DESCRIPTOR (9 bytes)
                SIZEOF_INTERFACE_DESCRIPTOR,        // bLength
                DESC_TYPE_INTERFACE,                // bDescriptorType: 4
                HID1_REPORT_INTERFACE,              // bInterfaceNumber
                0x00,                               // bAlternateSetting
                2,                                  // bNumEndpoints
                0x03,                               // bInterfaceClass: 3 = HID Device
                0,                                  // bInterfaceSubClass:
                0,                                  // bInterfaceProtocol:
                INTF_STRING_INDEX + 1,              // iInterface:1
    
                // HID DESCRIPTOR (9 bytes)
                0x09,                                 // bLength of HID descriptor
                0x21,                                 // HID Descriptor Type: 0x21
                0x01,0x01,                            // HID Revision number 1.01
                0x00,                                // Target country, nothing specified (00h)
                0x01,                                // Number of HID classes to follow
                0x22,                                // Report descriptor type
                (report_desc_size_HID1 & 0x0ff),  // Total length of report descriptor
                (report_desc_size_HID1  >> 8),
    
                SIZEOF_ENDPOINT_DESCRIPTOR,         // bLength
                DESC_TYPE_ENDPOINT,                 // bDescriptorType
                HID1_INEP_ADDR,                     // bEndpointAddress; bit7=1 for IN, bits 3-0=1 for ep1
                EP_DESC_ATTR_TYPE_INT,              // bmAttributes, interrupt transfers
                0x40, 0x00,                         // wMaxPacketSize, 64 bytes
                1,                                  // bInterval, ms
    
                SIZEOF_ENDPOINT_DESCRIPTOR,         // bLength
                DESC_TYPE_ENDPOINT,                 // bDescriptorType
                HID1_OUTEP_ADDR,                    // bEndpointAddress; bit7=1 for IN, bits 3-0=1 for ep1
                EP_DESC_ATTR_TYPE_INT,              // bmAttributes, interrupt transfers
                0x40, 0x00,                         // wMaxPacketSize, 64 bytes
                1,                                  // bInterval, ms
                /* end of HID[1]*/
            }
    
        }    /******************************************************* end of HID**************************************/
    
        
            
                
    };
    
    /*-----------------------------------------------------------------------------+
    | String Descriptor                                                            |
    |-----------------------------------------------------------------------------*/
    uint8_t const abromStringDescriptor[] = {
        // String index0, language support
    
        4,        // Length of language descriptor ID
        3,        // LANGID tag
        0x09, 0x04,    // 0x0409 for English
    
    
        // String index1, Manufacturer
    
        36,        // Length of this string descriptor
        3,        // bDescriptorType
        'T',0x00,'e',0x00,'x',0x00,'a',0x00,'s',0x00,' ',0x00,
        'I',0x00,'n',0x00,'s',0x00,'t',0x00,'r',0x00,'u',0x00,
        'm',0x00,'e',0x00,'n',0x00,'t',0x00,'s',0x00,
    
        // String index2, Product
    
        38,        // Length of this string descriptor
        3,        // bDescriptorType
        'M',0x00,'S',0x00,'P',0x00,'4',0x00,'3',0x00,'0',0x00,
        '-',0x00,'U',0x00,'S',0x00,'B',0x00,' ',0x00,'E',0x00,
        'x',0x00,'a',0x00,'m',0x00,'p',0x00,'l',0x00,'e',0x00,
    
        // String index3, Serial Number
    
        4,        // Length of this string descriptor
        3,        // bDescriptorType
        '0',0x00,
    
        // String index4, Configuration String
    
        22,        // Length of this string descriptor
        3,        // bDescriptorType
        'M',0x00,'S',0x00,'P',0x00,'4',0x00,'3',0x00,'0',0x00,
        ' ',0x00,'U',0x00,'S',0x00,'B',0x00,
    
    
        // String index5, Interface String
        28,        // Length of this string descriptor
        3,        // bDescriptorType
        'H',0x00,'I',0x00,'D',0x00,' ',0x00,'I',0x00,'n',0x00,
        't',0x00,'e',0x00,'r',0x00,'f',0x00,'a',0x00,'c',0x00,
        'e',0x00,
    
        // String index6, Interface String
        28,        // Length of this string descriptor
        3,        // bDescriptorType
        'H',0x00,'I',0x00,'D',0x00,' ',0x00,'I',0x00,'n',0x00,
        't',0x00,'e',0x00,'r',0x00,'f',0x00,'a',0x00,'c',0x00,
        'e',0x00
    };
    
    uint8_t const report_desc_HID0[]=
    {
        0x05, 0x01,                        // Usage Page (Generic Desktop)
        0x09, 0x06,                        // Usage (Keyboard)
        0xA1, 0x01,                        // Collection (Application)
        0x05, 0x07,                        // Usage Page (Key Codes)
        0x19, 0xE0,                        // Usage Minimum (224)
        0x29, 0xE7,                        // Usage Maximum (231)
        0x15, 0x00,                        // Logical Minimum (0)
        0x25, 0x01,                        // Logical Maximum (1)
        0x75, 0x01,                        // Report Size (1)
        0x95, 0x08,                        // Report Count (8)
        0x81, 0x02,                        // Input (Data, Variable, Absolute) -- Modifier byte
        0x95, 0x01,                        // Report Count (1)
        0x75, 0x08,                        // Report Size (8)
        0x81, 0x03,                        // (81 01) Input (Constant) -- Reserved byte
        0x95, 0x05,                        // Report Count (5)
        0x75, 0x01,                        // Report Size (1)
        0x05, 0x08,                        // Usage Page (Page# for LEDs)
        0x19, 0x01,                        // Usage Minimum (1)
        0x29, 0x05,                        // Usage Maximum (5)
        0x91, 0x02,                        // Output (Data, Variable, Absolute) -- LED report
        0x95, 0x01,                        // Report Count (1)
        0x75, 0x03,                        // Report Size (3)
        0x91, 0x03,                        // (91 03) Output (Constant) -- LED report padding
        0x95, 0x06,                        // Report Count (6)
        0x75, 0x08,                        // Report Size (8)
        0x15, 0x00,                        // Logical Minimum (0)
        0x25, 0x66,                        // Logical Maximum(102)  // was 0x65
        0x05, 0x07,                        // Usage Page (Key Codes)
        0x19, 0x00,                        // Usage Minimum (0)
        0x29, 0x66,                        // Usage Maximum (102) // was 0x65
        0x81, 0x00,                        // Input (Data, Array) -- Key arrays (6 bytes)
        0xC0                               // End Collection
    
    };
    uint8_t const report_desc_HID1[]=
    {
        0x06, 0x00, 0xff,    // Usage Page (Vendor Defined)
        0x09, 0x01,    // Usage Page (Vendor Defined)
        0xa1, 0x01,    // COLLECTION (Application)
        0x85, 0x3f,    // Report ID (Vendor Defined)
        0x95, MAX_PACKET_SIZE-1,    // Report Count
        0x75, 0x08,    // Report Size
        0x25, 0x01,    // Usage Maximum
        0x15, 0x01,    // Usage Minimum
        0x09, 0x01,    // Vendor Usage
        0x81, 0x02,    // Input (Data,Var,Abs)
        0x85, 0x3f,    // Report ID (Vendor Defined)
        0x95, MAX_PACKET_SIZE-1,    //Report Count
        0x75, 0x08,    // Report Size
        0x25, 0x01,    // Usage Maximum
        0x15, 0x01,    // Usage Minimum
        0x09, 0x01,    // Vendor Usage
        0x91 ,0x02,    // Ouput (Data,Var,Abs)
        0xc0    // end Application Collection
    
    };
    
    const uint8_t* report_desc[HID_NUM_INTERFACES] =
    {
        (uint8_t*)&report_desc_HID0,
        (uint8_t*)&report_desc_HID1
    };
    
    /**** Populating the endpoint information handle here ****/
    const struct tUsbHandle stUsbHandle[]=
    {
        {
            HID0_INEP_ADDR,
            HID0_OUTEP_ADDR,
            0,
            HID_CLASS,
            0,
            0,
            OEP1_X_BUFFER_ADDRESS,
            OEP1_Y_BUFFER_ADDRESS,
            IEP1_X_BUFFER_ADDRESS,
            IEP1_Y_BUFFER_ADDRESS
        },
        {
            HID1_INEP_ADDR,
            HID1_OUTEP_ADDR,
            1,
            HID_CLASS,
            0,
            0,
            OEP2_X_BUFFER_ADDRESS,
            OEP2_Y_BUFFER_ADDRESS,
            IEP2_X_BUFFER_ADDRESS,
            IEP2_Y_BUFFER_ADDRESS
        }
    
        
            
                
    };
    
    //-------------DEVICE REQUEST LIST---------------------------------------------
    
    const tDEVICE_REQUEST_COMPARE tUsbRequestList[] = 
    {
    
        {
            //---- HID 0 Class Requests -----//
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE,
                USB_REQ_GET_IDLE,
                0xff,0xff,
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xcc,&usbGetIdle,
        },
        {
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE,
                USB_REQ_SET_IDLE,
                0xff,0xFF,                          // bValueL is index and bValueH is type
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xcc,&usbSetIdle,
            },
            {
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE,
                USB_REQ_GET_PROTOCOL,
                0xff,0xff,
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xcc,&usbGetProtocol,
            },
            {
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE,
                USB_REQ_SET_PROTOCOL,
                0xff,0xFF,                          // bValueL is index and bValueH is type
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xcc,&usbSetProtocol,
                },
                {
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE,
    
                USB_REQ_GET_REPORT,
                0xff,0xff,
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xcc,&usbGetReport,
        },
        {
                // SET REPORT
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE,
                USB_REQ_SET_REPORT,
                0xff,0xFF,                          // bValueL is index and bValueH is type
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xcc,&usbSetReport,
        },
        {
                // GET REPORT DESCRIPTOR
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_INTERFACE,
                USB_REQ_GET_DESCRIPTOR,
                0xff,DESC_TYPE_REPORT,              // bValueL is index and bValueH is type
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xdc,&usbGetReportDescriptor,
        },
        {
                // GET HID DESCRIPTOR
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_INTERFACE,
                USB_REQ_GET_DESCRIPTOR,
                0xff,DESC_TYPE_HID,                 // bValueL is index and bValueH is type
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xdc,&usbGetHidDescriptor,
        },
        {
            //---- HID 1 Class Requests -----//
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE,
    
                USB_REQ_GET_REPORT,
                0xff,0xff,
                HID1_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xcc,&usbGetReport,
        },
        {
                // SET REPORT
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE,
                USB_REQ_SET_REPORT,
                0xff,0xFF,                          // bValueL is index and bValueH is type
                HID1_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xcc,&usbSetReport,
        },
        {
                // GET REPORT DESCRIPTOR
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_INTERFACE,
                USB_REQ_GET_DESCRIPTOR,
                0xff,DESC_TYPE_REPORT,              // bValueL is index and bValueH is type
                HID1_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xdc,&usbGetReportDescriptor,
        },
        {
                // GET HID DESCRIPTOR
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_INTERFACE,
                USB_REQ_GET_DESCRIPTOR,
                0xff,DESC_TYPE_HID,                 // bValueL is index and bValueH is type
                HID1_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xdc,&usbGetHidDescriptor,
        },
    
        {
            //---- USB Standard Requests -----//
                // clear device feature
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_CLEAR_FEATURE,
                FEATURE_REMOTE_WAKEUP,0x00,         // feature selector
                0x00,0x00,
                0x00,0x00,
                0xff,&usbClearDeviceFeature,
        },
        {
    
                // clear endpoint feature
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_ENDPOINT,
                USB_REQ_CLEAR_FEATURE,
                FEATURE_ENDPOINT_STALL,0x00,
                0xff,0x00,
                0x00,0x00,
                0xf7,&usbClearEndpointFeature,
        },
        {
                // get configuration
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_GET_CONFIGURATION,
                0x00,0x00, 
                0x00,0x00, 
                0x01,0x00,
                0xff,&usbGetConfiguration,
        },
        {
                // get device descriptor
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_GET_DESCRIPTOR,
                0xff,DESC_TYPE_DEVICE,              // bValueL is index and bValueH is type
                0xff,0xff,
                0xff,0xff,
                0xd0,&usbGetDeviceDescriptor,
        },
        {
                // get configuration descriptor
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_GET_DESCRIPTOR,
                0xff,DESC_TYPE_CONFIG,              // bValueL is index and bValueH is type
                0xff,0xff,
                0xff,0xff,
                0xd0,&usbGetConfigurationDescriptor,
        },
        {
                // get string descriptor
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_GET_DESCRIPTOR,
                0xff,DESC_TYPE_STRING,              // bValueL is index and bValueH is type
                0xff,0xff,
                0xff,0xff,
                0xd0,&usbGetStringDescriptor,
        },
        {
               // get interface
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_INTERFACE,
                USB_REQ_GET_INTERFACE,
                0x00,0x00,
                0xff,0xff,
                0x01,0x00,
                0xf3,&usbGetInterface,
        },
        {
                // get device status
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_GET_STATUS,
                0x00,0x00,
                0x00,0x00,
                0x02,0x00,
                0xff,&usbGetDeviceStatus, 
        },
        {
                // get interface status
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_INTERFACE,
                USB_REQ_GET_STATUS,
                0x00,0x00,
                0xff,0x00,
                0x02,0x00,
                0xf7,&usbGetInterfaceStatus,
        },
        {
                // get endpoint status
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_ENDPOINT,
                USB_REQ_GET_STATUS,
                0x00,0x00,
                0xff,0x00,
                0x02,0x00,
                0xf7,&usbGetEndpointStatus,
        },
        {
                // set address
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_SET_ADDRESS,
                0xff,0x00,
                0x00,0x00,
                0x00,0x00,
                0xdf,&usbSetAddress,
        },
        {
                // set configuration
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_SET_CONFIGURATION,
                0xff,0x00,
                0x00,0x00,
                0x00,0x00,
                0xdf,&usbSetConfiguration,
        },
        {
               // set device feature
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_SET_FEATURE,
                0xff,0x00,                      // feature selector
                0x00,0x00,
                0x00,0x00,
                0xdf,&usbSetDeviceFeature,
        },
        {
                // set endpoint feature
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_ENDPOINT,
                USB_REQ_SET_FEATURE,
                0xff,0x00,                      // feature selector
                0xff,0x00,                      // endpoint number <= 127
                0x00,0x00,
                0xd7,&usbSetEndpointFeature,
        },
        {
                // set interface
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_INTERFACE,
                USB_REQ_SET_INTERFACE,
                0xff,0x00,                      // feature selector
                0xff,0x00,                      // interface number
                0x00,0x00,
                0xd7,&usbSetInterface,
        },
        {
    
                // end of usb descriptor -- this one will be matched to any USB request
                // since bCompareMask is 0x00.
                0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 
                0x00,&usbInvalidRequest     // end of list
        }
    	
    };
    
    
    /*-----------------------------------------------------------------------------+
    | END OF Descriptor.c FILE
    |-----------------------------------------------------------------------------*/
    
    
    

  • Replace the same file name in USB keyboard example, or other USB HID code example.

  • H8_Keyboard.zip This is our code

  • There is a descriptors.c file in your keyboard project.

  • /* --COPYRIGHT--,BSD
     * Copyright (c) 2015, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     * --/COPYRIGHT--*/
    
    
    // Generated by MSP USB Descriptor Tool: Fri Jul 04 13:24:58 IST 2025
    
    /*-----------------------------------------------------------------------------+
    | Include files 
    |-----------------------------------------------------------------------------*/
    #include <USB_API/USB_Common/device.h>
    #include <USB_API/USB_Common/defMSP430USB.h>
    #include <USB_API/USB_Common/usb.h>              // USB-specific Data Structures
    #include "descriptors.h"
    #include <USB_API/USB_CDC_API/UsbCdc.h>
    #include <USB_API/USB_HID_API/UsbHidReq.h>
    
    uint16_t const report_desc_size[HID_NUM_INTERFACES] =
    {
        63
    };
    uint8_t const report_len_input[HID_NUM_INTERFACES] =
    {
        8
    };
    
    /*-----------------------------------------------------------------------------+
    | Device Descriptor 
    |-----------------------------------------------------------------------------*/
    uint8_t const abromDeviceDescriptor[SIZEOF_DEVICE_DESCRIPTOR] = {
        SIZEOF_DEVICE_DESCRIPTOR,               // Length of this descriptor
        DESC_TYPE_DEVICE,                       // Type code of this descriptor
        0x00, 0x02,                             // Release of USB spec
        0x00,                                   // Device's base class code
        0x00,                                   // Device's sub class code
        0x00,                                   // Device's protocol type code
        EP0_PACKET_SIZE,                        // End point 0's packet size
        USB_VID&0xFF, USB_VID>>8,               // Vendor ID for device, TI=0x0451
                                                // You can order your own VID at www.usb.org"
        USB_PID&0xFF, USB_PID>>8,               // Product ID for device,
                                                // this ID is to only with this example
        VER_FW_L, VER_FW_H,                     // Revision level of device
        1,                                      // Index of manufacturer name string desc
        2,                                      // Index of product name string desc
        USB_STR_INDEX_SERNUM,                   // Index of serial number string desc
        1                                       //  Number of configurations supported
    };
    
    /*-----------------------------------------------------------------------------+
    | Configuration Descriptor                                                     |
    |-----------------------------------------------------------------------------*/
    const struct abromConfigurationDescriptorGroup abromConfigurationDescriptorGroup=
    {
        /* Generic part */
        {
            // CONFIGURATION DESCRIPTOR (9 bytes)
            SIZEOF_CONFIG_DESCRIPTOR,                          // bLength
            DESC_TYPE_CONFIG,                                  // bDescriptorType
            DESCRIPTOR_TOTAL_LENGTH, 0x00,                     // wTotalLength
            USB_NUM_INTERFACES,                                // bNumInterfaces
            USB_CONFIG_VALUE,                                  // bConfigurationvalue
            CONFIG_STRING_INDEX,                               // iConfiguration Description offset
            USB_SUPPORT_SELF_POWERED | USB_SUPPORT_REM_WAKE,   // bmAttributes, bus power, remote wakeup
            USB_MAX_POWER                                      // Max. Power Consumption
        },
        /******************************************************* start of HID*************************************/
        {
        /*start HID[0] Here */
            {
                //-------- Descriptor for HID class device -------------------------------------
                // INTERFACE DESCRIPTOR (9 bytes)
                SIZEOF_INTERFACE_DESCRIPTOR,        // bLength
                DESC_TYPE_INTERFACE,                // bDescriptorType: 4
                HID0_REPORT_INTERFACE,              // bInterfaceNumber
                0x00,                               // bAlternateSetting
                2,                                  // bNumEndpoints
                0x03,                               // bInterfaceClass: 3 = HID Device
                1,                                  // bInterfaceSubClass:
                1,                                  // bInterfaceProtocol:
                INTF_STRING_INDEX + 0,              // iInterface:1
    
                // HID DESCRIPTOR (9 bytes)
                0x09,                                 // bLength of HID descriptor
                0x21,                                 // HID Descriptor Type: 0x21
                0x01,0x01,                            // HID Revision number 1.01
                0x00,                                // Target country, nothing specified (00h)
                0x01,                                // Number of HID classes to follow
                0x22,                                // Report descriptor type
                (report_desc_size_HID0 & 0x0ff),  // Total length of report descriptor
                (report_desc_size_HID0  >> 8),
    
                SIZEOF_ENDPOINT_DESCRIPTOR,         // bLength
                DESC_TYPE_ENDPOINT,                 // bDescriptorType
                HID0_INEP_ADDR,                     // bEndpointAddress; bit7=1 for IN, bits 3-0=1 for ep1
                EP_DESC_ATTR_TYPE_INT,              // bmAttributes, interrupt transfers
                0x40, 0x00,                         // wMaxPacketSize, 64 bytes
                15,                                  // bInterval, ms
    
                SIZEOF_ENDPOINT_DESCRIPTOR,         // bLength
                DESC_TYPE_ENDPOINT,                 // bDescriptorType
                HID0_OUTEP_ADDR,                    // bEndpointAddress; bit7=1 for IN, bits 3-0=1 for ep1
                EP_DESC_ATTR_TYPE_INT,              // bmAttributes, interrupt transfers
                0x40, 0x00,                         // wMaxPacketSize, 64 bytes
                15,                                  // bInterval, ms
                /* end of HID[0]*/
            }
    
        }    /******************************************************* end of HID**************************************/
    
        
            
                
    };
    
    /*-----------------------------------------------------------------------------+
    | String Descriptor                                                            |
    |-----------------------------------------------------------------------------*/
    uint8_t const abromStringDescriptor[] = {
        // String index0, language support
    
        4,        // Length of language descriptor ID
        3,        // LANGID tag
        0x09, 0x04,    // 0x0409 for English
    
    
        // String index1, Manufacturer
    
        36,        // Length of this string descriptor
        3,        // bDescriptorType
        'T',0x00,'e',0x00,'x',0x00,'a',0x00,'s',0x00,' ',0x00,
        'I',0x00,'n',0x00,'s',0x00,'t',0x00,'r',0x00,'u',0x00,
        'm',0x00,'e',0x00,'n',0x00,'t',0x00,'s',0x00,
    
        // String index2, Product
    
        38,        // Length of this string descriptor
        3,        // bDescriptorType
        'M',0x00,'S',0x00,'P',0x00,'4',0x00,'3',0x00,'0',0x00,
        '-',0x00,'U',0x00,'S',0x00,'B',0x00,' ',0x00,'E',0x00,
        'x',0x00,'a',0x00,'m',0x00,'p',0x00,'l',0x00,'e',0x00,
    
        // String index3, Serial Number
    
        4,        // Length of this string descriptor
        3,        // bDescriptorType
        '0',0x00,
    
        // String index4, Configuration String
    
        22,        // Length of this string descriptor
        3,        // bDescriptorType
        'M',0x00,'S',0x00,'P',0x00,'4',0x00,'3',0x00,'0',0x00,
        ' ',0x00,'U',0x00,'S',0x00,'B',0x00,
    
    
        // String index5, Interface String
        28,        // Length of this string descriptor
        3,        // bDescriptorType
        'H',0x00,'I',0x00,'D',0x00,' ',0x00,'I',0x00,'n',0x00,
        't',0x00,'e',0x00,'r',0x00,'f',0x00,'a',0x00,'c',0x00,
        'e',0x00
    };
    
    uint8_t const report_desc_HID0[]=
    {
        0x05, 0x01,                        // Usage Page (Generic Desktop)
        0x09, 0x06,                        // Usage (Keyboard)
        0xA1, 0x01,                        // Collection (Application)
        0x05, 0x07,                        // Usage Page (Key Codes)
        0x19, 0xE0,                        // Usage Minimum (224)
        0x29, 0xE7,                        // Usage Maximum (231)
        0x15, 0x00,                        // Logical Minimum (0)
        0x25, 0x01,                        // Logical Maximum (1)
        0x75, 0x01,                        // Report Size (1)
        0x95, 0x08,                        // Report Count (8)
        0x81, 0x02,                        // Input (Data, Variable, Absolute) -- Modifier byte
        0x95, 0x01,                        // Report Count (1)
        0x75, 0x08,                        // Report Size (8)
        0x81, 0x03,                        // (81 01) Input (Constant) -- Reserved byte
        0x95, 0x05,                        // Report Count (5)
        0x75, 0x01,                        // Report Size (1)
        0x05, 0x08,                        // Usage Page (Page# for LEDs)
        0x19, 0x01,                        // Usage Minimum (1)
        0x29, 0x05,                        // Usage Maximum (5)
        0x91, 0x02,                        // Output (Data, Variable, Absolute) -- LED report
        0x95, 0x01,                        // Report Count (1)
        0x75, 0x03,                        // Report Size (3)
        0x91, 0x03,                        // (91 03) Output (Constant) -- LED report padding
        0x95, 0x06,                        // Report Count (6)
        0x75, 0x08,                        // Report Size (8)
        0x15, 0x00,                        // Logical Minimum (0)
        0x25, 0x66,                        // Logical Maximum(102)  // was 0x65
        0x05, 0x07,                        // Usage Page (Key Codes)
        0x19, 0x00,                        // Usage Minimum (0)
        0x29, 0x66,                        // Usage Maximum (102) // was 0x65
        0x81, 0x00,                        // Input (Data, Array) -- Key arrays (6 bytes)
        0xC0                               // End Collection
    
    };
    
    const uint8_t* report_desc[HID_NUM_INTERFACES] =
    {
        (uint8_t*)&report_desc_HID0
    };
    
    /**** Populating the endpoint information handle here ****/
    const struct tUsbHandle stUsbHandle[]=
    {
        {
            HID0_INEP_ADDR,
            HID0_OUTEP_ADDR,
            0,
            HID_CLASS,
            0,
            0,
            OEP1_X_BUFFER_ADDRESS,
            OEP1_Y_BUFFER_ADDRESS,
            IEP1_X_BUFFER_ADDRESS,
            IEP1_Y_BUFFER_ADDRESS
        }
    
        
            
                
    };
    
    //-------------DEVICE REQUEST LIST---------------------------------------------
    
    const tDEVICE_REQUEST_COMPARE tUsbRequestList[] = 
    {
    
        {
            //---- HID 0 Class Requests -----//
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE,
                USB_REQ_GET_IDLE,
                0xff,0xff,
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xcc,&usbGetIdle,
        },
        {
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE,
                USB_REQ_SET_IDLE,
                0xff,0xFF,                          // bValueL is index and bValueH is type
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xcc,&usbSetIdle,
            },
            {
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE,
                USB_REQ_GET_PROTOCOL,
                0xff,0xff,
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xcc,&usbGetProtocol,
            },
            {
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE,
                USB_REQ_SET_PROTOCOL,
                0xff,0xFF,                          // bValueL is index and bValueH is type
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xcc,&usbSetProtocol,
                },
                {
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE,
    
                USB_REQ_GET_REPORT,
                0xff,0xff,
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xcc,&usbGetReport,
        },
        {
                // SET REPORT
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE,
                USB_REQ_SET_REPORT,
                0xff,0xFF,                          // bValueL is index and bValueH is type
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xcc,&usbSetReport,
        },
        {
                // GET REPORT DESCRIPTOR
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_INTERFACE,
                USB_REQ_GET_DESCRIPTOR,
                0xff,DESC_TYPE_REPORT,              // bValueL is index and bValueH is type
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xdc,&usbGetReportDescriptor,
        },
        {
                // GET HID DESCRIPTOR
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_INTERFACE,
                USB_REQ_GET_DESCRIPTOR,
                0xff,DESC_TYPE_HID,                 // bValueL is index and bValueH is type
                HID0_REPORT_INTERFACE,0x00,
                0xff,0xff,
                0xdc,&usbGetHidDescriptor,
        },
    
        {
            //---- USB Standard Requests -----//
                // clear device feature
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_CLEAR_FEATURE,
                FEATURE_REMOTE_WAKEUP,0x00,         // feature selector
                0x00,0x00,
                0x00,0x00,
                0xff,&usbClearDeviceFeature,
        },
        {
    
                // clear endpoint feature
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_ENDPOINT,
                USB_REQ_CLEAR_FEATURE,
                FEATURE_ENDPOINT_STALL,0x00,
                0xff,0x00,
                0x00,0x00,
                0xf7,&usbClearEndpointFeature,
        },
        {
                // get configuration
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_GET_CONFIGURATION,
                0x00,0x00, 
                0x00,0x00, 
                0x01,0x00,
                0xff,&usbGetConfiguration,
        },
        {
                // get device descriptor
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_GET_DESCRIPTOR,
                0xff,DESC_TYPE_DEVICE,              // bValueL is index and bValueH is type
                0xff,0xff,
                0xff,0xff,
                0xd0,&usbGetDeviceDescriptor,
        },
        {
                // get configuration descriptor
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_GET_DESCRIPTOR,
                0xff,DESC_TYPE_CONFIG,              // bValueL is index and bValueH is type
                0xff,0xff,
                0xff,0xff,
                0xd0,&usbGetConfigurationDescriptor,
        },
        {
                // get string descriptor
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_GET_DESCRIPTOR,
                0xff,DESC_TYPE_STRING,              // bValueL is index and bValueH is type
                0xff,0xff,
                0xff,0xff,
                0xd0,&usbGetStringDescriptor,
        },
        {
               // get interface
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_INTERFACE,
                USB_REQ_GET_INTERFACE,
                0x00,0x00,
                0xff,0xff,
                0x01,0x00,
                0xf3,&usbGetInterface,
        },
        {
                // get device status
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_GET_STATUS,
                0x00,0x00,
                0x00,0x00,
                0x02,0x00,
                0xff,&usbGetDeviceStatus, 
        },
        {
                // get interface status
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_INTERFACE,
                USB_REQ_GET_STATUS,
                0x00,0x00,
                0xff,0x00,
                0x02,0x00,
                0xf7,&usbGetInterfaceStatus,
        },
        {
                // get endpoint status
                USB_REQ_TYPE_INPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_ENDPOINT,
                USB_REQ_GET_STATUS,
                0x00,0x00,
                0xff,0x00,
                0x02,0x00,
                0xf7,&usbGetEndpointStatus,
        },
        {
                // set address
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_SET_ADDRESS,
                0xff,0x00,
                0x00,0x00,
                0x00,0x00,
                0xdf,&usbSetAddress,
        },
        {
                // set configuration
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_SET_CONFIGURATION,
                0xff,0x00,
                0x00,0x00,
                0x00,0x00,
                0xdf,&usbSetConfiguration,
        },
        {
               // set device feature
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE,
                USB_REQ_SET_FEATURE,
                0xff,0x00,                      // feature selector
                0x00,0x00,
                0x00,0x00,
                0xdf,&usbSetDeviceFeature,
        },
        {
                // set endpoint feature
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_ENDPOINT,
                USB_REQ_SET_FEATURE,
                0xff,0x00,                      // feature selector
                0xff,0x00,                      // endpoint number <= 127
                0x00,0x00,
                0xd7,&usbSetEndpointFeature,
        },
        {
                // set interface
                USB_REQ_TYPE_OUTPUT | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_INTERFACE,
                USB_REQ_SET_INTERFACE,
                0xff,0x00,                      // feature selector
                0xff,0x00,                      // interface number
                0x00,0x00,
                0xd7,&usbSetInterface,
        },
        {
    
                // end of usb descriptor -- this one will be matched to any USB request
                // since bCompareMask is 0x00.
                0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, 
                0x00,&usbInvalidRequest     // end of list
        }
    	
    };
    
    
    /*-----------------------------------------------------------------------------+
    | END OF Descriptor.c FILE
    |-----------------------------------------------------------------------------*/
    
    
    
    Newly generated from our hardware. But report descriptor for brightness as required by Windows is not found.

  • report_desc_HID0 give a example descriptor, you need to modify this report_desc_HID0, wo fit into your brightness descriptor.

    This document introduce how MSP430 HID device works with PC. https://www.ti.com/lit/an/slaa453a/slaa453a.pdf

**Attention** This is a public forum