]> git.donarmstrong.com Git - kiibohd-controller.git/blob - Scan/DPH/scan_loop.h
fc2bbbbd067046beb0ecc4a94377385b6543b1b5
[kiibohd-controller.git] / Scan / DPH / scan_loop.h
1 /* Copyright (C) 2013-2014 by Jacob Alexander
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 3.0 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
15  */
16
17 #ifndef __SCAN_LOOP_H
18 #define __SCAN_LOOP_H
19
20 // ----- Includes -----
21
22 // Compiler Includes
23 #include <stdint.h>
24
25 // Local Includes
26
27
28
29 // ----- Defines -----
30
31 #define KEYBOARD_KEYS 0xFF // TODO Determine max number of keys
32 #define KEYBOARD_BUFFER 24 // Max number of key signals to buffer
33                            // This limits the NKRO-ability, so at 24, the keyboard is 24KRO
34                            // The buffer is really only needed for converter modules
35                            // An alternative macro module could be written for matrix modules and still work well
36
37
38
39 // ----- Variables -----
40
41 extern volatile     uint8_t KeyIndex_Buffer[KEYBOARD_BUFFER];
42 extern volatile     uint8_t KeyIndex_BufferUsed;
43
44
45
46 // ----- Functions -----
47
48 // Functions used by main.c
49 void Scan_setup();
50 uint8_t Scan_loop();
51
52
53 // Functions available to macro.c
54 uint8_t Scan_sendData( uint8_t dataPayload );
55
56 void Scan_finishedWithMacro( uint8_t sentKeys );
57 void Scan_finishedWithOutput( uint8_t sentKeys );
58
59
60 #endif // __SCAN_LOOP_H
61