diff options
Diffstat (limited to 'tmk_core/protocol/lufa/bluetooth.h')
-rw-r--r-- | tmk_core/protocol/lufa/bluetooth.h | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/tmk_core/protocol/lufa/bluetooth.h b/tmk_core/protocol/lufa/bluetooth.h deleted file mode 100644 index 67f031439..000000000 --- a/tmk_core/protocol/lufa/bluetooth.h +++ /dev/null | |||
@@ -1,96 +0,0 @@ | |||
1 | /* | ||
2 | Bluefruit Protocol for TMK firmware | ||
3 | Author: Benjamin Gould, 2013 | ||
4 | Jack Humbert, 2015 | ||
5 | Based on code Copyright 2011 Jun Wako <wakojun@gmail.com> | ||
6 | This program is free software: you can redistribute it and/or modify | ||
7 | it under the terms of the GNU General Public License as published by | ||
8 | the Free Software Foundation, either version 2 of the License, or | ||
9 | (at your option) any later version. | ||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #pragma once | ||
19 | |||
20 | #include "../serial.h" | ||
21 | |||
22 | void bluefruit_serial_send(uint8_t data); | ||
23 | |||
24 | // https://learn.adafruit.com/introducing-bluefruit-ez-key-diy-bluetooth-hid-keyboard/sending-keys-via-serial#raw-hid-consumer-reports-8-14 | ||
25 | static inline uint16_t CONSUMER2BLUEFRUIT(uint16_t usage) { | ||
26 | switch (usage) { | ||
27 | case AC_HOME: | ||
28 | return 0x0001; | ||
29 | case AL_KEYBOARD_LAYOUT: | ||
30 | return 0x0002; | ||
31 | case AC_SEARCH: | ||
32 | return 0x0004; | ||
33 | case SNAPSHOT: | ||
34 | return 0x0008; | ||
35 | case AUDIO_VOL_UP: | ||
36 | return 0x0010; | ||
37 | case AUDIO_VOL_DOWN: | ||
38 | return 0x0020; | ||
39 | case TRANSPORT_PLAY_PAUSE: | ||
40 | return 0x0040; | ||
41 | case TRANSPORT_FAST_FORWARD: | ||
42 | return 0x0080; | ||
43 | case TRANSPORT_REWIND: | ||
44 | return 0x0100; | ||
45 | case TRANSPORT_NEXT_TRACK: | ||
46 | return 0x0200; | ||
47 | case TRANSPORT_PREV_TRACK: | ||
48 | return 0x0400; | ||
49 | case TRANSPORT_RANDOM_PLAY: | ||
50 | return 0x0800; | ||
51 | case TRANSPORT_STOP: | ||
52 | return 0x1000; | ||
53 | default: | ||
54 | return 0; | ||
55 | } | ||
56 | } | ||
57 | |||
58 | // https://cdn.sparkfun.com/datasheets/Wireless/Bluetooth/bluetooth_cr_UG-v1.0r.pdf#G7.663734 | ||
59 | static inline uint16_t CONSUMER2RN42(uint16_t usage) { | ||
60 | switch (usage) { | ||
61 | case AC_HOME: | ||
62 | return 0x0001; | ||
63 | case AL_EMAIL: | ||
64 | return 0x0002; | ||
65 | case AC_SEARCH: | ||
66 | return 0x0004; | ||
67 | case AL_KEYBOARD_LAYOUT: | ||
68 | return 0x0008; | ||
69 | case AUDIO_VOL_UP: | ||
70 | return 0x0010; | ||
71 | case AUDIO_VOL_DOWN: | ||
72 | return 0x0020; | ||
73 | case AUDIO_MUTE: | ||
74 | return 0x0040; | ||
75 | case TRANSPORT_PLAY_PAUSE: | ||
76 | return 0x0080; | ||
77 | case TRANSPORT_NEXT_TRACK: | ||
78 | return 0x0100; | ||
79 | case TRANSPORT_PREV_TRACK: | ||
80 | return 0x0200; | ||
81 | case TRANSPORT_STOP: | ||
82 | return 0x0400; | ||
83 | case TRANSPORT_EJECT: | ||
84 | return 0x0800; | ||
85 | case TRANSPORT_FAST_FORWARD: | ||
86 | return 0x1000; | ||
87 | case TRANSPORT_REWIND: | ||
88 | return 0x2000; | ||
89 | case TRANSPORT_STOP_EJECT: | ||
90 | return 0x4000; | ||
91 | case AL_LOCAL_BROWSER: | ||
92 | return 0x8000; | ||
93 | default: | ||
94 | return 0; | ||
95 | } | ||
96 | } | ||