annotate Scan/EpsonQX-10/scan_loop.h @ 341:66eccdd9ced5

Code cleanup - Changing header file ifndef define to pragma once's - Removed duplicate output_com.h's
author Jacob Alexander <haata@kiibohd.com>
date Sun, 14 Jun 2015 13:56:56 -0700
parents 8dab4014c398
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
341
66eccdd9ced5 Code cleanup
Jacob Alexander <haata@kiibohd.com>
parents: 125
diff changeset
1 /* Copyright (C) 2011,2014-2015 by Jacob Alexander
125
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 69
diff changeset
2 *
39
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
4 * of this software and associated documentation files (the "Software"), to deal
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
5 * in the Software without restriction, including without limitation the rights
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
7 * copies of the Software, and to permit persons to whom the Software is
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
8 * furnished to do so, subject to the following conditions:
125
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 69
diff changeset
9 *
39
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
10 * The above copyright notice and this permission notice shall be included in
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
11 * all copies or substantial portions of the Software.
125
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 69
diff changeset
12 *
39
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
19 * THE SOFTWARE.
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
20 */
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
21
341
66eccdd9ced5 Code cleanup
Jacob Alexander <haata@kiibohd.com>
parents: 125
diff changeset
22 #pragma once
39
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
23
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
24 // ----- Includes -----
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
25
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
26 // Compiler Includes
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
27 #include <stdint.h>
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
28
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
29 // Local Includes
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
30
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
31
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
32
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
33 // ----- Defines -----
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
34
69
87658fa6091b Updating AVR abstraction to be compatible with ARM, nearly ready for ARM files
Jacob Alexander <triplehaata@gmail.com>
parents: 64
diff changeset
35 #define KEYBOARD_KEYS 0x68 // 104 - Size of the array space for the keyboard(max index)
39
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
36 #define KEYBOARD_BUFFER 24 // Max number of key signals to buffer
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
37
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
38
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
39
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
40 // ----- Variables -----
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
41
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
42 extern volatile uint8_t KeyIndex_Buffer[KEYBOARD_BUFFER];
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
43 extern volatile uint8_t KeyIndex_BufferUsed;
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
44
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
45
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
46
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
47 // ----- Functions -----
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
48
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
49 // Functions used by main.c
125
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 69
diff changeset
50 void Scan_setup( void );
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 69
diff changeset
51 uint8_t Scan_loop( void );
39
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
52
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
53
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
54 // Functions available to macro.c
125
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 69
diff changeset
55 uint8_t Scan_sendData( uint8_t dataPayload );
39
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
56
125
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 69
diff changeset
57 void Scan_finishedWithBuffer( uint8_t sentKeys );
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 69
diff changeset
58 void Scan_finishedWithUSBBuffer( uint8_t sentKeys );
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 69
diff changeset
59 void Scan_lockKeyboard( void );
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 69
diff changeset
60 void Scan_unlockKeyboard( void );
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 69
diff changeset
61 void Scan_resetKeyboard( void );
39
8e11cdc1aee4 Initial commit of the Epson QX-10 Keyboard module
Jacob Alexander <triplehaata@gmail.com>
parents:
diff changeset
62