touch_sw.h 961 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**************************************************************************//**
  2. *
  3. * @copyright (C) 2019 Nuvoton Technology Corp. All rights reserved.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0
  6. *
  7. * Change Logs:
  8. * Date Author Notes
  9. * 2022-2-21 Wayne First version
  10. *
  11. ******************************************************************************/
  12. #ifndef __TOUCH_SW_H__
  13. #define __TOUCH_SW_H__
  14. #include <rtthread.h>
  15. #include "touch.h"
  16. typedef enum
  17. {
  18. evXL, //X-
  19. evYU, //Y-
  20. evXR, //X+
  21. evYD, //Y+
  22. evTOUCH_PIN_CNT
  23. } E_TOUCH_PIN;
  24. typedef struct
  25. {
  26. char *adc_name;
  27. rt_device_t adc;
  28. int i32ADCChnYU;
  29. int i32ADCChnXR;
  30. rt_touch_t psRtTouch;
  31. rt_base_t pin[evTOUCH_PIN_CNT];
  32. void (*switch_to_analog)(rt_base_t pin);
  33. void (*switch_to_digital)(rt_base_t pin);
  34. } S_TOUCH_SW;
  35. rt_err_t nu_adc_touch_sw_register(S_TOUCH_SW *psTouchSW);
  36. #endif /* __TOUCH_SW_H__ */