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

Define Panels with multiple Touch input device #585

Closed
jgauchia opened this issue Jul 4, 2024 · 6 comments
Closed

Define Panels with multiple Touch input device #585

jgauchia opened this issue Jul 4, 2024 · 6 comments
Labels
device support request Add new device driver stale Inactive issues

Comments

@jgauchia
Copy link

jgauchia commented Jul 4, 2024

Hi!
I've a question. (Maybe I don't know how to do it)

It's possible to define panels (TFT) with different touch input devices?
This is. I need to define TFT but I need to define the touch controller separately.

Thank you

@jgauchia jgauchia added the device support request Add new device driver label Jul 4, 2024
@tobozo
Copy link
Collaborator

tobozo commented Jul 4, 2024

hi,

do you mean a second touch controller (if so, please specify the geometry) or just a single touch controller running from a different driver ?

@jgauchia
Copy link
Author

jgauchia commented Jul 4, 2024

hi,

do you mean a second touch controller (if so, please specify the geometry) or just a single touch controller running from a different driver ?

sorry, my english isn't good.

I mean one tft driver definition only and for the touch controller another one. that is... an example

Driver ILI9488 only definition of panel (SPI , Parallel ... etc..)
Touch: (for example)

  • XPT2046 another include for definition
  • FT6236 the same

The goal is define the TFT panel with one include and the input part (touch, etc,..) in other because there are many types of them

@tobozo
Copy link
Collaborator

tobozo commented Jul 4, 2024

if you wish to support multiple touch devices in your project, but only need to enable one of them (no concurrency), then you can try this:

#define USE_XPT2046 true
#define USE_FT5x06 false

class LGFX : public lgfx::LGFX_Device
{
  lgfx::Bus_SPI       _bus_instance;
  lgfx::Panel_ILI9499 _panel_instance;

  lgfx::Touch_FT5x06  _touch_instance_FT5x06; 
  lgfx::Touch_XPT2046 _touch_instance_XPT2046; 

  public:
    LGFX(void)
    {

      // (... ) bus and panel config block

      // (...) FT6236 config block without  _panel_instance.setTouch()

      // (...) XPT2046 config block without  _panel_instance.setTouch()

      if( USE_XPT2046 ) 
        _panel_instance.setTouch(&_touch_instance_XPT2046 );  
      else if( USE_FT5x06 ) 
        _panel_instance.setTouch(&_touch_instance_FT5x06);

      setPanel(&_panel_instance);
    }
};

@jgauchia
Copy link
Author

jgauchia commented Jul 4, 2024

if you wish to support multiple touch devices in your project, but only need to enable one of them (no concurrency), then you can try this:

#define USE_XPT2046 true
#define USE_FT5x06 false

class LGFX : public lgfx::LGFX_Device
{
  lgfx::Bus_SPI       _bus_instance;
  lgfx::Panel_ILI9499 _panel_instance;

  lgfx::Touch_FT5x06  _touch_instance_FT5x06; 
  lgfx::Touch_XPT2046 _touch_instance_XPT2046; 

  public:
    LGFX(void)
    {

      // (... ) bus and panel config block

      // (...) FT6236 config block without  _panel_instance.setTouch()

      // (...) XPT2046 config block without  _panel_instance.setTouch()

      if( USE_XPT2046 ) 
        _panel_instance.setTouch(&_touch_instance_XPT2046 );  
      else if( USE_FT5x06 ) 
        _panel_instance.setTouch(&_touch_instance_FT5x06);

      setPanel(&_panel_instance);
    }
};

Thank you!

Copy link

github-actions bot commented Aug 3, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Inactive issues label Aug 3, 2024
Copy link

This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
device support request Add new device driver stale Inactive issues
Projects
None yet
Development

No branches or pull requests

2 participants