<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to see the output for usb example in lpc54628 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/how-to-see-the-output-for-usb-example-in-lpc54628/m-p/1204099#M43365</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Zhangjennie&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for your reply,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Demo code name and version of SDK are&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;name='SDK_2.x_LPCXpress54628'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;version='2.8.2'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;MCUXpresso IDE v11.2.0 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Example program name:dev_hid_mouse_bm and freertos too.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this was the program which i cannot get the ouput that the moving cursor on the pc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;example program description is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The USB HID mouse application is a simple demonstration program based on the MCUXpresso SDK.It is enumerated as a mouse. Users can see the mouse arrow moving on the PC screen according in a rectangular fashion.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanking You,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Karthikeyan J&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Dec 2020 10:05:28 GMT</pubDate>
    <dc:creator>Karthikeyan_J</dc:creator>
    <dc:date>2020-12-24T10:05:28Z</dc:date>
    <item>
      <title>how to see the output for usb example in lpc54628</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/how-to-see-the-output-for-usb-example-in-lpc54628/m-p/1203446#M43347</link>
      <description>&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;i am karthikeyan&lt;/P&gt;&lt;P&gt;I run the example program named USB HID Mouse application program. &lt;STRONG&gt;They said that this program will show a mouse ARROW moving on PC.&lt;/STRONG&gt; I run this example in lpc54628 board, it was successfully build,clean&amp;amp; debug ,there was no error and warning.&lt;/P&gt;&lt;P&gt;But i not able to see the output in the PC , i tried with connecting a OTG cable in the USB port and with other end i connected the Mouse plug in OTG cable. I cant see the output the mouse cursor is not moving in my PC.&lt;/P&gt;&lt;P&gt;So my question is how to see the mouse arrow moving on the PC.&lt;/P&gt;&lt;P&gt;Thanking You,&lt;/P&gt;&lt;P&gt;Karthikeyan.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2020 05:44:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/how-to-see-the-output-for-usb-example-in-lpc54628/m-p/1203446#M43347</guid>
      <dc:creator>Karthikeyan_J</dc:creator>
      <dc:date>2020-12-23T05:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to see the output for usb example in lpc54628</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/how-to-see-the-output-for-usb-example-in-lpc54628/m-p/1203845#M43360</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;Please let me know your demo code name and version of SDK thus I will test it on my side.&lt;/P&gt;
