diff options
Diffstat (limited to 'quantum/pointing_device/pointing_device.h')
-rw-r--r-- | quantum/pointing_device/pointing_device.h | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/quantum/pointing_device/pointing_device.h b/quantum/pointing_device/pointing_device.h index 1cd4b0b5e6..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, @@ -95,13 +94,26 @@ typedef enum { #ifdef MOUSE_EXTENDED_REPORT # define XY_REPORT_MIN INT16_MIN # define XY_REPORT_MAX INT16_MAX -typedef int32_t clamp_range_t; +typedef int32_t xy_clamp_range_t; #else # define XY_REPORT_MIN INT8_MIN # define XY_REPORT_MAX INT8_MAX -typedef int16_t clamp_range_t; +typedef int16_t xy_clamp_range_t; #endif +#ifdef WHEEL_EXTENDED_REPORT +# define HV_REPORT_MIN INT16_MIN +# define HV_REPORT_MAX INT16_MAX +typedef int32_t hv_clamp_range_t; +#else +# define HV_REPORT_MIN INT8_MIN +# define HV_REPORT_MAX INT8_MAX +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); |