st1663i.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-04-11 Wayne the first version
  9. */
  10. #ifndef __ST1663I_H__
  11. #define __ST1663I_H__
  12. #include "touch.h"
  13. #define ST_REGITER_LEN 1
  14. #define ST_MAX_TOUCH 5
  15. #define ST1663I_ADDRESS 0x55
  16. #pragma anon_unions
  17. typedef struct
  18. {
  19. //012H*n+0 (n=0, 1, ...,4)
  20. union
  21. {
  22. uint8_t m_u8XY0_H;
  23. struct
  24. {
  25. uint8_t u8Y0_H: 3;
  26. uint8_t : 1;
  27. uint8_t u8X0_H: 3;
  28. uint8_t u8Valid: 1;
  29. };
  30. };
  31. //012H*n+1 (n=0, 1, ...,4)
  32. uint8_t m_u8X0_L;
  33. //012H*n+2 (n=0, 1, ...,4)
  34. uint8_t m_u8Y0_L;
  35. //012H*n+3 (n=0, 1, ...,4)
  36. uint8_t m_u8Z;
  37. } S_ST_TP;
  38. #pragma pack(push)
  39. #pragma pack(4)
  40. typedef struct
  41. {
  42. union
  43. {
  44. uint8_t m_u8TouchInfo;
  45. struct
  46. {
  47. uint8_t u8Fingers: 4;
  48. uint8_t : 4;
  49. };
  50. };
  51. uint8_t m_u8Keys;
  52. S_ST_TP m_sTP[ST_MAX_TOUCH];
  53. } S_ST_REGMAP;
  54. #pragma pack(pop)
  55. int rt_hw_st1663i_init(const char *name, struct rt_touch_config *cfg);
  56. #endif /* __ST1663I_H__ */