&lt;P&gt;There is an article, the hands on demo makes&amp;nbsp;the mouse arrow moving on the PC screen in the rectangular rotation. The method is exactly the same for LPC54628&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers-Knowledge/Using-ConfigTool-to-create-USB-Project-From-Start/ta-p/1103294" target="_blank"&gt;https://community.nxp.com/t5/LPC-Microcontrollers-Knowledge/Using-ConfigTool-to-create-USB-Project-From-Start/ta-p/1103294&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a nice day,&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2020 01:33:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/how-to-see-the-output-for-usb-example-in-lpc54628/m-p/1203845#M43360</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2020-12-24T01:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to see the output for usb example in lpc54628</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/how-to-see-the-output-for-usb-example-in-lpc54628/m-p/1204099#M43365</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Zhangjennie&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for your reply,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Demo code name and version of SDK are&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;name='SDK_2.x_LPCXpress54628'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;version='2.8.2'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;MCUXpresso IDE v11.2.0 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Example program name:dev_hid_mouse_bm and freertos too.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this was the program which i cannot get the ouput that the moving cursor on the pc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;example program description is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The USB HID mouse application is a simple demonstration program based on the MCUXpresso SDK.It is enumerated as a mouse. Users can see the mouse arrow moving on the PC screen according in a rectangular fashion.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanking You,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Karthikeyan J&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Dec 2020 10:05:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/how-to-see-the-output-for-usb-example-in-lpc54628/m-p/1204099#M43365</guid>
      <dc:creator>Karthikeyan_J</dc:creator>
      <dc:date>2020-12-24T10:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to see the output for usb example in lpc54628</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/how-to-see-the-output-for-usb-example-in-lpc54628/m-p/1204322#M43372</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Zhang&lt;/P&gt;&lt;P&gt;I get the output.&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;&lt;P&gt;can you tell me how the program is working, because i disconnected the mouse with the system but even though it still get square rotation. So my question is how the process taking place inside it(CPU &amp;amp; Microcontroller&amp;nbsp; LPC54628[OM13098] Board.&lt;/P&gt;&lt;P&gt;Thanking You,&lt;/P&gt;&lt;P&gt;Karthikeyan&lt;/P&gt;</description>
      <pubDate>Sat, 26 Dec 2020 08:00:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/how-to-see-the-output-for-usb-example-in-lpc54628/m-p/1204322#M43372</guid>
      <dc:creator>Karthikeyan_J</dc:creator>
      <dc:date>2020-12-26T08:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to see the output for usb example in lpc54628</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/how-to-see-the-output-for-usb-example-in-lpc54628/m-p/1204435#M43377</link>
      <description>&lt;P&gt;When you download&amp;nbsp;dev_hid_mouse_bm to your demo board, the demo board is enumerated as a mouse. As long as you have the board connected, you will see rectangle&amp;nbsp;&lt;SPAN&gt;rotation on the screen.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Dec 2020 06:13:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/how-to-see-the-output-for-usb-example-in-lpc54628/m-p/1204435#M43377</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2020-12-28T06:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to see the output for usb example in lpc54628</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/how-to-see-the-output-for-usb-example-in-lpc54628/m-p/1204872#M43390</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Zhang&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;the below given code will help some person who search it,&lt;/P&gt;&lt;P&gt;#include "usb_device_config.h"&lt;BR /&gt;#include "usb.h"&lt;BR /&gt;#include "usb_device.h"&lt;BR /&gt;#include "usb_device_class.h"&lt;BR /&gt;#include "usb_device_hid.h"&lt;BR /&gt;#include "usb_device_ch9.h"&lt;BR /&gt;#include "usb_device_descriptor.h"&lt;BR /&gt;#include "mouse.h"&lt;BR /&gt;#include "fsl_device_registers.h"&lt;BR /&gt;#include "clock_config.h"&lt;BR /&gt;#include "board.h"&lt;BR /&gt;#include "fsl_debug_console.h"&lt;BR /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;BR /&gt;#include "pin_mux.h"&lt;BR /&gt;#include &amp;lt;stdbool.h&amp;gt;&lt;BR /&gt;#include "fsl_power.h"&lt;BR /&gt;#include "fsl_mrt.h"&lt;BR /&gt;void BOARD_InitHardware(void);&lt;BR /&gt;void USB_DeviceClockInit(void);&lt;BR /&gt;void USB_DeviceIsrEnable(void);&lt;BR /&gt;static usb_status_t USB_DeviceHidMouseAction(void);//Update mouse pointer location. Draw a rectangular rotation&lt;BR /&gt;static usb_status_t USB_DeviceHidMouseCallback(class_handle_t handle, uint32_t event, void *param);//The hid class callback.send response if the device is attached&lt;BR /&gt;static usb_status_t USB_DeviceCallback(usb_device_handle handle, uint32_t event, void *param);//The device callback-Get hid physical descriptor request- USB bus reset signal detected-Set device configuration request-Set device interface request-Get current configuration request-Get device descriptor request-&lt;BR /&gt;static void USB_DeviceApplicationInit(void);// Initialize the usb stack and class drivers-Get the HID mouse class handle&lt;/P&gt;&lt;P&gt;uint32_t timerInterval;&lt;BR /&gt;uint32_t isConnectedToFsHost = 0U;&lt;BR /&gt;uint32_t isConnectedToHsHost = 0U;&lt;BR /&gt;USB_DMA_NONINIT_DATA_ALIGN(USB_DATA_ALIGN_SIZE) static uint8_t s_MouseBuffer[USB_HID_MOUSE_REPORT_LENGTH];&lt;BR /&gt;usb_hid_mouse_struct_t g_UsbDeviceHidMouse;&lt;/P&gt;&lt;P&gt;extern usb_device_class_struct_t g_UsbDeviceHidMouseConfig;&lt;/P&gt;&lt;P&gt;/* Set class configurations */&lt;BR /&gt;usb_device_class_config_struct_t g_UsbDeviceHidConfig[1] = {{&lt;BR /&gt;USB_DeviceHidMouseCallback, /* HID mouse class callback pointer */&lt;BR /&gt;(class_handle_t)NULL, /* The HID class handle, This field is set by USB_DeviceClassInit */&lt;BR /&gt;&amp;amp;g_UsbDeviceHidMouseConfig, /* The HID mouse configuration, including class code, subcode, and protocol, class type,&lt;BR /&gt;transfer type, endpoint address, max packet size, etc.*/&lt;BR /&gt;}};&lt;/P&gt;&lt;P&gt;/* Set class configuration list */&lt;BR /&gt;usb_device_class_config_list_struct_t g_UsbDeviceHidConfigList = {&lt;BR /&gt;g_UsbDeviceHidConfig, /* Class configurations */&lt;BR /&gt;USB_DeviceCallback, /* Device callback pointer */&lt;BR /&gt;1U, /* Class count */&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;/*******************************************************************************&lt;BR /&gt;* Code&lt;BR /&gt;******************************************************************************/&lt;BR /&gt;void USB_TimerInt(uint8_t instance, uint8_t enable)&lt;BR /&gt;{&lt;BR /&gt;MRT_Type *instanceList[] = MRT_BASE_PTRS;&lt;BR /&gt;uint32_t mrt_clock;&lt;BR /&gt;mrt_clock = CLOCK_GetFreq(kCLOCK_BusClk);&lt;BR /&gt;if (enable)&lt;BR /&gt;{&lt;BR /&gt;/* Start channel 0 */&lt;BR /&gt;MRT_StartTimer(instanceList[instance], kMRT_Channel_0, USEC_TO_COUNT(timerInterval, mrt_clock));&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;/* Stop channel 0 */&lt;BR /&gt;MRT_StopTimer(instanceList[instance], kMRT_Channel_0);&lt;BR /&gt;/* Clear interrupt flag.*/&lt;BR /&gt;MRT_ClearStatusFlags(instanceList[instance], kMRT_Channel_0, kMRT_TimerInterruptFlag);&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void USB0_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;USB_DeviceLpcIp3511IsrFunction(g_UsbDeviceHidMouse.deviceHandle);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void USB_DeviceClockInit(void)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;/* enable USB IP clock */&lt;BR /&gt;CLOCK_EnableUsbfs0DeviceClock(kCLOCK_UsbSrcFro, CLOCK_GetFroHfFreq());&lt;BR /&gt;for (int i = 0; i &amp;lt; FSL_FEATURE_USB_USB_RAM; i++)&lt;BR /&gt;{&lt;BR /&gt;((uint8_t *)FSL_FEATURE_USB_USB_RAM_BASE_ADDRESS)[i] = 0x00U;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;void USB_DeviceIsrEnable(void)&lt;BR /&gt;{&lt;BR /&gt;uint8_t irqNumber;&lt;/P&gt;&lt;P&gt;uint8_t usbDeviceIP3511Irq[] = USB_IRQS;&lt;BR /&gt;irqNumber = usbDeviceIP3511Irq[CONTROLLER_ID - kUSB_ControllerLpcIp3511Fs0];&lt;BR /&gt;EnableIRQ((IRQn_Type)irqNumber);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Update mouse pointer location. Draw a rectangular rotation*/&lt;BR /&gt;static usb_status_t USB_DeviceHidMouseAction(void)&lt;BR /&gt;{&lt;BR /&gt;static int8_t x = 0U;&lt;BR /&gt;static int8_t y = 0U;&lt;BR /&gt;enum&lt;BR /&gt;{&lt;BR /&gt;RIGHT,&lt;BR /&gt;DOWN,&lt;BR /&gt;LEFT,&lt;BR /&gt;UP&lt;BR /&gt;};&lt;BR /&gt;static uint8_t dir = RIGHT;&lt;/P&gt;&lt;P&gt;switch (dir)&lt;BR /&gt;{&lt;BR /&gt;case RIGHT:&lt;BR /&gt;/* Move right. Increase X value. */&lt;BR /&gt;g_UsbDeviceHidMouse.buffer[1] = 2U;&lt;BR /&gt;g_UsbDeviceHidMouse.buffer[2] = 0U;&lt;BR /&gt;x++;&lt;BR /&gt;if (x &amp;gt; 99U)&lt;BR /&gt;{&lt;BR /&gt;dir++;&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;case DOWN:&lt;BR /&gt;/* Move down. Increase Y value. */&lt;BR /&gt;g_UsbDeviceHidMouse.buffer[1] = 0U;&lt;BR /&gt;g_UsbDeviceHidMouse.buffer[2] = 2U;&lt;BR /&gt;y++;&lt;BR /&gt;if (y &amp;gt; 99U)&lt;BR /&gt;{&lt;BR /&gt;dir++;&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;case LEFT:&lt;BR /&gt;/* Move left. Discrease X value. */&lt;BR /&gt;g_UsbDeviceHidMouse.buffer[1] = (uint8_t)(-2);&lt;BR /&gt;g_UsbDeviceHidMouse.buffer[2] = 0U;&lt;BR /&gt;x--;&lt;BR /&gt;if (x &amp;lt; 2U)&lt;BR /&gt;{&lt;BR /&gt;dir++;&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;case UP:&lt;BR /&gt;/* Move up. Discrease Y value. */&lt;BR /&gt;g_UsbDeviceHidMouse.buffer[1] = 0U;&lt;BR /&gt;g_UsbDeviceHidMouse.buffer[2] = (uint8_t)(-2);&lt;BR /&gt;y--;&lt;BR /&gt;if (y &amp;lt; 2U)&lt;BR /&gt;{&lt;BR /&gt;dir = RIGHT;&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;default:&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;/* Send mouse report to the host */&lt;BR /&gt;return USB_DeviceHidSend(g_UsbDeviceHidMouse.hidHandle, USB_HID_MOUSE_ENDPOINT_IN, g_UsbDeviceHidMouse.buffer,&lt;BR /&gt;USB_HID_MOUSE_REPORT_LENGTH);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* The hid class callback */&lt;BR /&gt;static usb_status_t USB_DeviceHidMouseCallback(class_handle_t handle, uint32_t event, void *param)&lt;BR /&gt;{&lt;BR /&gt;usb_status_t error = kStatus_USB_Error;&lt;BR /&gt;usb_device_endpoint_callback_message_struct_t *message = (usb_device_endpoint_callback_message_struct_t *)param;&lt;/P&gt;&lt;P&gt;switch (event)&lt;BR /&gt;{&lt;BR /&gt;case kUSB_DeviceHidEventSendResponse:&lt;BR /&gt;/* Resport sent */&lt;BR /&gt;if (g_UsbDeviceHidMouse.attach)&lt;BR /&gt;{&lt;BR /&gt;if ((NULL != message) &amp;amp;&amp;amp; (message-&amp;gt;length == USB_UNINITIALIZED_VAL_32))&lt;BR /&gt;{&lt;BR /&gt;return error;&lt;BR /&gt;}&lt;BR /&gt;error = USB_DeviceHidMouseAction();&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* The device callback */&lt;BR /&gt;static usb_status_t USB_DeviceCallback(usb_device_handle handle, uint32_t event, void *param)&lt;BR /&gt;{&lt;BR /&gt;usb_status_t error = kStatus_USB_Error;&lt;BR /&gt;uint16_t *temp16 = (uint16_t *)param;&lt;BR /&gt;uint8_t *temp8 = (uint8_t *)param;&lt;/P&gt;&lt;P&gt;switch (event)&lt;BR /&gt;{&lt;BR /&gt;case kUSB_DeviceEventBusReset:&lt;BR /&gt;{&lt;BR /&gt;/* USB bus reset signal detected */&lt;BR /&gt;g_UsbDeviceHidMouse.attach = 0U;&lt;BR /&gt;g_UsbDeviceHidMouse.currentConfiguration = 0U;&lt;BR /&gt;error = kStatus_USB_Success;&lt;BR /&gt;}&lt;BR /&gt;break;&lt;/P&gt;&lt;P&gt;case kUSB_DeviceEventSetConfiguration:&lt;BR /&gt;if (0U == (*temp8))&lt;BR /&gt;{&lt;BR /&gt;g_UsbDeviceHidMouse.attach = 0;&lt;BR /&gt;g_UsbDeviceHidMouse.currentConfiguration = 0U;&lt;BR /&gt;}&lt;BR /&gt;else if (USB_HID_MOUSE_CONFIGURE_INDEX == (*temp8))&lt;BR /&gt;{&lt;BR /&gt;/* Set device configuration request */&lt;BR /&gt;g_UsbDeviceHidMouse.attach = 1U;&lt;BR /&gt;g_UsbDeviceHidMouse.currentConfiguration = *temp8;&lt;BR /&gt;error = USB_DeviceHidMouseAction();&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;error = kStatus_USB_InvalidRequest;&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;case kUSB_DeviceEventSetInterface:&lt;BR /&gt;if (g_UsbDeviceHidMouse.attach)&lt;BR /&gt;{&lt;BR /&gt;/* Set device interface request */&lt;BR /&gt;uint8_t interface = (uint8_t)((*temp16 &amp;amp; 0xFF00U) &amp;gt;&amp;gt; 0x08U);&lt;BR /&gt;uint8_t alternateSetting = (uint8_t)(*temp16 &amp;amp; 0x00FFU);&lt;BR /&gt;if (interface &amp;lt; USB_HID_MOUSE_INTERFACE_COUNT)&lt;BR /&gt;{&lt;BR /&gt;g_UsbDeviceHidMouse.currentInterfaceAlternateSetting[interface] = alternateSetting;&lt;BR /&gt;if (alternateSetting == 0U)&lt;BR /&gt;{&lt;BR /&gt;error = USB_DeviceHidMouseAction();&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;case kUSB_DeviceEventGetConfiguration:&lt;BR /&gt;if (param)&lt;BR /&gt;{&lt;BR /&gt;/* Get current configuration request */&lt;BR /&gt;*temp8 = g_UsbDeviceHidMouse.currentConfiguration;&lt;BR /&gt;error = kStatus_USB_Success;&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;case kUSB_DeviceEventGetInterface:&lt;BR /&gt;if (param)&lt;BR /&gt;{&lt;BR /&gt;/* Get current alternate setting of the interface request */&lt;BR /&gt;uint8_t interface = (uint8_t)((*temp16 &amp;amp; 0xFF00U) &amp;gt;&amp;gt; 0x08U);&lt;BR /&gt;if (interface &amp;lt; USB_HID_MOUSE_INTERFACE_COUNT)&lt;BR /&gt;{&lt;BR /&gt;*temp16 = (*temp16 &amp;amp; 0xFF00U) | g_UsbDeviceHidMouse.currentInterfaceAlternateSetting[interface];&lt;BR /&gt;error = kStatus_USB_Success;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;error = kStatus_USB_InvalidRequest;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;case kUSB_DeviceEventGetDeviceDescriptor:&lt;BR /&gt;if (param)&lt;BR /&gt;{&lt;BR /&gt;/* Get device descriptor request */&lt;BR /&gt;error = USB_DeviceGetDeviceDescriptor(handle, (usb_device_get_device_descriptor_struct_t *)param);&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;case kUSB_DeviceEventGetConfigurationDescriptor:&lt;BR /&gt;if (param)&lt;BR /&gt;{&lt;BR /&gt;/* Get device configuration descriptor request */&lt;BR /&gt;error = USB_DeviceGetConfigurationDescriptor(handle,&lt;BR /&gt;(usb_device_get_configuration_descriptor_struct_t *)param);&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;case kUSB_DeviceEventGetStringDescriptor:&lt;BR /&gt;if (param)&lt;BR /&gt;{&lt;BR /&gt;/* Get device string descriptor request */&lt;BR /&gt;error = USB_DeviceGetStringDescriptor(handle, (usb_device_get_string_descriptor_struct_t *)param);&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;case kUSB_DeviceEventGetHidDescriptor:&lt;BR /&gt;if (param)&lt;BR /&gt;{&lt;BR /&gt;/* Get hid descriptor request */&lt;BR /&gt;error = USB_DeviceGetHidDescriptor(handle, (usb_device_get_hid_descriptor_struct_t *)param);&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;case kUSB_DeviceEventGetHidReportDescriptor:&lt;BR /&gt;if (param)&lt;BR /&gt;{&lt;BR /&gt;/* Get hid report descriptor request */&lt;BR /&gt;error =&lt;BR /&gt;USB_DeviceGetHidReportDescriptor(handle, (usb_device_get_hid_report_descriptor_struct_t *)param);&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;case kUSB_DeviceEventGetHidPhysicalDescriptor:&lt;BR /&gt;if (param)&lt;BR /&gt;{&lt;BR /&gt;/* Get hid physical descriptor request */&lt;BR /&gt;error = USB_DeviceGetHidPhysicalDescriptor(handle,&lt;BR /&gt;(usb_device_get_hid_physical_descriptor_struct_t *)param);&lt;BR /&gt;}&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;static void USB_DeviceApplicationInit(void)&lt;BR /&gt;{&lt;BR /&gt;USB_DeviceClockInit();&lt;BR /&gt;/* Set HID mouse to default state */&lt;BR /&gt;g_UsbDeviceHidMouse.speed = USB_SPEED_FULL;&lt;BR /&gt;g_UsbDeviceHidMouse.attach = 0U;&lt;BR /&gt;g_UsbDeviceHidMouse.hidHandle = (class_handle_t)NULL;&lt;BR /&gt;g_UsbDeviceHidMouse.deviceHandle = NULL;&lt;BR /&gt;g_UsbDeviceHidMouse.buffer = s_MouseBuffer;&lt;/P&gt;&lt;P&gt;/* Initialize the usb stack and class drivers */&lt;BR /&gt;if (kStatus_USB_Success !=&lt;BR /&gt;USB_DeviceClassInit(CONTROLLER_ID, &amp;amp;g_UsbDeviceHidConfigList, &amp;amp;g_UsbDeviceHidMouse.deviceHandle))&lt;BR /&gt;{&lt;BR /&gt;usb_echo("USB device mouse failed\r\n");&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;usb_echo("USB device DCD + HID mouse demo\r\n");&lt;BR /&gt;usb_echo("USB device HID mouse demo\r\n");&lt;BR /&gt;/* Get the HID mouse class handle */&lt;BR /&gt;g_UsbDeviceHidMouse.hidHandle = g_UsbDeviceHidConfigList.config-&amp;gt;classHandle;&lt;BR /&gt;}&lt;BR /&gt;USB_DeviceIsrEnable();&lt;BR /&gt;/*USB_DeviceRun could not be called here to avoid DP/DM confliction between DCD function and USB function in case&lt;BR /&gt;DCD is enabled. Instead, USB_DeviceRun should be called after the DCD is finished immediately*/&lt;BR /&gt;/* Start USB device HID mouse */&lt;BR /&gt;/*Add one delay here to make the DP pull down long enough to allow host to detect the previous disconnection.*/&lt;BR /&gt;SDK_DelayAtLeastUs(5000, SDK_DEVICE_MAXIMUM_CPU_CLOCK_FREQUENCY);&lt;BR /&gt;USB_DeviceRun(g_UsbDeviceHidMouse.deviceHandle);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*!&lt;BR /&gt;* @brief Application task function.&lt;BR /&gt;*&lt;BR /&gt;* This function runs the task for application.&lt;BR /&gt;*&lt;BR /&gt;* @return None.&lt;BR /&gt;*/&lt;BR /&gt;void USB_DeviceAppTask(void *parameter)&lt;BR /&gt;{&lt;BR /&gt;usb_hid_mouse_struct_t *usbDeviceHid = (usb_hid_mouse_struct_t *)parameter;&lt;/P&gt;&lt;P&gt;if (usbDeviceHid-&amp;gt;connectStateChanged)&lt;BR /&gt;{&lt;BR /&gt;usbDeviceHid-&amp;gt;connectStateChanged = 0;&lt;BR /&gt;if (g_UsbDeviceHidMouse.connectState)&lt;BR /&gt;{&lt;BR /&gt;/*user need call USB_DeviceRun here to usb function run if dcd function is disabled*/&lt;BR /&gt;/*USB_DeviceRun(g_UsbDeviceHidMouse.deviceHandle);*/&lt;BR /&gt;usb_echo("USB device attached.\r\n");&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;usb_echo("USB device detached.\r\n");&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;void main(void)&lt;BR /&gt;{&lt;BR /&gt;/* attach 12 MHz clock to FLEXCOMM0 (debug console) */&lt;BR /&gt;CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);&lt;BR /&gt;BOARD_InitPins();&lt;BR /&gt;BOARD_BootClockFROHF96M();&lt;BR /&gt;BOARD_InitDebugConsole();&lt;BR /&gt;POWER_DisablePD(kPDRUNCFG_PD_USB0_PHY); /*&amp;lt; Turn on USB Phy */&lt;BR /&gt;CLOCK_SetClkDiv(kCLOCK_DivUsb0Clk, 1, false);&lt;BR /&gt;CLOCK_AttachClk(kFRO_HF_to_USB0_CLK);&lt;BR /&gt;/* enable usb0 host clock */&lt;BR /&gt;CLOCK_EnableClock(kCLOCK_Usbhsl0);&lt;BR /&gt;/*According to reference mannual, device mode setting has to be set by access usb host register */&lt;BR /&gt;*((uint32_t *)(USBFSH_BASE + 0x5C)) |= USBFSH_PORTMODE_DEV_ENABLE_MASK;&lt;BR /&gt;/* disable usb0 host clock */&lt;BR /&gt;CLOCK_DisableClock(kCLOCK_Usbhsl0);&lt;BR /&gt;USB_DeviceApplicationInit();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;the output will be seen in the PC, that the mouse cursor will rotate in a square shape.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanking You,&lt;/P&gt;&lt;P&gt;Karthikeyan.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2020 09:28:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/how-to-see-the-output-for-usb-example-in-lpc54628/m-p/1204872#M43390</guid>
      <dc:creator>Karthikeyan_J</dc:creator>
      <dc:date>2020-12-29T09:28:53Z</dc:date>
    </item>
  </channel>
</rss>

