Joystick.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. LUFA Library
  3. Copyright (C) Dean Camera, 2018.
  4. dean [at] fourwalledcubicle [dot] com
  5. www.lufa-lib.org
  6. */
  7. /*
  8. Copyright 2018 Dean Camera (dean [at] fourwalledcubicle [dot] com)
  9. Permission to use, copy, modify, distribute, and sell this
  10. software and its documentation for any purpose is hereby granted
  11. without fee, provided that the above copyright notice appear in
  12. all copies and that both that the copyright notice and this
  13. permission notice and warranty disclaimer appear in supporting
  14. documentation, and that the name of the author not be used in
  15. advertising or publicity pertaining to distribution of the
  16. software without specific, written prior permission.
  17. The author disclaims all warranties with regard to this
  18. software, including all implied warranties of merchantability
  19. and fitness. In no event shall the author be liable for any
  20. special, indirect or consequential damages or any damages
  21. whatsoever resulting from loss of use, data or profits, whether
  22. in an action of contract, negligence or other tortious action,
  23. arising out of or in connection with the use or performance of
  24. this software.
  25. */
  26. /** \file
  27. * \brief LUFA Custom Board Joystick Hardware Driver (Template)
  28. *
  29. * This is a stub driver header file, for implementing custom board
  30. * layout hardware with compatible LUFA board specific drivers. If
  31. * the library is configured to use the BOARD_USER board mode, this
  32. * driver file should be completed and copied into the "/Board/" folder
  33. * inside the application's folder.
  34. *
  35. * This stub is for the board-specific component of the LUFA Joystick
  36. * driver, for a digital four-way (plus button) joystick.
  37. */
  38. #ifndef __JOYSTICK_USER_H__
  39. #define __JOYSTICK_USER_H__
  40. /* Includes: */
  41. // TODO: Add any required includes here
  42. /* Enable C linkage for C++ Compilers: */
  43. #if defined(__cplusplus)
  44. extern "C" {
  45. #endif
  46. /* Preprocessor Checks: */
  47. #if !defined(__INCLUDE_FROM_JOYSTICK_H)
  48. #error Do not include this file directly. Include LUFA/Drivers/Board/Joystick.h instead.
  49. #endif
  50. #define BOARD_DUMMY_JOYSTICK_IMPLEMENTATION
  51. /* Public Interface - May be used in end-application: */
  52. /* Macros: */
  53. /** Mask for the joystick being pushed in the left direction. */
  54. #define JOY_LEFT 0
  55. /** Mask for the joystick being pushed in the right direction. */
  56. #define JOY_RIGHT 0
  57. /** Mask for the joystick being pushed in the upward direction. */
  58. #define JOY_UP 0
  59. /** Mask for the joystick being pushed in the downward direction. */
  60. #define JOY_DOWN 0
  61. /** Mask for the joystick being pushed inward. */
  62. #define JOY_PRESS 0
  63. /* Inline Functions: */
  64. #if !defined(__DOXYGEN__)
  65. static inline void Joystick_Init(void)
  66. {
  67. }
  68. static inline void Joystick_Disable(void)
  69. {
  70. }
  71. static inline uint8_t Joystick_GetStatus(void) ATTR_WARN_UNUSED_RESULT;
  72. static inline uint8_t Joystick_GetStatus(void)
  73. {
  74. return 0;
  75. }
  76. #endif
  77. /* Disable C linkage for C++ Compilers: */
  78. #if defined(__cplusplus)
  79. }
  80. #endif
  81. #endif