pat9125.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef PAT9125_H
  2. #define PAT9125_H
  3. //PAT9125 I2C
  4. #define PAT9125_I2C_ADDR 0x75 //ID=LO
  5. //#define PAT9125_I2C_ADDR 0x79 //ID=HI
  6. //#define PAT9125_I2C_ADDR 0x73 //ID=NC
  7. //PAT9125 registers
  8. #define PAT9125_PID1 0x00
  9. #define PAT9125_PID2 0x01
  10. #define PAT9125_MOTION 0x02
  11. #define PAT9125_DELTA_XL 0x03
  12. #define PAT9125_DELTA_YL 0x04
  13. #define PAT9125_MODE 0x05
  14. #define PAT9125_CONFIG 0x06
  15. #define PAT9125_WP 0x09
  16. #define PAT9125_SLEEP1 0x0a
  17. #define PAT9125_SLEEP2 0x0b
  18. #define PAT9125_RES_X 0x0d
  19. #define PAT9125_RES_Y 0x0e
  20. #define PAT9125_DELTA_XYH 0x12
  21. #define PAT9125_SHUTTER 0x14
  22. #define PAT9125_FRAME 0x17
  23. #define PAT9125_ORIENTATION 0x19
  24. #define PAT9125_BANK_SELECTION 0x7f
  25. extern unsigned char pat9125_PID1;
  26. extern unsigned char pat9125_PID2;
  27. extern int pat9125_x;
  28. extern int pat9125_y;
  29. extern unsigned char pat9125_b;
  30. extern unsigned char pat9125_s;
  31. extern int pat9125_init();
  32. extern int pat9125_update();
  33. extern int pat9125_update_y();
  34. extern unsigned char pat9125_rd_reg(unsigned char addr);
  35. extern void pat9125_wr_reg(unsigned char addr, unsigned char data);
  36. extern bool pat9125_wr_reg_verify(unsigned char addr, unsigned char data);
  37. #endif //PAT9125_H