Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Button-Matrix Demo example for nuttx #1764

Open
tobiasjaster opened this issue May 18, 2023 · 8 comments
Open

Add Button-Matrix Demo example for nuttx #1764

tobiasjaster opened this issue May 18, 2023 · 8 comments

Comments

@tobiasjaster
Copy link

Looking for a suitable implementation to control a matrix keyboard I unfortunately didn't find it anywhere. An example would be nice, how to define GPIOs for Row and Column, if and how to implement an interrupt mode or polling and how to map the corresponding keys to the corresponding characters/actions.

@tobiasjaster
Copy link
Author

Compared to the linux-repository, do I need to port the matrix_keypad.c to nuttx first or can the keyboard_upper/keyboard_lower handle this (I do not see anything like activating/deactivating irq, handle read-out by row-iteration etc.)

@xiaoxiang781216
Copy link
Contributor

Yes, I think it's good addition with the current one button framework.

@acassis
Copy link
Contributor

acassis commented Jun 2, 2023

Nice idea @tobiasjaster !!!
Also adding support to SX1509 chip is a good idea!

@acassis
Copy link
Contributor

acassis commented Jun 2, 2023

@tobiasjaster you cannot port matrix_keypad.c to NuttX because its license is GPL and this license is not compatible with Apache license. You need to "reinvent the wheel".

@tobiasjaster
Copy link
Author

Nice idea @tobiasjaster !!!
Also adding support to SX1509 chip is a good idea!

Hi @acassis , I'm afraid I don't know what you're trying to tell me with the SX1509. Maybe you mean that if I like to have a demo for a matrix keypad, I should take care of it myself? The desire for a demo comes just from the fact that in the nuttx documentation it says that such a thing with the help of "Input Keyboard" now already goes, but I unfortunately could not find out how that can go. Therefore I would like to have some help here. Such a comment helps me here unfortunately less.

@tobiasjaster
Copy link
Author

@tobiasjaster you cannot port matrix_keypad.c to NuttX because its license is GPL and this license is not compatible with Apache license. You need to "reinvent the wheel".

I have also seen the license. Since the GPIOs would have to remain architecture-specific anyway, one must "reinvent" here anyway something in the direction upper/lower. In the upper part the interrupts are activated/deactivated and the logic when reading out the rows for each column and in the lower part the definition of the GPIOs happens together with their control. I am at least in such an implementation for my project. Maybe then a generic implementation can flow into the nuttx-repository.

@acassis
Copy link
Contributor

acassis commented Jun 5, 2023

Nice idea @tobiasjaster !!!
Also adding support to SX1509 chip is a good idea!

Hi @acassis , I'm afraid I don't know what you're trying to tell me with the SX1509. Maybe you mean that if I like to have a demo for a matrix keypad, I should take care of it myself? The desire for a demo comes just from the fact that in the nuttx documentation it says that such a thing with the help of "Input Keyboard" now already goes, but I unfortunately could not find out how that can go. Therefore I would like to have some help here. Such a comment helps me here unfortunately less.

Hi @tobiasjaster sorry to mix the subjects. Yes, I was just commenting that SX1509 is another nice driver to have on NuttX to support keyboards.

@acassis
Copy link
Contributor

acassis commented Jun 5, 2023

@tobiasjaster you cannot port matrix_keypad.c to NuttX because its license is GPL and this license is not compatible with Apache license. You need to "reinvent the wheel".

I have also seen the license. Since the GPIOs would have to remain architecture-specific anyway, one must "reinvent" here anyway something in the direction upper/lower. In the upper part the interrupts are activated/deactivated and the logic when reading out the rows for each column and in the lower part the definition of the GPIOs happens together with their control. I am at least in such an implementation for my project. Maybe then a generic implementation can flow into the nuttx-repository.

@tobiasjaster that will be really nice! This is the kind of contribution that NuttX needs to help more people to use simple matrix keyboards using GPIOs. Please let me know if you need someone to review it. Also I'll love to create a video tutorial about it and release it at NuttX Channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants