pat9125.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 int pat9125_x;
  27. extern int pat9125_y;
  28. extern int pat9125_b;
  29. extern int pat9125_init(unsigned char xres, unsigned char yres);
  30. extern int pat9125_update();
  31. extern unsigned char pat9125_rd_reg(unsigned char addr);
  32. extern void pat9125_wr_reg(unsigned char addr, unsigned char data);
  33. #endif //PAT9125_H