Jump to content
Sign in to follow this  

Keyboard matrix

Recommended Posts

Hi I am working on an implementation of a keyboard matrix input.

It works and I would like to contribute it to ugfx, but as I am very new to its architecture and don't understand every aspect, I am sure some things need to be changed...

The driver takes care of selecting row lines, reading the corresponding column. It performs debouncing and manages the event stuff.

Limitations so far:

-Only one instance is supported.

-Maximum column width is 8, but this can be changed easily by replacing a uint8_t with an uint16_t


select_row(uint8_t row)

deselect_row(uint8_t row)


need to be defined in the board file, I also attached an example which is running on my STM32F4

I do have a couple of questions:


I have some defines that contain the number of rows and columns in the matrix:


Naturally I would place this into the board file, as this is very board specific, but it is also needed in the high level driver (key_matrix.c)

Which is the right place to define these constants?


Did I correctly implement the event handling?

it does work, but it is all very new to me..

Thanks a lot and I hope someone else can use this :)


Share this post

Link to post
Share on other sites

I haven't had any time to take a closer look at the driver yet. I don't even have such a key pad. However, we will take a look at your work and include it into the repository.

Maybe somebody else will have time to give this a try :)

Anyway, thank you very much for your contribution, we appreciate it a lot as things like this help to not only push the project forward but also to build up an active community.

Edit: inmarket is currently working on the keyboard part of the GINPUT driver. As this would be used with that keyboard driver he'll take a look.

~ Tectu

Share this post

Link to post
Share on other sites
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...