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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. /* Copyright (C) 2013 Kristian Lauszus, TKJ Electronics. All rights reserved.
  2. This software may be distributed and modified under the terms of the GNU
  3. General Public License version 2 (GPL2) as published by the Free Software
  4. Foundation and appearing in the file GPL2.TXT included in the packaging of
  5. this file. Please note that GPL2 Section 2[b] requires that all works based
  6. on this software must also be made publicly available under the terms of
  7. the GPL2 ("Copyleft").
  8. Contact information
  9. -------------------
  10. Kristian Lauszus, TKJ Electronics
  11. Web : http://www.tkjelectronics.com
  12. e-mail : [email protected]
  13. */
  14. #ifndef _controllerenums_h
  15. #define _controllerenums_h
  16. /**
  17. * This header file is used to store different enums for the controllers,
  18. * This is necessary so all the different libraries can be used at once.
  19. */
  20. /** Enum used to turn on the LEDs on the different controllers. */
  21. enum LEDEnum {
  22. OFF = 0,
  23. LED1 = 1,
  24. LED2 = 2,
  25. LED3 = 3,
  26. LED4 = 4,
  27. LED5 = 5,
  28. LED6 = 6,
  29. LED7 = 7,
  30. LED8 = 8,
  31. LED9 = 9,
  32. LED10 = 10,
  33. /** Used to blink all LEDs on the Xbox controller */
  34. ALL = 5,
  35. };
  36. /** Used to set the colors of the Move and PS4 controller. */
  37. enum ColorsEnum {
  38. /** r = 255, g = 0, b = 0 */
  39. Red = 0xFF0000,
  40. /** r = 0, g = 255, b = 0 */
  41. Green = 0xFF00,
  42. /** r = 0, g = 0, b = 255 */
  43. Blue = 0xFF,
  44. /** r = 255, g = 235, b = 4 */
  45. Yellow = 0xFFEB04,
  46. /** r = 0, g = 255, b = 255 */
  47. Lightblue = 0xFFFF,
  48. /** r = 255, g = 0, b = 255 */
  49. Purble = 0xFF00FF,
  50. /** r = 255, g = 255, b = 255 */
  51. White = 0xFFFFFF,
  52. /** r = 0, g = 0, b = 0 */
  53. Off = 0x00,
  54. };
  55. enum RumbleEnum {
  56. RumbleHigh = 0x10,
  57. RumbleLow = 0x20,
  58. };
  59. /** This enum is used to read all the different buttons on the different controllers */
  60. enum ButtonEnum {
  61. /**@{*/
  62. /** These buttons are available on all the the controllers */
  63. UP = 0,
  64. RIGHT = 1,
  65. DOWN = 2,
  66. LEFT = 3,
  67. /**@}*/
  68. /**@{*/
  69. /** Wii buttons */
  70. PLUS = 5,
  71. TWO = 6,
  72. ONE = 7,
  73. MINUS = 8,
  74. HOME = 9,
  75. Z = 10,
  76. C = 11,
  77. B = 12,
  78. A = 13,
  79. /**@}*/
  80. /**@{*/
  81. /** These are only available on the Wii U Pro Controller */
  82. L = 16,
  83. R = 17,
  84. ZL = 18,
  85. ZR = 19,
  86. /**@}*/
  87. /**@{*/
  88. /** PS3 controllers buttons */
  89. SELECT = 4,
  90. START = 5,
  91. L3 = 6,
  92. R3 = 7,
  93. L2 = 8,
  94. R2 = 9,
  95. L1 = 10,
  96. R1 = 11,
  97. TRIANGLE = 12,
  98. CIRCLE = 13,
  99. CROSS = 14,
  100. SQUARE = 15,
  101. PS = 16,
  102. MOVE = 17, // Covers 12 bits - we only need to read the top 8
  103. T = 18, // Covers 12 bits - we only need to read the top 8
  104. /**@}*/
  105. /** PS4 controllers buttons - SHARE and OPTIONS are present instead of SELECT and START */
  106. SHARE = 4,
  107. OPTIONS = 5,
  108. TOUCHPAD = 17,
  109. /**@}*/
  110. /**@{*/
  111. /** Xbox buttons */
  112. BACK = 4,
  113. X = 14,
  114. Y = 15,
  115. XBOX = 16,
  116. SYNC = 17,
  117. BLACK = 8, // Available on the original Xbox controller
  118. WHITE = 9, // Available on the original Xbox controller
  119. /**@}*/
  120. /** PS Buzz controllers */
  121. RED = 0,
  122. YELLOW = 1,
  123. GREEN = 2,
  124. ORANGE = 3,
  125. BLUE = 4,
  126. /**@}*/
  127. };
  128. /** Joysticks on the PS3 and Xbox controllers. */
  129. enum AnalogHatEnum {
  130. /** Left joystick x-axis */
  131. LeftHatX = 0,
  132. /** Left joystick y-axis */
  133. LeftHatY = 1,
  134. /** Right joystick x-axis */
  135. RightHatX = 2,
  136. /** Right joystick y-axis */
  137. RightHatY = 3,
  138. };
  139. /**
  140. * Sensors inside the Sixaxis Dualshock 3, Move controller and PS4 controller.
  141. * <B>Note:</B> that the location is shifted 9 when it's connected via USB on the PS3 controller.
  142. */
  143. enum SensorEnum {
  144. /** Accelerometer values */
  145. aX = 50, aY = 52, aZ = 54,
  146. /** Gyro z-axis */
  147. gZ = 56,
  148. gX, gY, // These are not available on the PS3 controller
  149. /** Accelerometer x-axis */
  150. aXmove = 28,
  151. /** Accelerometer z-axis */
  152. aZmove = 30,
  153. /** Accelerometer y-axis */
  154. aYmove = 32,
  155. /** Gyro x-axis */
  156. gXmove = 40,
  157. /** Gyro z-axis */
  158. gZmove = 42,
  159. /** Gyro y-axis */
  160. gYmove = 44,
  161. /** Temperature sensor */
  162. tempMove = 46,
  163. /** Magnetometer x-axis */
  164. mXmove = 47,
  165. /** Magnetometer z-axis */
  166. mZmove = 49,
  167. /** Magnetometer y-axis */
  168. mYmove = 50,
  169. };
  170. /** Used to get the angle calculated using the PS3 controller and PS4 controller. */
  171. enum AngleEnum {
  172. Pitch = 0x01,
  173. Roll = 0x02,
  174. };
  175. #endif