touch.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @file
  8. * @brief BSP Touchscreen
  9. *
  10. * This file offers API for basic touchscreen initialization.
  11. * It is useful for users who want to use the touchscreen without the default Graphical Library LVGL.
  12. *
  13. * For standard LCD initialization with LVGL graphical library, you can call all-in-one function bsp_display_start().
  14. */
  15. #pragma once
  16. #include "esp_lcd_touch.h"
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /**
  21. * @brief BSP touch configuration structure
  22. *
  23. */
  24. typedef struct {
  25. void *dummy; /*!< Prepared for future use. */
  26. } bsp_touch_config_t;
  27. /**
  28. * @brief Create new touchscreen
  29. *
  30. * If you want to free resources allocated by this function, you can use esp_lcd_touch API, ie.:
  31. *
  32. * \code{.c}
  33. * esp_lcd_touch_del(tp);
  34. * \endcode
  35. *
  36. * @param[in] config touch configuration
  37. * @param[out] ret_touch esp_lcd_touch touchscreen handle
  38. * @return
  39. * - ESP_OK On success
  40. * - Else esp_lcd_touch failure
  41. */
  42. esp_err_t bsp_touch_new(const bsp_touch_config_t *config, esp_lcd_touch_handle_t *ret_touch);
  43. #ifdef __cplusplus
  44. }
  45. #endif