Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pmw3360.h 539B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * pmw3360.h
  3. */
  4. #ifndef __PMW3360_H__
  5. #define __PMW3360_H__
  6. struct pmw_motion {
  7. bool motion;
  8. int32_t delta_x;
  9. int32_t delta_y;
  10. };
  11. int pmw_init(void);
  12. struct pmw_motion pmw_get(void);
  13. /*
  14. * 0x00: 100 cpi (minimum cpi)
  15. * 0x01: 200 cpi
  16. * 0x02: 300 cpi
  17. * ...
  18. * 0x31: 5000 cpi (default cpi)
  19. * ...
  20. * 0x77: 12000 cpi (maximum cpi)
  21. */
  22. void pmw_set_sensitivity(uint8_t sens);
  23. uint8_t pmw_get_sensitivity(void);
  24. #define PMW_SENSE_TO_CPI(sense) (100 + (sense * 100))
  25. void pmw_print_status(void);
  26. #endif // __PMW3360_H__