<?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 control Caps Lock / Num Lock / Scroll Lock LEDs in HID Keyboard Driver? in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-to-control-Caps-Lock-Num-Lock-Scroll-Lock-LEDs-in-HID/m-p/2301383#M243652</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;DIV class="Y3BBE" data-sfc-cp="" data-hveid="CAEQAA" data-processed="true"&gt;
&lt;DIV style="display: contents;" data-subtree="aimfl,mfl" data-processed="true"&gt;Control keyboard LEDs (Caps/Num/Scroll Lock) on an NXP MCU&lt;/DIV&gt;
&lt;MARK class="HxTRcb" data-processed="true"&gt;by implementing an HID &lt;STRONG class="Yjhzub" data-processed="true"&gt;Output Report&lt;/STRONG&gt; handler within your USB stack to receive 1-byte status updates from the host (bit 0: Num, bit 1: Caps, bit 2: Scroll)&lt;/MARK&gt;. Update GPIO pins based on this byte in the &lt;CODE class="o8j0Mc" dir="ltr" data-processed="true"&gt;USB_DeviceHidKeyboardAction&lt;/CODE&gt; or equivalent callback.&lt;SPAN class="uJ19be notranslate" data-wiz-uids="Q50I8b_e" data-processed="true"&gt;&lt;SPAN class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=Q50I8b_d/TKHnVd" data-processed="true"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="Y3BBE" data-sfc-cp="" data-hveid="CAIQAA" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Key Implementation Details&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;UL class="KsbFXc U6u95" data-processed="true"&gt;
&lt;LI data-hveid="CAMQAA" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Report Structure:&lt;/STRONG&gt; The host sends a 1-byte output report where bits represent the lock states:&lt;/SPAN&gt;
&lt;UL class="KsbFXc U6u95" data-processed="true"&gt;
&lt;LI data-hveid="CAMQAQ" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Bit 0:&lt;/STRONG&gt; Num Lock&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI data-hveid="CAMQAg" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Bit 1:&lt;/STRONG&gt; Caps Lock&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI data-hveid="CAMQAw" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Bit 2:&lt;/STRONG&gt; Scroll Lock&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI data-hveid="CAMQBA" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;NXP Implementation:&lt;/STRONG&gt; In NXP SDK examples, this is typically handled by modifying the &lt;CODE class="o8j0Mc" dir="ltr" data-processed="true"&gt;USB_DeviceHidKeyboardAction&lt;/CODE&gt; function or setting up the endpoint 0 callback to process &lt;CODE class="o8j0Mc" dir="ltr" data-processed="true"&gt;USB_DEV_EVENT_SET_REPORT&lt;/CODE&gt;.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI data-hveid="CAMQBQ" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Callback Routine:&lt;/STRONG&gt; When the host sends the report, the USB stack triggers a callback. You must parse the received data and update the GPIOs controlling the LEDs.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI data-hveid="CAMQBg" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Example Code Snippet:&lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;DIV class="r1PmQe" data-wiz-uids="Q50I8b_1d,Q50I8b_1e,Q50I8b_1f" data-hveid="CAMQBw" data-processed="true"&gt;
&lt;DIV data-processed="true"&gt;
&lt;DIV class="pHpOfb" data-animation-atomic="" data-processed="true"&gt;
&lt;DIV class="vVRw1d" data-processed="true"&gt;c&lt;/DIV&gt;
&lt;DIV class="pCTyYe" dir="ltr" data-processed="true"&gt;
&lt;PRE data-processed="true"&gt;&lt;CODE data-processed="true"&gt;&lt;SPAN class="ClTQqc" data-processed="true"&gt;// Inside your USB HID callback&lt;/SPAN&gt;
&lt;SPAN class="mexSqb" data-processed="true"&gt;if&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt; (event == USB_DEV_EVENT_SET_REPORT) {
    uint8_t *led_report = (uint8_t *)param;
    &lt;/SPAN&gt;&lt;SPAN class="mexSqb" data-processed="true"&gt;if&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt; (led_report[&lt;/SPAN&gt;&lt;SPAN class="tnfcCf" data-processed="true"&gt;0&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;] &amp;amp; &lt;/SPAN&gt;&lt;SPAN class="tnfcCf" data-processed="true"&gt;0x01&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;) { &lt;/SPAN&gt;&lt;SPAN class="ClTQqc" data-processed="true"&gt;/* Turn on NumLock LED */&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt; }
    &lt;/SPAN&gt;&lt;SPAN class="mexSqb" data-processed="true"&gt;if&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt; (led_report[&lt;/SPAN&gt;&lt;SPAN class="tnfcCf" data-processed="true"&gt;0&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;] &amp;amp; &lt;/SPAN&gt;&lt;SPAN class="tnfcCf" data-processed="true"&gt;0x02&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;) { &lt;/SPAN&gt;&lt;SPAN class="ClTQqc" data-processed="true"&gt;/* Turn on CapsLock LED */&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt; }
    &lt;/SPAN&gt;&lt;SPAN class="mexSqb" data-processed="true"&gt;if&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt; (led_report[&lt;/SPAN&gt;&lt;SPAN class="tnfcCf" data-processed="true"&gt;0&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;] &amp;amp; &lt;/SPAN&gt;&lt;SPAN class="tnfcCf" data-processed="true"&gt;0x04&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;) { &lt;/SPAN&gt;&lt;SPAN class="ClTQqc" data-processed="true"&gt;/* Turn on ScrollLock LED */&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt; }
}
&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;SPAN class="uJ19be notranslate" data-wiz-uids="Q50I8b_1j" data-processed="true"&gt;&lt;SPAN class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=Q50I8b_1i/TKHnVd" data-processed="true"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV class="Y3BBE" data-sfc-cp="" data-hveid="CAQQAA" data-processed="true"&gt;Ensure your HID report descriptor properly defines an &lt;CODE class="o8j0Mc" dir="ltr" data-processed="true"&gt;Output&lt;/CODE&gt; report for the LED indicators (usage page 0x08, LEDs&lt;/DIV&gt;
&lt;DIV class="Y3BBE" data-sfc-cp="" data-hveid="CAQQAA" data-processed="true"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="Y3BBE" data-sfc-cp="" data-hveid="CAQQAA" data-processed="true"&gt;Regards&lt;/DIV&gt;</description>
    <pubDate>Tue, 27 Jan 2026 14:22:53 GMT</pubDate>
    <dc:creator>Bio_TICFSL</dc:creator>
    <dc:date>2026-01-27T14:22:53Z</dc:date>
    <item>
      <title>How to control Caps Lock / Num Lock / Scroll Lock LEDs in HID Keyboard Driver?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-control-Caps-Lock-Num-Lock-Scroll-Lock-LEDs-in-HID/m-p/2300915#M243635</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I’m working on an HID keyboard using an NXP MCU and the USB HID keyboard driver.&lt;BR /&gt;I would like to control the keyboard LEDs (Caps Lock, Num Lock, and Scroll Lock).&lt;/P&gt;&lt;P&gt;Specifically, I’m trying to understand:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;How the host sends LED status (Caps Lock / Num Lock / Scroll Lock) to the device&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Which HID report or callback in the NXP HID keyboard driver receives this LED information&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;How to correctly parse the LED output report and map it to GPIOs to turn the keyboard LEDs ON/OFF&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I’m using the NXP USB HID stack, and the keyboard enumeration is working correctly. Key press reports are sent successfully, but I’m not sure where or how to handle the &lt;STRONG&gt;LED output report from the host&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;If possible, sample code or references to the relevant driver files/functions would be very helpful.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jan 2026 07:11:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-control-Caps-Lock-Num-Lock-Scroll-Lock-LEDs-in-HID/m-p/2300915#M243635</guid>
      <dc:creator>Unais_Kn</dc:creator>
      <dc:date>2026-01-27T07:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to control Caps Lock / Num Lock / Scroll Lock LEDs in HID Keyboard Driver?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-control-Caps-Lock-Num-Lock-Scroll-Lock-LEDs-in-HID/m-p/2301383#M243652</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;DIV class="Y3BBE" data-sfc-cp="" data-hveid="CAEQAA" data-processed="true"&gt;
