diff options
author | Dasky <32983009+daskygit@users.noreply.github.com> | 2024-10-25 18:11:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-25 18:11:51 +0100 |
commit | f5b495e06e257796a9be845f47bfc375fece81f8 (patch) | |
tree | 3772da6b18ad610df774269d3542c6fb660b812c /quantum/pointing_device/pointing_device.h | |
parent | 5c85271e48b4f2be7da47d1728ad1ddb95364ad7 (diff) |
Move pointing device driver code (#24445)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'quantum/pointing_device/pointing_device.h')
-rw-r--r-- | quantum/pointing_device/pointing_device.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/quantum/pointing_device/pointing_device.h b/quantum/pointing_device/pointing_device.h index b0f8533d6d..72188c977d 100644 --- a/quantum/pointing_device/pointing_device.h +++ b/quantum/pointing_device/pointing_device.h @@ -21,6 +21,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "host.h" #include "report.h" +typedef struct { + void (*init)(void); + report_mouse_t (*get_report)(report_mouse_t mouse_report); + void (*set_cpi)(uint16_t); + uint16_t (*get_cpi)(void); +} pointing_device_driver_t; + #ifdef POINTING_DEVICE_AUTO_MOUSE_ENABLE # include "pointing_device_auto_mouse.h" #endif @@ -44,7 +51,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. # include "drivers/sensors/azoteq_iqs5xx.h" #elif defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_i2c) || defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_spi) # include "drivers/sensors/cirque_pinnacle.h" -# include "drivers/sensors/cirque_pinnacle_gestures.h" # include "pointing_device_gestures.h" #elif defined(POINTING_DEVICE_DRIVER_paw3204) # include "drivers/sensors/paw3204.h" @@ -74,13 +80,6 @@ uint16_t pointing_device_driver_get_cpi(void); void pointing_device_driver_set_cpi(uint16_t cpi); #endif -typedef struct { - void (*init)(void); - report_mouse_t (*get_report)(report_mouse_t mouse_report); - void (*set_cpi)(uint16_t); - uint16_t (*get_cpi)(void); -} pointing_device_driver_t; - typedef enum { POINTING_DEVICE_BUTTON1, POINTING_DEVICE_BUTTON2, @@ -112,6 +111,9 @@ typedef int32_t hv_clamp_range_t; typedef int16_t hv_clamp_range_t; #endif +#define CONSTRAIN_HID(amt) ((amt) < INT8_MIN ? INT8_MIN : ((amt) > INT8_MAX ? INT8_MAX : (amt))) +#define CONSTRAIN_HID_XY(amt) ((amt) < XY_REPORT_MIN ? XY_REPORT_MIN : ((amt) > XY_REPORT_MAX ? XY_REPORT_MAX : (amt))) + void pointing_device_init(void); bool pointing_device_task(void); bool pointing_device_send(void); |