Move pointing device driver code (#24445)
Co-authored-by: Drashna Jaelre <drashna@live.com>
This commit is contained in:
		
							parent
							
								
									5c85271e48
								
							
						
					
					
						commit
						f5b495e06e
					
				
					 23 changed files with 544 additions and 546 deletions
				
			
		| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue