diff options
Diffstat (limited to 'quantum/pointing_device.h')
| -rw-r--r-- | quantum/pointing_device.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/quantum/pointing_device.h b/quantum/pointing_device.h index 56a542d54..5106c2666 100644 --- a/quantum/pointing_device.h +++ b/quantum/pointing_device.h | |||
| @@ -21,9 +21,68 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 21 | #include "host.h" | 21 | #include "host.h" |
| 22 | #include "report.h" | 22 | #include "report.h" |
| 23 | 23 | ||
| 24 | #if defined(POINTING_DEVICE_DRIVER_adns5050) | ||
| 25 | # include "drivers/sensors/adns5050.h" | ||
| 26 | #elif defined(POINTING_DEVICE_DRIVER_adns9800) | ||
| 27 | # include "spi_master.h" | ||
| 28 | # include "drivers/sensors/adns9800.h" | ||
| 29 | #elif defined(POINTING_DEVICE_DRIVER_analog_joystick) | ||
| 30 | # include "analog.h" | ||
| 31 | # include "drivers/sensors/analog_joystick.h" | ||
| 32 | #elif defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_i2c) || defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_spi) | ||
| 33 | # include "drivers/sensors/cirque_pinnacle.h" | ||
| 34 | #elif defined(POINTING_DEVICE_DRIVER_pimoroni_trackball) | ||
| 35 | # include "i2c_master.h" | ||
| 36 | # include "drivers/sensors/pimoroni_trackball.h" | ||
| 37 | // support for legacy pimoroni defines | ||
| 38 | # ifdef PIMORONI_TRACKBALL_INVERT_X | ||
| 39 | # define POINTING_DEVICE_INVERT_X | ||
| 40 | # endif | ||
| 41 | # ifdef PIMORONI_TRACKBALL_INVERT_Y | ||
| 42 | # define POINTING_DEVICE_INVERT_Y | ||
| 43 | # endif | ||
| 44 | # ifdef PIMORONI_TRACKBALL_ROTATE | ||
| 45 | # define POINTING_DEVICE_ROTATION_90 | ||
| 46 | # endif | ||
| 47 | #elif defined(POINTING_DEVICE_DRIVER_pmw3360) | ||
| 48 | # include "spi_master.h" | ||
| 49 | # include "drivers/sensors/pmw3360.h" | ||
| 50 | #else | ||
| 51 | void pointing_device_driver_init(void); | ||
| 52 | report_mouse_t pointing_device_driver_get_report(report_mouse_t mouse_report); | ||
| 53 | uint16_t pointing_device_driver_get_cpi(void); | ||
| 54 | void pointing_device_driver_set_cpi(uint16_t cpi); | ||
| 55 | #endif | ||
| 56 | |||
| 57 | typedef struct { | ||
| 58 | void (*init)(void); | ||
| 59 | report_mouse_t (*get_report)(report_mouse_t mouse_report); | ||
| 60 | void (*set_cpi)(uint16_t); | ||
| 61 | uint16_t (*get_cpi)(void); | ||
| 62 | } pointing_device_driver_t; | ||
| 63 | |||
| 64 | typedef enum { | ||
| 65 | POINTING_DEVICE_BUTTON1, | ||
| 66 | POINTING_DEVICE_BUTTON2, | ||
| 67 | POINTING_DEVICE_BUTTON3, | ||
| 68 | POINTING_DEVICE_BUTTON4, | ||
| 69 | POINTING_DEVICE_BUTTON5, | ||
| 70 | POINTING_DEVICE_BUTTON6, | ||
| 71 | POINTING_DEVICE_BUTTON7, | ||
| 72 | POINTING_DEVICE_BUTTON8, | ||
| 73 | } pointing_device_buttons_t; | ||
| 74 | |||
| 24 | void pointing_device_init(void); | 75 | void pointing_device_init(void); |
| 25 | void pointing_device_task(void); | 76 | void pointing_device_task(void); |
| 26 | void pointing_device_send(void); | 77 | void pointing_device_send(void); |
| 27 | report_mouse_t pointing_device_get_report(void); | 78 | report_mouse_t pointing_device_get_report(void); |
| 28 | void pointing_device_set_report(report_mouse_t newMouseReport); | 79 | void pointing_device_set_report(report_mouse_t newMouseReport); |
| 29 | bool has_mouse_report_changed(report_mouse_t new, report_mouse_t old); | 80 | bool has_mouse_report_changed(report_mouse_t new, report_mouse_t old); |
| 81 | uint16_t pointing_device_get_cpi(void); | ||
| 82 | void pointing_device_set_cpi(uint16_t cpi); | ||
| 83 | |||
| 84 | void pointing_device_init_kb(void); | ||
| 85 | void pointing_device_init_user(void); | ||
| 86 | report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report); | ||
| 87 | report_mouse_t pointing_device_task_user(report_mouse_t mouse_report); | ||
| 88 | uint8_t pointing_device_handle_buttons(uint8_t buttons, bool pressed, pointing_device_buttons_t button); | ||
