Nessuna descrizione
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 612B

1234567891011121314151617181920212223242526272829303132333435
  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. bool pmw_is_alive(void);
  13. struct pmw_motion pmw_get(void);
  14. /*
  15. * 0x00: 100 cpi (minimum cpi)
  16. * 0x01: 200 cpi
  17. * 0x02: 300 cpi
  18. * ...
  19. * 0x31: 5000 cpi (default cpi)
  20. * ...
  21. * 0x77: 12000 cpi (maximum cpi)
  22. */
  23. void pmw_set_sensitivity(uint8_t sens);
  24. uint8_t pmw_get_sensitivity(void);
  25. #define PMW_SENSE_TO_CPI(sense) (100 + (sense * 100))
  26. #define PMW_CPI_TO_SENSE(cpi) ((cpi / 100) - 1)
  27. void pmw_print_status(void);
  28. #endif // __PMW3360_H__