diff --git a/quantum/pointing_device/pointing_device.h b/quantum/pointing_device/pointing_device.h index f6234a365828..828b24a6419b 100644 --- a/quantum/pointing_device/pointing_device.h +++ b/quantum/pointing_device/pointing_device.h @@ -31,45 +31,6 @@ along with this program. If not, see . # define POINTING_DEVICE_COUNT 1 #endif -typedef enum { - ROTATE_0, - ROTATE_90, - ROTATE_180, - ROTATE_270, -} pointing_device_rotations_t; -typedef enum { - UNKNOWN, - LEFT, - RIGHT, -} pointing_device_side_t; -typedef enum { - NONE, - INVERT_X, - INVERT_Y, - INVERT_XY, -} pointing_device_invert_t; - -typedef struct { - pin_t cs; - uint8_t mode; - uint16_t divisor; -} pointing_device_spi_config_t; - -typedef struct { - uint16_t address; - uint16_t timeout; -} pointing_device_i2c_config_t; - -typedef struct { - pin_t data_pin; - pin_t clock_pin; -} pointing_device_ps2_config_t; - -typedef struct { - pin_t pin; - bool active_low; -} pointing_device_motion_t; - typedef struct { void (*init)(const void *); report_mouse_t (*get_report)(const void *); @@ -77,6 +38,23 @@ typedef struct { uint16_t (*get_cpi)(const void *); } pointing_device_driver_t; +typedef struct { + const pointing_device_driver_t *driver; + const pointing_device_rotations_t rotation; + const pointing_device_invert_t invert; + const uint8_t throttle; + const void *config; + const pointing_device_motion_t motion; +#if defined(SPLIT_KEYBOARD) + const pointing_device_side_t side; +#endif +} pointing_device_config_t; + +typedef struct { + uint16_t cpi; + bool update; +} pointing_device_shared_cpi_t; + typedef enum { POINTING_DEVICE_BUTTON1, POINTING_DEVICE_BUTTON2, @@ -88,43 +66,6 @@ typedef enum { POINTING_DEVICE_BUTTON8, } pointing_device_buttons_t; -typedef struct { - report_mouse_t report; - uint8_t counter; -} pointing_device_shared_report_t; - - -#if defined(POINTING_DEVICE_DRIVER_ADNS5050) -# include "adns5050.h" -#endif -#if defined(POINTING_DEVICE_DRIVER_ADNS9800) -# include "adns9800.h" -#endif -#if defined(POINTING_DEVICE_DRIVER_ANALOG_JOYSTICK) -# include "analog_joystick.h" -#endif -#if defined(POINTING_DEVICE_DRIVER_AZOTEQ_IQS5XX) -# include "azoteq_iqs5xx.h" -#endif -#if defined(POINTING_DEVICE_DRIVER_CIRQUE_PINNACLE_I2C) || defined(POINTING_DEVICE_DRIVER_CIRQUE_PINNACLE_SPI) -# include "cirque_pinnacle.h" -#endif -#if defined(POINTING_DEVICE_DRIVER_PAW3204) -# include "paw3204.h" -#endif -#if defined(POINTING_DEVICE_DRIVER_PIMORONI_TRACKBALL) -# include "pimoroni_trackball.h" -#endif -#if defined(POINTING_DEVICE_DRIVER_PMW3360) -# include "pmw3360.h" -#endif -#if defined(POINTING_DEVICE_DRIVER_PMW3389) -# include "pmw3389.h" -#endif -#if defined(POINTING_DEVICE_DRIVER_PS2_TRACKPOINT) -# include "ps2_trackpoint.h" -#endif - #ifdef MOUSE_EXTENDED_REPORT # define XY_REPORT_MIN INT16_MIN # define XY_REPORT_MAX INT16_MAX @@ -135,20 +76,6 @@ typedef int32_t clamp_range_t; typedef int16_t clamp_range_t; #endif -#define POINTING_DEVICE_NO_MOTION_PIN \ - { 0 } -#define POINTING_DEVICE_THIS_SIDE(index) (pointing_device_configs[index].side == (is_keyboard_left() ? LEFT : RIGHT)) - -#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))) - -#define POINTING_DEVICE_NO_MOTION_PIN \ - { 0 } -#define POINTING_DEVICE_THIS_SIDE(index) (pointing_device_configs[index].side == (is_keyboard_left() ? LEFT : RIGHT)) - -#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); void pointing_device_send(report_mouse_t *sending_report); @@ -157,15 +84,6 @@ void pointing_device_set_report(report_mouse_t mouse_report); uint16_t pointing_device_get_cpi(void); void pointing_device_set_cpi(uint16_t cpi); -uint16_t pointing_device_get_cpi_by_index(uint8_t index); -void pointing_device_set_cpi_by_index(uint16_t cpi, uint8_t index); - -uint16_t pointing_device_get_cpi_by_index(uint8_t index); -void pointing_device_set_cpi_by_index(uint16_t cpi, uint8_t index); - - -void pointing_device_init_kb_by_index(uint8_t index); -void pointing_device_init_user_by_index(uint8_t index); void pointing_device_init_kb(void); void pointing_device_init_user(void); report_mouse_t pointing_device_task_kb_by_index(report_mouse_t mouse_report, uint8_t index); @@ -173,12 +91,8 @@ report_mouse_t pointing_device_task_user_by_index(report_mouse_t mouse_report, u report_mouse_t pointing_device_task_kb(report_mouse_t mouse_report); report_mouse_t pointing_device_task_user(report_mouse_t mouse_report); uint8_t pointing_device_handle_buttons(uint8_t buttons, bool pressed, pointing_device_buttons_t button); -void pointing_device_adjust_by_defines(report_mouse_t *report); +report_mouse_t pointing_device_adjust_by_defines(report_mouse_t mouse_report); void pointing_device_keycode_handler(uint16_t keycode, bool pressed); -bool pointing_deivce_task_get_pointing_reports(report_mouse_t *report); -bool pointing_deivce_task_get_pointing_reports(report_mouse_t *report); -void pointing_device_add_and_clamp_report(report_mouse_t* report, report_mouse_t* additional_report); -bool pointing_device_report_ready(report_mouse_t* last_report, report_mouse_t* new_report, bool* device_was_ready); #if defined(SPLIT_POINTING_ENABLE) void pointing_device_set_shared_report(report_mouse_t report); diff --git a/users/freznel/rgb/rgb_matrix_stuff.h b/users/freznel/rgb/rgb_matrix_stuff.h index 9559134c8cc6..e1640f16440a 100644 --- a/users/freznel/rgb/rgb_matrix_stuff.h +++ b/users/freznel/rgb/rgb_matrix_stuff.h @@ -13,3 +13,5 @@ void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max); bool rgb_matrix_indicators_keymap(void); + +extern bool tap_toggling, enable_acceleration, is_drag_mom, is_media, scrolling_mode, is_caret;