]> git.donarmstrong.com Git - kiibohd-controller.git/blob - Scan/DPH/scan_loop.h
Code cleanup
[kiibohd-controller.git] / Scan / DPH / scan_loop.h
1 /* Copyright (C) 2013-2015 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 #pragma once
18
19 // ----- Includes -----
20
21 // Compiler Includes
22 #include <stdint.h>
23
24 // Local Includes
25
26
27
28 // ----- Defines -----
29
30 #define KEYBOARD_KEYS 0xFF // TODO Determine max number of keys
31 #define KEYBOARD_BUFFER 24 // Max number of key signals to buffer
32                            // This limits the NKRO-ability, so at 24, the keyboard is 24KRO
33                            // The buffer is really only needed for converter modules
34                            // An alternative macro module could be written for matrix modules and still work well
35
36
37
38 // ----- Variables -----
39
40 extern volatile     uint8_t KeyIndex_Buffer[KEYBOARD_BUFFER];
41 extern volatile     uint8_t KeyIndex_BufferUsed;
42
43
44
45 // ----- Functions -----
46
47 // Functions used by main.c
48 void Scan_setup();
49 uint8_t Scan_loop();
50
51
52 // Functions available to macro.c
53 uint8_t Scan_sendData( uint8_t dataPayload );
54
55 void Scan_finishedWithMacro( uint8_t sentKeys );
56 void Scan_finishedWithOutput( uint8_t sentKeys );
57