ftsFrame.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * FTS Capacitive touch screen controller (FingerTipS)
  4. *
  5. * Copyright (C) 2016-2019, STMicroelectronics Limited.
  6. * Authors: AMG(Analog Mems Group) <[email protected]>
  7. *
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License version 2 as published by
  11. * the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but WITHOUT
  14. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  16. * more details.
  17. *
  18. * You should have received a copy of the GNU General Public License along with
  19. * this program. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. /**
  22. *
  23. **************************************************************************
  24. ** STMicroelectronics **
  25. **************************************************************************
  26. ** [email protected] **
  27. **************************************************************************
  28. * *
  29. * FTS functions for getting frames *
  30. * *
  31. **************************************************************************
  32. **************************************************************************
  33. */
  34. #ifndef __FTS_FRAME_H
  35. #define __FTS_FRAME_H
  36. #include "ftsSoftware.h"
  37. //Number of data bytes for each node
  38. #define BYTES_PER_NODE 2
  39. #define OFFSET_LENGTH 2
  40. #define FRAME_DATA_HEADER 8
  41. #define FRAME_HEADER_SIGNATURE 0xB5
  42. #define FRAME_DATA_READ_RETRY 2
  43. struct MutualSenseFrame {
  44. struct DataHeader header;
  45. short *node_data;
  46. int node_data_size;
  47. };
  48. struct SelfSenseFrame {
  49. struct DataHeader header;
  50. short *force_data;
  51. short *sense_data;
  52. };
  53. int getOffsetFrame(u16 address, u16 *offset);
  54. int getChannelsLength(void);
  55. int getFrameData(u16 address, int size, short **frame);
  56. int getMSFrame(u16 type, struct MutualSenseFrame *frame, int keep_first_row);
  57. //int getMSKeyFrame(u16 type, short **frame);
  58. //int getSSFrame(u16 type, short **frame);
  59. //int getNmsFrame(u16 type, short ***frames, int * sizes,
  60. //int keep_first_row, int fs, int n);
  61. int getSenseLen(void);
  62. int getForceLen(void);
  63. int requestFrame(u16 type);
  64. int readFrameDataHeader(u16 type, struct DataHeader *header);
  65. int getMSFrame2(u16 type, struct MutualSenseFrame *frame);
  66. int getSSFrame2(u16 type, struct SelfSenseFrame *frame);
  67. #endif