Mercurial > louis > kiibohd-controller
annotate Scan/Tandy1000/scan_loop.h @ 36:00a06e011158
Pre Tandy1000 overhaul
author | Jacob Alexander <triplehaata@gmail.com> |
---|---|
date | Mon, 28 Nov 2011 22:20:04 -0800 |
parents | c06a5ebb4fca |
children | 8ae6c6f206db |
rev | line source |
---|---|
26
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
1 /* Copyright (C) 2011 by Jacob Alexander |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
2 * |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
3 * Permission is hereby granted, free of charge, to any person obtaining a copy |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
4 * of this software and associated documentation files (the "Software"), to deal |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
5 * in the Software without restriction, including without limitation the rights |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
7 * copies of the Software, and to permit persons to whom the Software is |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
8 * furnished to do so, subject to the following conditions: |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
9 * |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
10 * The above copyright notice and this permission notice shall be included in |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
11 * all copies or substantial portions of the Software. |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
12 * |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
19 * THE SOFTWARE. |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
20 */ |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
21 |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
22 #ifndef __SCAN_LOOP_H |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
23 #define __SCAN_LOOP_H |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
24 |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
25 // ----- Includes ----- |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
26 |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
27 // Compiler Includes |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
28 #include <stdint.h> |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
29 |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
30 // Local Includes |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
31 |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
32 |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
33 |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
34 // ----- Defines ----- |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
35 |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
36 #define KEYBOARD_SIZE 0x5A // 90 - Size of the array space for the keyboardr(max index) |
36
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
26
diff
changeset
|
37 #define KEYBOARD_BUFFER 24 // Max number of key signals to buffer |
26
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
38 |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
39 |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
40 |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
41 // ----- Variables ----- |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
42 |
36
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
26
diff
changeset
|
43 extern volatile uint8_t KeyIndex_Buffer[KEYBOARD_BUFFER]; |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
26
diff
changeset
|
44 extern volatile uint8_t KeyIndex_BufferUsed; |
26
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
45 |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
46 |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
47 |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
48 // ----- Functions ----- |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
49 |
36
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
26
diff
changeset
|
50 // Functions used by main.c |
26
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
51 void scan_setup( void ); |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
52 uint8_t scan_loop( void ); |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
53 |
36
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
26
diff
changeset
|
54 |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
26
diff
changeset
|
55 // Functions available to macro.c |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
26
diff
changeset
|
56 uint8_t scan_sendData( uint8_t dataPayload ); |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
26
diff
changeset
|
57 |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
26
diff
changeset
|
58 void scan_finishedWithBuffer( void ); |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
26
diff
changeset
|
59 void scan_lockKeyboard( void ); |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
26
diff
changeset
|
60 void scan_unlockKeyboard( void ); |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
26
diff
changeset
|
61 void scan_resetKeyboard( void ); |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
26
diff
changeset
|
62 |
00a06e011158
Pre Tandy1000 overhaul
Jacob Alexander <triplehaata@gmail.com>
parents:
26
diff
changeset
|
63 |
26
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
64 #endif // __SCAN_LOOP_H |
c06a5ebb4fca
Tandy 1000 Converter, basicly works, except for packet mismatches
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
65 |