&lt;DIV style="display: contents;" data-subtree="aimfl,mfl" data-processed="true"&gt;Control keyboard LEDs (Caps/Num/Scroll Lock) on an NXP MCU&lt;/DIV&gt;
&lt;MARK class="HxTRcb" data-processed="true"&gt;by implementing an HID &lt;STRONG class="Yjhzub" data-processed="true"&gt;Output Report&lt;/STRONG&gt; handler within your USB stack to receive 1-byte status updates from the host (bit 0: Num, bit 1: Caps, bit 2: Scroll)&lt;/MARK&gt;. Update GPIO pins based on this byte in the &lt;CODE class="o8j0Mc" dir="ltr" data-processed="true"&gt;USB_DeviceHidKeyboardAction&lt;/CODE&gt; or equivalent callback.&lt;SPAN class="uJ19be notranslate" data-wiz-uids="Q50I8b_e" data-processed="true"&gt;&lt;SPAN class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=Q50I8b_d/TKHnVd" data-processed="true"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="Y3BBE" data-sfc-cp="" data-hveid="CAIQAA" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Key Implementation Details&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;UL class="KsbFXc U6u95" data-processed="true"&gt;
&lt;LI data-hveid="CAMQAA" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Report Structure:&lt;/STRONG&gt; The host sends a 1-byte output report where bits represent the lock states:&lt;/SPAN&gt;
&lt;UL class="KsbFXc U6u95" data-processed="true"&gt;
&lt;LI data-hveid="CAMQAQ" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Bit 0:&lt;/STRONG&gt; Num Lock&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI data-hveid="CAMQAg" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Bit 1:&lt;/STRONG&gt; Caps Lock&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI data-hveid="CAMQAw" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Bit 2:&lt;/STRONG&gt; Scroll Lock&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI data-hveid="CAMQBA" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;NXP Implementation:&lt;/STRONG&gt; In NXP SDK examples, this is typically handled by modifying the &lt;CODE class="o8j0Mc" dir="ltr" data-processed="true"&gt;USB_DeviceHidKeyboardAction&lt;/CODE&gt; function or setting up the endpoint 0 callback to process &lt;CODE class="o8j0Mc" dir="ltr" data-processed="true"&gt;USB_DEV_EVENT_SET_REPORT&lt;/CODE&gt;.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI data-hveid="CAMQBQ" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Callback Routine:&lt;/STRONG&gt; When the host sends the report, the USB stack triggers a callback. You must parse the received data and update the GPIOs controlling the LEDs.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI data-hveid="CAMQBg" data-processed="true"&gt;&lt;SPAN class="T286Pc" data-sfc-cp="" data-processed="true"&gt;&lt;STRONG class="Yjhzub" data-processed="true"&gt;Example Code Snippet:&lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;DIV class="r1PmQe" data-wiz-uids="Q50I8b_1d,Q50I8b_1e,Q50I8b_1f" data-hveid="CAMQBw" data-processed="true"&gt;
&lt;DIV data-processed="true"&gt;
&lt;DIV class="pHpOfb" data-animation-atomic="" data-processed="true"&gt;
&lt;DIV class="vVRw1d" data-processed="true"&gt;c&lt;/DIV&gt;
&lt;DIV class="pCTyYe" dir="ltr" data-processed="true"&gt;
&lt;PRE data-processed="true"&gt;&lt;CODE data-processed="true"&gt;&lt;SPAN class="ClTQqc" data-processed="true"&gt;// Inside your USB HID callback&lt;/SPAN&gt;
&lt;SPAN class="mexSqb" data-processed="true"&gt;if&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt; (event == USB_DEV_EVENT_SET_REPORT) {
    uint8_t *led_report = (uint8_t *)param;
    &lt;/SPAN&gt;&lt;SPAN class="mexSqb" data-processed="true"&gt;if&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt; (led_report[&lt;/SPAN&gt;&lt;SPAN class="tnfcCf" data-processed="true"&gt;0&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;] &amp;amp; &lt;/SPAN&gt;&lt;SPAN class="tnfcCf" data-processed="true"&gt;0x01&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;) { &lt;/SPAN&gt;&lt;SPAN class="ClTQqc" data-processed="true"&gt;/* Turn on NumLock LED */&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt; }
    &lt;/SPAN&gt;&lt;SPAN class="mexSqb" data-processed="true"&gt;if&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt; (led_report[&lt;/SPAN&gt;&lt;SPAN class="tnfcCf" data-processed="true"&gt;0&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;] &amp;amp; &lt;/SPAN&gt;&lt;SPAN class="tnfcCf" data-processed="true"&gt;0x02&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;) { &lt;/SPAN&gt;&lt;SPAN class="ClTQqc" data-processed="true"&gt;/* Turn on CapsLock LED */&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt; }
    &lt;/SPAN&gt;&lt;SPAN class="mexSqb" data-processed="true"&gt;if&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt; (led_report[&lt;/SPAN&gt;&lt;SPAN class="tnfcCf" data-processed="true"&gt;0&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;] &amp;amp; &lt;/SPAN&gt;&lt;SPAN class="tnfcCf" data-processed="true"&gt;0x04&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt;) { &lt;/SPAN&gt;&lt;SPAN class="ClTQqc" data-processed="true"&gt;/* Turn on ScrollLock LED */&lt;/SPAN&gt;&lt;SPAN class="undefined" data-processed="true"&gt; }
}
&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;SPAN class="uJ19be notranslate" data-wiz-uids="Q50I8b_1j" data-processed="true"&gt;&lt;SPAN class="vKEkVd" data-animation-atomic="" data-wiz-attrbind="class=Q50I8b_1i/TKHnVd" data-processed="true"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;DIV class="Y3BBE" data-sfc-cp="" data-hveid="CAQQAA" data-processed="true"&gt;Ensure your HID report descriptor properly defines an &lt;CODE class="o8j0Mc" dir="ltr" data-processed="true"&gt;Output&lt;/CODE&gt; report for the LED indicators (usage page 0x08, LEDs&lt;/DIV&gt;
&lt;DIV class="Y3BBE" data-sfc-cp="" data-hveid="CAQQAA" data-processed="true"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="Y3BBE" data-sfc-cp="" data-hveid="CAQQAA" data-processed="true"&gt;Regards&lt;/DIV&gt;</description>
      <pubDate>Tue, 27 Jan 2026 14:22:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-control-Caps-Lock-Num-Lock-Scroll-Lock-LEDs-in-HID/m-p/2301383#M243652</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2026-01-27T14:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to control Caps Lock / Num Lock / Scroll Lock LEDs in HID Keyboard Driver?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-control-Caps-Lock-Num-Lock-Scroll-Lock-LEDs-in-HID/m-p/2301813#M243668</link>
      <description>I am unable to locate the USB_DeviceHidKeyboardAction function in the NXP SDK HID keyboard example.&lt;BR /&gt;&lt;BR /&gt;Is it possible to use the USB_HostHidSetReport and USB_HostHidGetReport APIs to configure and manage HID reports instead? If so, could you please provide an example function demonstrating how to use these APIs for report handling?&lt;BR /&gt;&lt;BR /&gt;Additionally, how can we verify that the HID report descriptor correctly defines an Output Report for keyboard LED indicators (such as Num Lock, Caps Lock, and Scroll Lock)?</description>
      <pubDate>Wed, 28 Jan 2026 05:27:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-control-Caps-Lock-Num-Lock-Scroll-Lock-LEDs-in-HID/m-p/2301813#M243668</guid>
      <dc:creator>Unais_Kn</dc:creator>
      <dc:date>2026-01-28T05:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to control Caps Lock / Num Lock / Scroll Lock LEDs in HID Keyboard Driver?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-control-Caps-Lock-Num-Lock-Scroll-Lock-LEDs-in-HID/m-p/2302559#M243687</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The USB_HostHidSetReport() function is working correctly. However, the implementation requires that USB_HostHidGetReport() be called after every SetReport operation to ensure proper behavior. Is there a specific reason why a GetReport call is required after each SetReport?&lt;/P&gt;&lt;P&gt;Below is the current implementation:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;USB_HostHidSetReport(
    g_HostHidKeyboard.classHandle,   &lt;SPAN class=""&gt;/* HID class instance */&lt;/SPAN&gt;
    HID_NO_REPORT_ID,                &lt;SPAN class=""&gt;/* Report ID = 0 */&lt;/SPAN&gt;
    HID_REPORT_TYPE_OUTPUT,          &lt;SPAN class=""&gt;/* Output report */&lt;/SPAN&gt;
    &amp;amp;buffer,                         &lt;SPAN class=""&gt;/* 1-byte LED report */&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;sizeof&lt;/SPAN&gt;(buffer),
    &lt;SPAN class=""&gt;NULL&lt;/SPAN&gt;,                            &lt;SPAN class=""&gt;/* Completion callback */&lt;/SPAN&gt;
    &lt;SPAN class=""&gt;NULL&lt;/SPAN&gt;
);

