1 /* Copyright (C) 2013 by Jacob Alexander
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.
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.
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/>.
20 // ----- Includes -----
29 // ----- Defines -----
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
39 // ----- Variables -----
41 extern volatile uint8_t KeyIndex_Buffer[KEYBOARD_BUFFER];
42 extern volatile uint8_t KeyIndex_BufferUsed;
46 // ----- Functions -----
48 // Functions used by main.c
49 void scan_setup( void );
50 uint8_t scan_loop( void );
53 // Functions available to macro.c
54 uint8_t scan_sendData( uint8_t dataPayload );
56 void scan_finishedWithBuffer( uint8_t sentKeys );
57 void scan_finishedWithUSBBuffer( uint8_t sentKeys );
58 void scan_lockKeyboard( void );
59 void scan_unlockKeyboard( void );
60 void scan_resetKeyboard( void );
63 #endif // __SCAN_LOOP_H