touchscreen.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2019 Clementine Computing LLC.
  3. *
  4. * This file is part of PopuFare.
  5. *
  6. * PopuFare is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU Affero General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * PopuFare is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Affero General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Affero General Public License
  17. * along with PopuFare. If not, see <https://www.gnu.org/licenses/>.
  18. *
  19. */
  20. #ifndef _TOUCHSCREEN_H
  21. #define _TOUCHSCREEN_H
  22. #define XRES (640)
  23. #define YRES (480)
  24. #define PIXELS (XRES * YRES)
  25. void begin_touchscreen_calibration(void);
  26. void draw_touchscreen_calibration(void);
  27. int advance_touchscreen_calibration(int raw_x, int raw_y, int down);
  28. int translate_ts_x(unsigned rawx);
  29. int translate_ts_y(unsigned rawy);
  30. #endif