stm322xg_eval_ts.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /**
  2. ******************************************************************************
  3. * @file stm322xg_eval_ts.h
  4. * @author MCD Application Team
  5. * @brief This file contains the common defines and functions prototypes for
  6. * the stm322xg_eval_ts.c driver.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
  11. *
  12. * Redistribution and use in source and binary forms, with or without modification,
  13. * are permitted provided that the following conditions are met:
  14. * 1. Redistributions of source code must retain the above copyright notice,
  15. * this list of conditions and the following disclaimer.
  16. * 2. Redistributions in binary form must reproduce the above copyright notice,
  17. * this list of conditions and the following disclaimer in the documentation
  18. * and/or other materials provided with the distribution.
  19. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  20. * may be used to endorse or promote products derived from this software
  21. * without specific prior written permission.
  22. *
  23. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  24. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  25. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  26. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  27. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  28. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  29. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  30. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  31. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  32. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. *
  34. ******************************************************************************
  35. */
  36. /* Define to prevent recursive inclusion -------------------------------------*/
  37. #ifndef __STM322xG_EVAL_TS_H
  38. #define __STM322xG_EVAL_TS_H
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42. /* Includes ------------------------------------------------------------------*/
  43. #include "stm322xg_eval.h"
  44. /* Include IOExpander(STMPE811) component Driver */
  45. #include "../Components/stmpe811/stmpe811.h"
  46. /** @addtogroup BSP
  47. * @{
  48. */
  49. /** @addtogroup STM322xG_EVAL
  50. * @{
  51. */
  52. /** @addtogroup STM322xG_EVAL_TS
  53. * @{
  54. */
  55. /** @defgroup STM322xG_EVAL_TS_Exported_Types STM322xG EVAL TS Exported Types
  56. * @{
  57. */
  58. typedef struct
  59. {
  60. uint16_t TouchDetected;
  61. uint16_t x;
  62. uint16_t y;
  63. uint16_t z;
  64. }TS_StateTypeDef;
  65. /**
  66. * @}
  67. */
  68. /** @defgroup STM322xG_EVAL_TS_Exported_Constants STM322xG EVAL TS Exported Constants
  69. * @{
  70. */
  71. #define TS_SWAP_NONE 0x00
  72. #define TS_SWAP_X 0x01
  73. #define TS_SWAP_Y 0x02
  74. #define TS_SWAP_XY 0x04
  75. typedef enum
  76. {
  77. TS_OK = 0x00,
  78. TS_ERROR = 0x01,
  79. TS_TIMEOUT = 0x02
  80. }TS_StatusTypeDef;
  81. /**
  82. * @}
  83. */
  84. /** @defgroup STM322xG_EVAL_TS_Exported_Functions STM322xG EVAL TS Exported Functions
  85. * @{
  86. */
  87. uint8_t BSP_TS_Init(uint16_t xSize, uint16_t ySize);
  88. uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State);
  89. uint8_t BSP_TS_ITConfig(void);
  90. uint8_t BSP_TS_ITGetStatus(void);
  91. void BSP_TS_ITClear(void);
  92. /**
  93. * @}
  94. */
  95. /**
  96. * @}
  97. */
  98. /**
  99. * @}
  100. */
  101. /**
  102. * @}
  103. */
  104. #ifdef __cplusplus
  105. }
  106. #endif
  107. #endif /* __STM322xG_EVAL_TS_H */
  108. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/