1#ifndef __HID_ROCCAT_PYRA_H
2#define __HID_ROCCAT_PYRA_H
3
4
5
6
7
8
9
10
11
12
13
14
15#include <linux/types.h>
16
17struct pyra_b {
18 uint8_t command;
19 uint8_t size;
20 uint8_t unknown;
21} __attribute__ ((__packed__));
22
23enum pyra_control_requests {
24 PYRA_CONTROL_REQUEST_PROFILE_SETTINGS = 0x10,
25 PYRA_CONTROL_REQUEST_PROFILE_BUTTONS = 0x20
26};
27
28struct pyra_settings {
29 uint8_t command;
30 uint8_t size;
31 uint8_t startup_profile;
32} __attribute__ ((__packed__));
33
34struct pyra_profile_settings {
35 uint8_t command;
36 uint8_t size;
37 uint8_t number;
38 uint8_t xysync;
39 uint8_t x_sensitivity;
40 uint8_t y_sensitivity;
41 uint8_t x_cpi;
42 uint8_t y_cpi;
43 uint8_t lightswitch;
44 uint8_t light_effect;
45 uint8_t handedness;
46 uint16_t checksum;
47} __attribute__ ((__packed__));
48
49struct pyra_profile_buttons {
50 uint8_t command;
51 uint8_t size;
52 uint8_t number;
53 uint8_t buttons[14];
54 uint16_t checksum;
55} __attribute__ ((__packed__));
56
57struct pyra_info {
58 uint8_t command;
59 uint8_t size;
60 uint8_t firmware_version;
61 uint8_t unknown1;
62 uint8_t unknown2;
63 uint8_t unknown3;
64} __attribute__ ((__packed__));
65
66enum pyra_commands {
67 PYRA_COMMAND_SETTINGS = 0x5,
68 PYRA_COMMAND_PROFILE_SETTINGS = 0x6,
69 PYRA_COMMAND_PROFILE_BUTTONS = 0x7,
70 PYRA_COMMAND_INFO = 0x9,
71 PYRA_COMMAND_B = 0xb
72};
73
74enum 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,
78};
79
80struct pyra_mouse_event_button {
81 uint8_t report_number;
82 uint8_t unknown;
83 uint8_t type;
84 uint8_t data1;
85 uint8_t data2;
86} __attribute__ ((__packed__));
87
88struct pyra_mouse_event_audio {
89 uint8_t report_number;
90 uint8_t type;
91 uint8_t unused;
92} __attribute__ ((__packed__));
93
94
95enum 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,
99};
100
101enum pyra_mouse_event_button_types {
102
103
104
105
106
107 PYRA_MOUSE_EVENT_BUTTON_TYPE_TILT = 0x10,
108
109
110
111
112
113 PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_1 = 0x20,
114 PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2 = 0x30,
115
116
117
118
119
120 PYRA_MOUSE_EVENT_BUTTON_TYPE_MACRO = 0x40,
121 PYRA_MOUSE_EVENT_BUTTON_TYPE_SHORTCUT = 0x50,
122
123
124
125
126 PYRA_MOUSE_EVENT_BUTTON_TYPE_QUICKLAUNCH = 0x60,
127
128
129 PYRA_MOUSE_EVENT_BUTTON_TYPE_CPI = 0xb0,
130
131
132 PYRA_MOUSE_EVENT_BUTTON_TYPE_SENSITIVITY = 0xc0,
133
134 PYRA_MOUSE_EVENT_BUTTON_TYPE_MULTIMEDIA = 0xf0,
135};
136
137enum {
138 PYRA_MOUSE_EVENT_BUTTON_PRESS = 0,
139 PYRA_MOUSE_EVENT_BUTTON_RELEASE = 1,
140};
141
142struct pyra_roccat_report {
143 uint8_t type;
144 uint8_t value;
145 uint8_t key;
146} __attribute__ ((__packed__));
147
148struct pyra_device {
149 int actual_profile;
150 int actual_cpi;
151 int firmware_version;
152 int roccat_claimed;
153 int chrdev_minor;
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];
158};
159
160#endif
161