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__
));
24 uint8_t command
; /* PYRA_COMMAND_CONTROL */
26 * value is profile number for request_settings and request_buttons
27 * 1 if status ok for request_status
29 uint8_t value
; /* Range 0-4 */
31 } __attribute__ ((__packed__
));
33 enum pyra_control_requests
{
34 PYRA_CONTROL_REQUEST_STATUS
= 0x00,
35 PYRA_CONTROL_REQUEST_PROFILE_SETTINGS
= 0x10,
36 PYRA_CONTROL_REQUEST_PROFILE_BUTTONS
= 0x20
39 struct pyra_settings
{
40 uint8_t command
; /* PYRA_COMMAND_SETTINGS */
41 uint8_t size
; /* always 3 */
42 uint8_t startup_profile
; /* Range 0-4! */
43 } __attribute__ ((__packed__
));
45 struct pyra_profile_settings
{
46 uint8_t command
; /* PYRA_COMMAND_PROFILE_SETTINGS */
47 uint8_t size
; /* always 0xd */
48 uint8_t number
; /* Range 0-4 */
50 uint8_t x_sensitivity
; /* 0x1-0xa */
51 uint8_t y_sensitivity
;
52 uint8_t x_cpi
; /* unused */
53 uint8_t y_cpi
; /* this value is for x and y */
54 uint8_t lightswitch
; /* 0 = off, 1 = on */
57 uint16_t checksum
; /* byte sum */
58 } __attribute__ ((__packed__
));
60 struct pyra_profile_buttons
{
61 uint8_t command
; /* PYRA_COMMAND_PROFILE_BUTTONS */
62 uint8_t size
; /* always 0x13 */
63 uint8_t number
; /* Range 0-4 */
65 uint16_t checksum
; /* byte sum */
66 } __attribute__ ((__packed__
));
69 uint8_t command
; /* PYRA_COMMAND_INFO */
70 uint8_t size
; /* always 6 */
71 uint8_t firmware_version
;
72 uint8_t unknown1
; /* always 0 */
73 uint8_t unknown2
; /* always 1 */
74 uint8_t unknown3
; /* always 0 */
75 } __attribute__ ((__packed__
));
78 PYRA_COMMAND_CONTROL
= 0x4,
79 PYRA_COMMAND_SETTINGS
= 0x5,
80 PYRA_COMMAND_PROFILE_SETTINGS
= 0x6,
81 PYRA_COMMAND_PROFILE_BUTTONS
= 0x7,
82 PYRA_COMMAND_INFO
= 0x9,
86 enum pyra_mouse_report_numbers
{
87 PYRA_MOUSE_REPORT_NUMBER_HID
= 1,
88 PYRA_MOUSE_REPORT_NUMBER_AUDIO
= 2,
89 PYRA_MOUSE_REPORT_NUMBER_BUTTON
= 3,
92 struct pyra_mouse_event_button
{
93 uint8_t report_number
; /* always 3 */
94 uint8_t unknown
; /* always 0 */
98 } __attribute__ ((__packed__
));
100 struct pyra_mouse_event_audio
{
101 uint8_t report_number
; /* always 2 */
103 uint8_t unused
; /* always 0 */
104 } __attribute__ ((__packed__
));
106 /* hid audio controls */
107 enum pyra_mouse_event_audio_types
{
108 PYRA_MOUSE_EVENT_AUDIO_TYPE_MUTE
= 0xe2,
109 PYRA_MOUSE_EVENT_AUDIO_TYPE_VOLUME_UP
= 0xe9,
110 PYRA_MOUSE_EVENT_AUDIO_TYPE_VOLUME_DOWN
= 0xea,
113 enum pyra_mouse_event_button_types
{
115 * Mouse sends tilt events on report_number 1 and 3
116 * Tilt events are sent repeatedly with 0.94s between first and second
117 * event and 0.22s on subsequent
119 PYRA_MOUSE_EVENT_BUTTON_TYPE_TILT
= 0x10,
122 * These are sent sequentially
123 * data1 contains new profile number in range 1-5
125 PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_1
= 0x20,
126 PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2
= 0x30,
129 * data1 = button_number (rmp index)
130 * data2 = pressed/released
132 PYRA_MOUSE_EVENT_BUTTON_TYPE_MACRO
= 0x40,
133 PYRA_MOUSE_EVENT_BUTTON_TYPE_SHORTCUT
= 0x50,
136 * data1 = button_number (rmp index)
138 PYRA_MOUSE_EVENT_BUTTON_TYPE_QUICKLAUNCH
= 0x60,
140 /* data1 = new cpi */
141 PYRA_MOUSE_EVENT_BUTTON_TYPE_CPI
= 0xb0,
143 /* data1 and data2 = new sensitivity */
144 PYRA_MOUSE_EVENT_BUTTON_TYPE_SENSITIVITY
= 0xc0,
146 PYRA_MOUSE_EVENT_BUTTON_TYPE_MULTIMEDIA
= 0xf0,
150 PYRA_MOUSE_EVENT_BUTTON_PRESS
= 0,
151 PYRA_MOUSE_EVENT_BUTTON_RELEASE
= 1,
154 struct pyra_roccat_report
{
158 } __attribute__ ((__packed__
));
163 int firmware_version
;
166 struct mutex pyra_lock
;
167 struct pyra_settings settings
;
168 struct pyra_profile_settings profile_settings
[5];
169 struct pyra_profile_buttons profile_buttons
[5];