Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Beginning touch support#134

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
KurtE wants to merge1 commit intoarduino:arduino
base:arduino
Choose a base branch
Loading
fromKurtE:giga_display_callback

Conversation

KurtE
Copy link

@KurtEKurtE commentedJun 5, 2025
edited
Loading

Add a callback function for the touch device
within the fixups for the GIGA. This callback
simply remembers the last touch that happened and
sets a semaphore.

There is also a function added to retrieve this data.

Needed to add the callback function into the exports file.

EDIT: As I mentioned in
#92

This is maybe not a complete setup yet. Currently the zephyr touch device is configured for only one touch
Where it believe is supposed to support up to 5. Also with it only doing one touch, it does not support
gestures. I will integrate our WIP touch code into the Arduino_GIGATouch library such that it is all
available for us or others to fill this in.

mjs513 reacted with thumbs up emoji
@KurtE
Copy link
Author

Wondering, an alternative implementation for this would be instead of having a handler here, that
receives all of the messages and creates a simple record of X, y, ... Instead just have method which sets
the call back function. Which is set the callback we define here simply calls it...

void (*user_callback)(struct input_event *evt, void *user_data) = 0;void touch_event_callback(struct input_event *evt, void *user_data){    //printk("touch_event_callback(%p %p): %p %u %u %u %d\n", evt, user_data,    if (user_callback) (*user_callback)(evt, user_data);}...Or could do combination of both....Thoughts?

@KurtE
Copy link
Author

KurtE commentedJun 6, 2025
edited
Loading

Talking to self (and maybe others)

In certain ways, I think the idea of setting a callback function like I mentioned in the previous comment, might make sense,

but one thing (of many) I don't understand, is how to do that in a safe way. That is Suppose, I setup and run our example Touch Paint sketch, which registers it's callback. Then suppose I decide to run some simple sketch like blink. After Blink loads, my guess is that the callback pointer would be set to wherever it was in the previous sketch, and if the user touches the screen, we will
call off to potential garbage...

Or is there some method we call at sketch startup that can clear the callback(s)...

EDIT: One option, is maybe add the InitVariant for the GIGA, and set it to NULL at that point...

@KurtEKurtEforce-pushed thegiga_display_callback branch from13960d6 toa046e8dCompareJune 11, 2025 21:47
@KurtEKurtEforce-pushed thegiga_display_callback branch 5 times, most recently from89d3fd5 to7abe8c3CompareJune 18, 2025 12:33
KurtE added a commit to KurtE/zephyr that referenced this pull requestJun 22, 2025
Currently the config option:CONFIG_INPUT_GT911_MAX_TOUCH_POINTSis not defined for the Giga display shield and defaultsto 1.   The valid range is 1-5, I have done most of myown testing using 3 with the ArduinoGiga-zephyrI have a PR against the ArduinoCore-zephyr projectwhich allows me to define a callback in the Arduinosystem:arduino/ArduinoCore-zephyr#134And a version of the Arduino touch library with somesupport, the fork/branchhttps://github.com/KurtE/Arduino_GigaDisplayTouch/tree/zephyrAnd an example sketch that does touch paint.arduino/ArduinoCore-zephyr#92 (comment)Note: my version of the Arduino touch library has no support for gesturesSigned-off-by: Kurt Eckhardt <kurte@rockisland.com>
KurtE added a commit to KurtE/zephyr that referenced this pull requestJun 22, 2025
Currently the config option:CONFIG_INPUT_GT911_MAX_TOUCH_POINTSis not defined for the Giga display shield and defaultsto 1.   The valid range is 1-5, I have done most of myown testing using 3 with the ArduinoGiga-zephyrI have a PR against the ArduinoCore-zephyr projectwhich allows me to define a callback in the Arduinosystem:arduino/ArduinoCore-zephyr#134And a version of the Arduino touch library with somesupport, the fork/branchhttps://github.com/KurtE/Arduino_GigaDisplayTouch/tree/zephyrAnd an example sketch that does touch paint.arduino/ArduinoCore-zephyr#92 (comment)Note: my version of the Arduino touch library has no supportfor gesturesSigned-off-by: Kurt Eckhardt <kurte@rockisland.com>
@KurtEKurtEforce-pushed thegiga_display_callback branch from7abe8c3 to135693dCompareJune 24, 2025 18:32
@KurtE
Copy link
Author

KurtE commentedJun 24, 2025
edited
Loading

@ALL - I cleaned up some of the code in this PR to cleanup which CONFIG_ the code is under for touch.

Instead of VIDEO (which is for camera) it uses CONFIG_INPUT_GT911_INTERRUPT

Warning these fixes also included fixes that allow the GC2145 camera to work on Portenta H7.

Let me know if there is anything you think that should be changed.

…er in fixups.Added the ability to register a callback function to be called by the zephyr inputsystem.This new code is only there if it is a GIGA and CONFIG_INPUT_GT911_INTERRUPT is defined.This includes adding a callback function that is linked in to the zephyr build,  and exporta function to call to allow us to register our own.Added an init variant to GIGA that if the touch interrupt is enabled, then it will clear out the old user definedcallback if any.This version also added in the changes to fixups that allow a camera to work on Portenta H7.Needed to have it do the same as GIGA to start the PWM if INPUT is configured in.And updated the portentas remote_endpoint define to be using the same format as used in the giga overlayAlso changed to STM32_DMA_FIFO_1-4, like the GIGA currently hasUpdate arduino_portenta_h7_stm32h747xx_m7.overlay
@KurtEKurtEforce-pushed thegiga_display_callback branch from135693d to6e05523CompareJune 24, 2025 18:48
dkalowsk pushed a commit to zephyrproject-rtos/zephyr that referenced this pull requestJun 25, 2025
Currently the config option:CONFIG_INPUT_GT911_MAX_TOUCH_POINTSis not defined for the Giga display shield and defaultsto 1.   The valid range is 1-5, I have done most of myown testing using 3 with the ArduinoGiga-zephyrI have a PR against the ArduinoCore-zephyr projectwhich allows me to define a callback in the Arduinosystem:arduino/ArduinoCore-zephyr#134And a version of the Arduino touch library with somesupport, the fork/branchhttps://github.com/KurtE/Arduino_GigaDisplayTouch/tree/zephyrAnd an example sketch that does touch paint.arduino/ArduinoCore-zephyr#92 (comment)Note: my version of the Arduino touch library has no supportfor gesturesSigned-off-by: Kurt Eckhardt <kurte@rockisland.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@KurtE

[8]ページ先頭

©2009-2025 Movatter.jp