No Description
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_registers.h 3.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * pmw3360_registers.h
  3. *
  4. * Copyright (c) 2022 - 2023 Thomas Buck (thomas@xythobuz.de)
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * See <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef __PMW3360_REGISTERS_H__
  19. #define __PMW3360_REGISTERS_H__
  20. #define REG_PRODUCT_ID 0x00
  21. #define REG_REVISION_ID 0x01
  22. #define REG_MOTION 0x02
  23. #define REG_DELTA_X_L 0x03
  24. #define REG_DELTA_X_H 0x04
  25. #define REG_DELTA_Y_L 0x05
  26. #define REG_DELTA_Y_H 0x06
  27. #define REG_SQUAL 0x07
  28. #define REG_RAW_DATA_SUM 0x08
  29. #define REG_MAXIMUM_RAW_DATA 0x09
  30. #define REG_MINIMUM_RAW_DATA 0x0A
  31. #define REG_SHUTTER_LOWER 0x0B
  32. #define REG_SHUTTER_UPPER 0x0C
  33. #define REG_CONTROL 0x0D
  34. #define REG_CONFIG1 0x0F
  35. #define REG_CONFIG2 0x10
  36. #define REG_ANGLE_TUNE 0x11
  37. #define REG_FRAME_CAPTURE 0x12
  38. #define REG_SROM_ENABLE 0x13
  39. #define REG_RUN_DOWNSHIFT 0x14
  40. #define REG_REST1_RATE_LOWER 0x15
  41. #define REG_REST1_RATE_UPPER 0x16
  42. #define REG_REST1_DOWNSHIFT 0x17
  43. #define REG_REST2_RATE_LOWER 0x18
  44. #define REG_REST2_RATE_UPPER 0x19
  45. #define REG_REST2_DOWNSHIFT 0x1A
  46. #define REG_REST3_RATE_LOWER 0x1B
  47. #define REG_REST3_RATE_UPPER 0x1C
  48. #define REG_OBSERVATION 0x24
  49. #define REG_DATA_OUT_LOWER 0x25
  50. #define REG_DATA_OUT_UPPER 0x26
  51. #define REG_RAW_DATA_DUMP 0x29
  52. #define REG_SROM_ID 0x2A
  53. #define REG_MIN_SQ_RUN 0x2B
  54. #define REG_RAW_DATA_THRESHOLD 0x2C
  55. #define REG_CONFIG5 0x2F
  56. #define REG_POWER_UP_RESET 0x3A
  57. #define REG_SHUTDOWN 0x3B
  58. #define REG_INVERSE_PRODUCT_ID 0x3F
  59. #define REG_LIFTCUTOFF_TUNE3 0x41
  60. #define REG_ANGLE_SNAP 0x42
  61. #define REG_LIFTCUTOFF_TUNE1 0x4A
  62. #define REG_MOTION_BURST 0x50
  63. #define REG_LIFTCUTOFF_TUNE_TIMEOUT 0x58
  64. #define REG_LIFTCUTOFF_TUNE_MIN_LENGTH 0x5A
  65. #define REG_SROM_LOAD_BURST 0x62
  66. #define REG_LIFT_CONFIG 0x63
  67. #define REG_RAW_DATA_BURST 0x64
  68. #define REG_LIFTCUTOFF_TUNE2 0x65
  69. #define WRITE_BIT 0x80
  70. #define REG_MOTION_MOT 7
  71. #define REG_MOTION_LIFT 3
  72. #define REG_MOTION_OP_1 1
  73. #define REG_MOTION_OP_2 2
  74. struct pmw_motion_report {
  75. uint8_t motion;
  76. uint8_t observation;
  77. uint8_t delta_x_l;
  78. uint8_t delta_x_h;
  79. uint8_t delta_y_l;
  80. uint8_t delta_y_h;
  81. uint8_t squal;
  82. uint8_t raw_data_sum;
  83. uint8_t maximum_raw_data;
  84. uint8_t minimum_raw_data;
  85. uint8_t shutter_upper;
  86. uint8_t shutter_lower;
  87. } __attribute__((packed));
  88. #endif // __PMW3360_REGISTERS_H__