]> git.donarmstrong.com Git - kiibohd-controller.git/blob - Scan/avr-capsense/scan_loop.h
Adapting the avr-capsense code to the Kiibohd Controller API
[kiibohd-controller.git] / Scan / avr-capsense / scan_loop.h
1 /* Copyright (C) 2013 by Jacob Alexander
2  * 
3  * dfj, put whatever license here you want
4  * This file will probably be removed though.
5  */
6
7 #ifndef __SCAN_LOOP_H
8 #define __SCAN_LOOP_H
9
10 // ----- Includes -----
11
12 // Compiler Includes
13 #include <stdint.h>
14
15 // Local Includes
16
17
18
19 // ----- Defines -----
20
21 #define KEYBOARD_KEYS 0xFF // TODO Determine max number of keys
22 #define KEYBOARD_BUFFER 24 // Max number of key signals to buffer
23                            // This limits the NKRO-ability, so at 24, the keyboard is 24KRO
24                            // The buffer is really only needed for converter modules
25                            // An alternative macro module could be written for matrix modules and still work well
26
27
28
29 // ----- Variables -----
30
31 extern volatile     uint8_t KeyIndex_Buffer[KEYBOARD_BUFFER];
32 extern volatile     uint8_t KeyIndex_BufferUsed;
33
34
35
36 // ----- Functions -----
37
38 // Functions used by main.c
39 void scan_setup( void );
40 uint8_t scan_loop( void );
41
42
43 // Functions available to macro.c
44 uint8_t scan_sendData( uint8_t dataPayload );
45
46 void scan_finishedWithBuffer( uint8_t sentKeys );
47 void scan_finishedWithUSBBuffer( uint8_t sentKeys );
48 void scan_lockKeyboard( void );
49 void scan_unlockKeyboard( void );
50 void scan_resetKeyboard( void );
51
52
53 #endif // __SCAN_LOOP_H
54