boards/risc-v/k210/maix-bit: Add userled support#18596
Merged
linguini1 merged 1 commit intoapache:masterfrom Mar 24, 2026
Merged
boards/risc-v/k210/maix-bit: Add userled support#18596linguini1 merged 1 commit intoapache:masterfrom
linguini1 merged 1 commit intoapache:masterfrom
Conversation
Replace GPIO driver with userled driver for Pin 12 and 13 LEDs. The red LED on Pin 14 remains as system LED. - Add user LED definitions in board.h (BOARD_LED1, BOARD_LED2) - Add k210_userleds.c implementing board_userled_* functions - Remove k210_gpio.c (GPIO driver no longer needed) - Update CMakeLists.txt and Makefile for userled build - Update k210_bringup.c to initialize userled instead of GPIO Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
simbit18
approved these changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace GPIO driver with userled driver for maix-bit board (K210 RISC-V).
The previous implementation used a generic GPIO driver (k210_gpio.c) to control the LEDs on pins 12 and 13. This commit replaces it with a proper userled driver (k210_userleds.c) that follows the NuttX LED driver conventions. The userled driver better reflects the real hardware connection since these pins are connected to LEDs, not general purpose GPIO.
Changes:
The red LED on Pin 14 remains as system LED (CONFIG_ARCH_LEDS).
Impact
Testing
Build Host: Linux, RISC-V toolchain
Target: maix-bit (K210)
Verified build with default nsh configuration (no LED drivers enabled):
Manual testing with CONFIG_USERLED_LOWER and CONFIG_EXAMPLES_LEDS enabled: