Skip to content

drivers/input: Add support to MPR121 Capacitive Keypad#18780

Merged
acassis merged 3 commits intoapache:masterfrom
acassis:keypad_mpr121
Apr 23, 2026
Merged

drivers/input: Add support to MPR121 Capacitive Keypad#18780
acassis merged 3 commits intoapache:masterfrom
acassis:keypad_mpr121

Conversation

@acassis
Copy link
Copy Markdown
Contributor

@acassis acassis commented Apr 22, 2026

Summary

This PR adds support to MPR121

Impact

Some users will be happy :-)

Testing

NuttShell (NSH) NuttX-12.13.0
nsh> ABCDF

NuttShell (NSH) NuttX-12.13.0
nsh> ls /dev
/dev:
 console
 keypad0
 null
 ttyS0
 zero
nsh> kbd                                                                          
kbd_main: nsamples: 0                                                             
kbd_main: Opening /dev/keypad0                                                    
Sample  :                                                                         
   code : 48                                                                      
   type : 0                                                                       
Sample  :                                                                         
   code : 48                                                                      
   type : 1                                                                       
Sample  :                                                                         
   code : 49                                                                      
   type : 0                                                                       
Sample  :                                                                         
   code : 49                                                                      
   type : 1       

@github-actions github-actions Bot added Area: Drivers Drivers issues Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. Board: arm labels Apr 22, 2026
@simbit18
Copy link
Copy Markdown
Contributor

Hi @acassis , please align CMake with Make

if(CONFIG_INPUT_MPR121_KEYPAD)
  list(APPEND SRCS stm32_mpr121.c)
endif()

https://github.com/acassis/incubator-nuttx/blob/9572f36a63ce9471fba2bc87306d8877a5f91da8/boards/arm/stm32/common/src/CMakeLists.txt#L84

We also have a simple verification workflow #18568 for these tasks; all you need to do is provide board:config (build for Make and CMake)

Set it up as follows:

Nuttx repository: acassis/incubator-nuttx
    Nuttx branch: keypad_mpr121
 Apps repository: apache/nuttx-apps
     Apps branch: master
          Config: stm32f4discovery:mpr121_keypad
    Build system: all

Workflow -> Manually Compiling with Make or Cmake for test

Why don’t we use our free GitHub for simple validation tests? :)

That’s why I recommend everyone uses this #18568 tool :

  • it uses our Nuttx Docker image
  • it helps run tests in advance before creating a PR

@acassis acassis force-pushed the keypad_mpr121 branch 2 times, most recently from 5542197 to df46788 Compare April 23, 2026 11:38
@acassis
Copy link
Copy Markdown
Contributor Author

acassis commented Apr 23, 2026

Nuttx repository: acassis/incubator-nuttx
Nuttx branch: keypad_mpr121
Apps repository: apache/nuttx-apps
Apps branch: master
Config: stm32f4discovery:mpr121_keypad
Build system: all

Hi @simbit18 thank you very much! I follow the Issue steps and it is running now:
https://github.com/acassis/manual-nuttx-ci/actions/runs/24833314594

I tried to setup all the "Run Workflow" parameters, but I couldn't find the option to select the board profile, then after reading your comment in the issue I saw I should have selected the second Workflow.

Hmm, maybe we can merge both in a single Workflow:

In the "Choose a host platform" we could have the option: "I will define a board:profile", then when it is selected a new text box will be available to let the user to select it.

@simbit18
Copy link
Copy Markdown
Contributor

I tried to setup all the "Run Workflow" parameters, but I couldn't find the option to select the board profile, then after reading your comment in the issue I saw I should have selected the second Workflow.

@acassis If you want, you can stop it -> cancel workflow

Hmm, maybe we can merge both in a single Workflow:

In the "Choose a host platform" we could have the option: "I will define a board:profile", then when it is selected a new text box will be available to let the user to select it.

It's best to keep them separate because they are structured completely differently.

@acassis
Copy link
Copy Markdown
Contributor Author

acassis commented Apr 23, 2026

I tried to setup all the "Run Workflow" parameters, but I couldn't find the option to select the board profile, then after reading your comment in the issue I saw I should have selected the second Workflow.

@acassis If you want, you can stop it -> cancel workflow

Yes, in fact I had to stop it because it found some issue, now using the right workflow:
https://github.com/acassis/manual-nuttx-ci/actions/runs/24834664677

Hmm, maybe we can merge both in a single Workflow:
In the "Choose a host platform" we could have the option: "I will define a board:profile", then when it is selected a new text box will be available to let the user to select it.

It's best to keep them separate because they are structured completely differently.

I thought you have used the same files from Lup and just modified it to support board:profiles.

Although the steps are simple, I think the idea of using user's Runners will it put more attrition to new users trying to contribute with NuttX. We need to make our contributors life easier and they need to feel compelled to contribute.

Maybe there is some way to automatically start it for users without requesting them to do more things from their sides.

Comment thread drivers/input/Kconfig Outdated
@simbit18
Copy link
Copy Markdown
Contributor

simbit18 commented Apr 23, 2026

@acassis We don’t force users to use it!!! :)

It’s just a tool to help because:

  • Not everyone can afford expensive servers
  • Not everyone has Linux, macOS, and Windows (MSYS or MSVC)
  • Not everyone wants to tie up their PC for hours

In fact, it’s a useful tool for us PMC/Committers too :)

Take your most recent change, for example

#18744

If you’d used this tool, you would have spotted the errors sooner.

@acassis
Copy link
Copy Markdown
Contributor Author

acassis commented Apr 23, 2026

@acassis We don’t force users to use it!!! :)

It’s just a tool to help because:

* Not everyone can afford expensive servers

* Not everyone has Linux, macOS, and Windows (MSYS or MSVC)

* Not everyone wants to tie up their PC for hours

In fact, it’s a useful tool for us PMC/Committers too :)

Take your most recent change, for example

#18744

If you’d used this tool, you would have spotted the errors sooner.

Amazing! Thank you for this explanation. Yes, normally I build locally, but it is difficult to test many scenarios and different usage cases.

acassis added 3 commits April 23, 2026 10:27
This driver adds support to MPR121 Capacitive Keypad usually found
at Aliexpress. The MPR121 is a touch sensor chip from Freescale/NXP
that supports up to 12 sensor electrodes and 1 proximity electrode.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit adds support to MPR121 on stm32f4discovery board and a
board config example.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit adds the Documentation to MPR121 Keypad and the board
profile documentation to STM32F4Discovery board.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
Copy link
Copy Markdown
Contributor

@cederom cederom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow great stuff thank you @acassis !! =)

Impact: Some users will be happy :-)

(= THIS IS THE GREATEST IMPACT EVER POSSIBLE =)

@acassis acassis merged commit c476700 into apache:master Apr 23, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Drivers Drivers issues Board: arm Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants