FelipeMdeO opened a new pull request, #18368:
URL: https://github.com/apache/nuttx/pull/18368

   *Note: Please adhere to [Contributing 
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   ## Summary
   
   Add a generic keyboard matrix (kmatrix) lower-half driver with 
polling/debounce, plus an STM32 GPIO board adapter and public API to expose 
`/dev/kbdN`. Include a 4x3 keypad keymap example and documentation/test helper.
   I2C interface to used keypad was done but not tested yet.
   The IRQ feature will be done as soon as possible. This is a first step 
development.
   
   This change solve this request: 
https://github.com/apache/nuttx-apps/issues/1764
   
   Please @acassis , help me to verify if I followed all standards.
   
   ## Impact
   
   Optional input driver; no behavior change unless enabled. Enabling kmatrix 
adds periodic GPIO scanning and keyboard events on `/dev/kbd0`.
   
   ## Testing
   
   Host: Ubuntu 24.04.3 LTS x86_64.
   Board: STM32F4Discovery + 4x3 membrane keypad (GPIO). See picture of keypad 
used below:
   <img width="380" height="315" alt="image" 
src="https://github.com/user-attachments/assets/8bb9bab6-2c14-4c8a-8baa-122ee79ce6c6";
 />
   
   Build: `stm32f4discovery:nsh` with:
   - `CONFIG_INPUT=y`
   - `CONFIG_INPUT_KMATRIX=y`
   - `CONFIG_EXAMPLES_KEYBOARD=y`
   - `CONFIG_EXAMPLES_KEYBOARD_DEVPATH="/dev/kbd0"`
   - `CONFIG_INPUT_KMATRIX_POLL_MS=10` (default)
   - `CONFIG_INPUT_KMATRIX_DEBOUNCE=3` (default)
   - `CONFIG_INPUT_KMATRIX_BUFSIZE=64` (default)
   
   Runtime: Ran `kbd` and observed key press/release events.
   Logs:
   
   ```
   nsh> kbd
   kbd_main: nsamples: 0
   kbd_main: Opening /dev/kbd0
   Sample :
   code : 49
   type : 0
   Sample :
   code : 49
   type : 1
   Sample :
   code : 50
   type : 0
   Sample :
   code : 50
   type : 1
   Sample :
   code : 51
   type : 0
   Sample :
   code : 51
   type : 1
   Sample :
   code : 52
   type : 0
   Sample :
   code : 52
   type : 1
   Sample :
   code : 53
   type : 0
   Sample :
   code : 53
   type : 1
   Sample :
   code : 54
   type : 0
   Sample :
   code : 54
   type : 1
   Sample :
   code : 55
   type : 0
   Sample :
   code : 55
   type : 1
   Sample :
   code : 56
   type : 0
   Sample :
   code : 56
   type : 1
   Sample :
   code : 57
   type : 0
   Sample :
   code : 57
   type : 1
   Sample :
   code : 42
   type : 0
   Sample :
   code : 42
   type : 1
   Sample :
   code : 48
   type : 0
   Sample :
   code : 48
   type : 1
   Sample :
   code : 35
   type : 0
   Sample :
   code : 35
   type : 1
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to