USB_HostHidGetReport(
    g_HostHidKeyboard.classHandle,
    HID_NO_REPORT_ID,
    HID_REPORT_TYPE_OUTPUT,          &lt;SPAN class=""&gt;/* Report type */&lt;/SPAN&gt;
    &amp;amp;ReportGet,
    &lt;SPAN class=""&gt;1&lt;/SPAN&gt;,
    &lt;SPAN class=""&gt;NULL&lt;/SPAN&gt;,
    &lt;SPAN class=""&gt;NULL&lt;/SPAN&gt;
);&lt;/SPAN&gt;&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Report ID: 0x00&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Report Type: 0x02&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The following function demonstrates the full sequence:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;static&lt;/SPAN&gt; &lt;SPAN class=""&gt;void&lt;/SPAN&gt; &lt;SPAN class=""&gt;Keyboard_SetReport&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;SPAN class=""&gt;uint8_t&lt;/SPAN&gt;&lt;/SPAN&gt; buffer)
{
    &lt;SPAN class=""&gt;usb_status_t&lt;/SPAN&gt; status;
    &lt;SPAN class=""&gt;uint8_t&lt;/SPAN&gt; ReportGet;

    vTaskDelay(&lt;SPAN class=""&gt;50&lt;/SPAN&gt; / portTICK_PERIOD_MS);
    usb_echo(&lt;SPAN class=""&gt;"Keyboard_SetReport - %d\r\n"&lt;/SPAN&gt;, buffer);

    status = USB_HostHidSetReport(
        g_HostHidKeyboard.classHandle,   &lt;SPAN class=""&gt;/* HID class instance */&lt;/SPAN&gt;
        HID_NO_REPORT_ID,                &lt;SPAN class=""&gt;/* Report ID = 0 */&lt;/SPAN&gt;
        HID_REPORT_TYPE_OUTPUT,          &lt;SPAN class=""&gt;/* Output report */&lt;/SPAN&gt;
        &amp;amp;buffer,                         &lt;SPAN class=""&gt;/* 1-byte LED report */&lt;/SPAN&gt;
        &lt;SPAN class=""&gt;sizeof&lt;/SPAN&gt;(buffer),
        &lt;SPAN class=""&gt;NULL&lt;/SPAN&gt;,                            &lt;SPAN class=""&gt;/* Completion callback */&lt;/SPAN&gt;
        &lt;SPAN class=""&gt;NULL&lt;/SPAN&gt;
    );

    vTaskDelay(&lt;SPAN class=""&gt;10&lt;/SPAN&gt; / portTICK_PERIOD_MS);

    status = USB_HostHidGetReport(
        g_HostHidKeyboard.classHandle,
        HID_NO_REPORT_ID,
        HID_REPORT_TYPE_OUTPUT,
        &amp;amp;ReportGet,
        &lt;SPAN class=""&gt;1&lt;/SPAN&gt;,
        &lt;SPAN class=""&gt;NULL&lt;/SPAN&gt;,
        &lt;SPAN class=""&gt;NULL&lt;/SPAN&gt;
    );

    &lt;SPAN class=""&gt;if&lt;/SPAN&gt; (status != kStatus_USB_Success)
    {
        usb_echo(&lt;SPAN class=""&gt;"Error in USB_HostHidSetReport call - %d\r\n"&lt;/SPAN&gt;, status);
        &lt;SPAN class=""&gt;/* Handle error */&lt;/SPAN&gt;
    }
}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2026 04:06:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-control-Caps-Lock-Num-Lock-Scroll-Lock-LEDs-in-HID/m-p/2302559#M243687</guid>
      <dc:creator>Unais_Kn</dc:creator>
      <dc:date>2026-01-29T04:06:24Z</dc:date>
    </item>
  </channel>
</rss>

