97 #include "Max3421e_constants.h"
151 #define USBJOYSTICK_NUM_STICKS 4
152 #define USBJOYSTICK_NUM_BUTTONS 13
153 #define USBJOYSTICK_NUM_HATS 1
156 #define USBJOYSTICK_STICK_LEFT_HORIZ 0
157 #define USBJOYSTICK_STICK_LEFT_VERT 1
158 #define USBJOYSTICK_STICK_RIGHT_HORIZ 2
159 #define USBJOYSTICK_STICK_RIGHT_VERT 3
162 #define USBJOYSTICK_BUTTON_MODE 0
163 #define USBJOYSTICK_BUTTON_1 1
164 #define USBJOYSTICK_BUTTON_2 2
165 #define USBJOYSTICK_BUTTON_3 3
166 #define USBJOYSTICK_BUTTON_4 4
167 #define USBJOYSTICK_BUTTON_5 5
168 #define USBJOYSTICK_BUTTON_6 6
169 #define USBJOYSTICK_BUTTON_7 7
170 #define USBJOYSTICK_BUTTON_8 8
171 #define USBJOYSTICK_BUTTON_9 9
172 #define USBJOYSTICK_BUTTON_10 10
173 #define USBJOYSTICK_BUTTON_LEFT_STICK 11
174 #define USBJOYSTICK_BUTTON_RIGHT_STICK 12
177 #define USBJOYSTICK_HAT_1 0
180 #define USBJOYSTICK_HAT_POS_N 0
181 #define USBJOYSTICK_HAT_POS_NE 1
182 #define USBJOYSTICK_HAT_POS_E 2
183 #define USBJOYSTICK_HAT_POS_SE 3
184 #define USBJOYSTICK_HAT_POS_S 4
185 #define USBJOYSTICK_HAT_POS_SW 5
186 #define USBJOYSTICK_HAT_POS_W 6
187 #define USBJOYSTICK_HAT_POS_NW 7
188 #define USBJOYSTICK_HAT_POS_IDLE 8
191 #define USBJOYSTICK_POLL_INTERVAL 50
300 virtual void hatNewValue(uint8_t hat, uint8_t value);
322 uint8_t _stick_value[USBJOYSTICK_NUM_STICKS];
323 boolean _button_value[USBJOYSTICK_NUM_BUTTONS];
324 uint8_t _hat_value[USBJOYSTICK_NUM_HATS];
327 void (*_stick_new_value_cb)(uint8_t stick, uint8_t value);
328 void (*_button_new_value_cb)(uint8_t button,
boolean value);
329 void (*_hat_new_value_cb)(uint8_t hat, uint8_t value);
330 void (*_stick_value_did_change_cb)(uint8_t stick, uint8_t value);
331 void (*_button_value_did_change_cb)(uint8_t button,
boolean value);
332 void (*_hat_value_did_change_cb)(uint8_t hat, uint8_t value);
335 EP_RECORD ep_record[2];