1 #ifndef __HID_ROCCAT_PYRA_H
2 #define __HID_ROCCAT_PYRA_H
5 * Copyright (c) 2010 Stefan Achatz <erazor_de@users.sourceforge.net>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the Free
11 * Software Foundation; either version 2 of the License, or (at your option)
15 #include <linux/types.h>
18 uint8_t command
; /* PYRA_COMMAND_B */
19 uint8_t size
; /* always 3 */
20 uint8_t unknown
; /* 1 */
21 } __attribute__ ((__packed__
));
23 enum pyra_control_requests
{
24 PYRA_CONTROL_REQUEST_PROFILE_SETTINGS
= 0x10,
25 PYRA_CONTROL_REQUEST_PROFILE_BUTTONS
= 0x20
28 struct pyra_settings
{
29 uint8_t command
; /* PYRA_COMMAND_SETTINGS */
30 uint8_t size
; /* always 3 */
31 uint8_t startup_profile
; /* Range 0-4! */
32 } __attribute__ ((__packed__
));
34 struct pyra_profile_settings
{
35 uint8_t command
; /* PYRA_COMMAND_PROFILE_SETTINGS */
36 uint8_t size
; /* always 0xd */
37 uint8_t number
; /* Range 0-4 */
39 uint8_t x_sensitivity
; /* 0x1-0xa */
40 uint8_t y_sensitivity
;
41 uint8_t x_cpi
; /* unused */
42 uint8_t y_cpi
; /* this value is for x and y */
43 uint8_t lightswitch
; /* 0 = off, 1 = on */
46 uint16_t checksum
; /* byte sum */
47 } __attribute__ ((__packed__
));
49 struct pyra_profile_buttons
{
50 uint8_t command
; /* PYRA_COMMAND_PROFILE_BUTTONS */
51 uint8_t size
; /* always 0x13 */
52 uint8_t number
; /* Range 0-4 */
54 uint16_t checksum
; /* byte sum */
55 } __attribute__ ((__packed__
));
58 uint8_t command
; /* PYRA_COMMAND_INFO */
59 uint8_t size
; /* always 6 */
60 uint8_t firmware_version
;
61 uint8_t unknown1
; /* always 0 */
62 uint8_t unknown2
; /* always 1 */
63 uint8_t unknown3
; /* always 0 */
64 } __attribute__ ((__packed__
));
67 PYRA_COMMAND_SETTINGS
= 0x5,
68 PYRA_COMMAND_PROFILE_SETTINGS
= 0x6,
69 PYRA_COMMAND_PROFILE_BUTTONS
= 0x7,
70 PYRA_COMMAND_INFO
= 0x9,
74 enum pyra_mouse_report_numbers
{
75 PYRA_MOUSE_REPORT_NUMBER_HID
= 1,
76 PYRA_MOUSE_REPORT_NUMBER_AUDIO
= 2,
77 PYRA_MOUSE_REPORT_NUMBER_BUTTON
= 3,
80 struct pyra_mouse_event_button
{
81 uint8_t report_number
; /* always 3 */
82 uint8_t unknown
; /* always 0 */
86 } __attribute__ ((__packed__
));
88 struct pyra_mouse_event_audio
{
89 uint8_t report_number
; /* always 2 */
91 uint8_t unused
; /* always 0 */
92 } __attribute__ ((__packed__
));
94 /* hid audio controls */
95 enum pyra_mouse_event_audio_types
{
96 PYRA_MOUSE_EVENT_AUDIO_TYPE_MUTE
= 0xe2,
97 PYRA_MOUSE_EVENT_AUDIO_TYPE_VOLUME_UP
= 0xe9,
98 PYRA_MOUSE_EVENT_AUDIO_TYPE_VOLUME_DOWN
= 0xea,
101 enum pyra_mouse_event_button_types
{
103 * Mouse sends tilt events on report_number 1 and 3
104 * Tilt events are sent repeatedly with 0.94s between first and second
105 * event and 0.22s on subsequent
107 PYRA_MOUSE_EVENT_BUTTON_TYPE_TILT
= 0x10,
110 * These are sent sequentially
111 * data1 contains new profile number in range 1-5
113 PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_1
= 0x20,
114 PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2
= 0x30,
117 * data1 = button_number (rmp index)
118 * data2 = pressed/released
120 PYRA_MOUSE_EVENT_BUTTON_TYPE_MACRO
= 0x40,
121 PYRA_MOUSE_EVENT_BUTTON_TYPE_SHORTCUT
= 0x50,
124 * data1 = button_number (rmp index)
126 PYRA_MOUSE_EVENT_BUTTON_TYPE_QUICKLAUNCH
= 0x60,
128 /* data1 = new cpi */
129 PYRA_MOUSE_EVENT_BUTTON_TYPE_CPI
= 0xb0,
131 /* data1 and data2 = new sensitivity */
132 PYRA_MOUSE_EVENT_BUTTON_TYPE_SENSITIVITY
= 0xc0,
134 PYRA_MOUSE_EVENT_BUTTON_TYPE_MULTIMEDIA
= 0xf0,
138 PYRA_MOUSE_EVENT_BUTTON_PRESS
= 0,
139 PYRA_MOUSE_EVENT_BUTTON_RELEASE
= 1,
142 struct pyra_roccat_report
{
146 } __attribute__ ((__packed__
));
151 int firmware_version
;
154 struct mutex pyra_lock
;
155 struct pyra_settings settings
;
156 struct pyra_profile_settings profile_settings
[5];
157 struct pyra_profile_buttons profile_buttons
[5];