pat9125.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. extern unsigned char pat9125_PID1;
  25. extern unsigned char pat9125_PID2;
  26. extern unsigned char pat9125_xres;
  27. extern unsigned char pat9125_yres;
  28. extern int pat9125_x;
  29. extern int pat9125_y;
  30. extern unsigned char pat9125_b;
  31. extern unsigned char pat9125_s;
  32. extern int pat9125_init(unsigned char xres, unsigned char yres);
  33. extern int pat9125_update();
  34. extern int pat9125_update_y();
  35. extern unsigned char pat9125_rd_reg(unsigned char addr);
  36. extern void pat9125_wr_reg(unsigned char addr, unsigned char data);
  37. #endif //PAT9125_H