Jump to content

Keyboard matrix


tubbutec

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

Functions

select_row(uint8_t row)

deselect_row(uint8_t row)

read_column()

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:

(1)

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

#define KEY_MATRIX_ROWS 8
#define KEY_MATRIX_COLS 8

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?

(2)

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 :)

ugfx_key_matrix_early_beta.zip

Link to comment
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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...