gt9xx.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * File : gt9xx.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program 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 General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2017-01-01 Urey first version
  23. */
  24. #ifndef _GT9XX_H_
  25. #define _GT9XX_H_
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. #include <rtdevice.h>
  30. #include <rtthread.h>
  31. #define GT910_ADDR_BABBH
  32. //#define GT910_ADDR_2829H
  33. #ifdef GT910_ADDR_BABBH
  34. #define GT910_IIC_ADDR 0x14//0x14//0x5D//
  35. //#define GT910_IIC_RADDR 0x29
  36. //#define GT910_IIC_WADDR 0x28
  37. #else
  38. #define GT910_IIC_RADDR 0x29
  39. #define GT910_IIC_WADDR 0x28
  40. #endif
  41. extern uint16_t show_len;
  42. extern uint16_t total_len;
  43. extern uint8_t gtp_rawdiff_mode;
  44. extern int tpd_halt;
  45. extern int gtp_send_cfg(struct rt_i2c_bus_device *i2c);
  46. extern void gtp_reset_guitar(struct rt_i2c_bus_device *i2c, int ms);
  47. extern void gtp_int_sync(int ms);
  48. extern uint8_t gup_init_update_proc(struct rt_i2c_bus_device *i2c);
  49. extern uint8_t gup_init_fw_proc(struct rt_i2c_bus_device *i2c);
  50. extern int gtp_i2c_read(struct rt_i2c_bus_device *i2c, uint8_t *buf, int len);
  51. extern int gtp_i2c_write(struct rt_i2c_bus_device *i2c,uint8_t *buf,int len);
  52. extern int i2c_write_bytes(struct rt_i2c_bus_device *i2c, uint16_t addr, uint8_t *txbuf, int len);
  53. extern int i2c_read_bytes(struct rt_i2c_bus_device *i2c, uint16_t addr, uint8_t *rxbuf, int len);
  54. extern int i2c_read_dbl_check(struct rt_i2c_bus_device *i2c, uint16_t addr, uint8_t *rxbuf, int len);
  55. extern int gtp_i2c_read_dbl_check(struct rt_i2c_bus_device *i2c, uint16_t addr, uint8_t *rxbuf, int len);
  56. extern void mt65xx_eint_unmask(uint32_t line);
  57. extern void mt65xx_eint_mask(uint32_t line);
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61. #endif /* _GT9XX_H_ */