Mercurial > louis > kiibohd-controller
annotate Scan/MBC-55X/scan_loop.h @ 450:48ede6680396 master
Updating MBC-55X scan module
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Sun, 12 Jun 2016 15:53:25 -0700 |
parents | 66eccdd9ced5 |
children |
rev | line source |
---|---|
450
48ede6680396
Updating MBC-55X scan module
Jacob Alexander <haata@kiibohd.com>
parents:
341
diff
changeset
|
1 /* Copyright (C) 2013-2016 by Jacob Alexander |
125
8dab4014c398
Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents:
70
diff
changeset
|
2 * |
70
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
3 * Permission is hereby granted, free of charge, to any person obtaining a copy |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
4 * of this software and associated documentation files (the "Software"), to deal |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
5 * in the Software without restriction, including without limitation the rights |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
7 * copies of the Software, and to permit persons to whom the Software is |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
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:
70
diff
changeset
|
9 * |
70
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
10 * The above copyright notice and this permission notice shall be included in |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
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:
70
diff
changeset
|
12 * |
70
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
19 * THE SOFTWARE. |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
20 */ |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
21 |
341 | 22 #pragma once |
70
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
23 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
24 // ----- Includes ----- |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
25 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
26 // Compiler Includes |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
27 #include <stdint.h> |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
28 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
29 // Local Includes |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
30 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
31 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
32 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
33 // ----- Defines ----- |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
34 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
35 #define KEYBOARD_KEYS 0x7F // 127 - Size of the array space for the keyboard(max index) |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
36 #define KEYBOARD_BUFFER 24 // Max number of key signals to buffer |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
37 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
38 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
39 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
40 // ----- Variables ----- |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
41 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
42 extern volatile uint8_t KeyIndex_Buffer[KEYBOARD_BUFFER]; |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
43 extern volatile uint8_t KeyIndex_BufferUsed; |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
44 extern volatile uint8_t KeyIndex_Add_InputSignal; |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
45 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
46 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
47 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
48 // ----- Functions ----- |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
49 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
50 // Functions used by main.c |
450
48ede6680396
Updating MBC-55X scan module
Jacob Alexander <haata@kiibohd.com>
parents:
341
diff
changeset
|
51 void Scan_setup(); |
48ede6680396
Updating MBC-55X scan module
Jacob Alexander <haata@kiibohd.com>
parents:
341
diff
changeset
|
52 uint8_t Scan_loop(); |
70
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
53 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
54 |
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
55 // Functions available to macro.c |
125
8dab4014c398
Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents:
70
diff
changeset
|
56 uint8_t Scan_sendData( uint8_t dataPayload ); |
70
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
57 |
450
48ede6680396
Updating MBC-55X scan module
Jacob Alexander <haata@kiibohd.com>
parents:
341
diff
changeset
|
58 void Scan_finishedWithMacro( uint8_t sentKeys ); |
48ede6680396
Updating MBC-55X scan module
Jacob Alexander <haata@kiibohd.com>
parents:
341
diff
changeset
|
59 void Scan_finishedWithOutput( uint8_t sentKeys ); |
125
8dab4014c398
Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents:
70
diff
changeset
|
60 void Scan_lockKeyboard( void ); |
8dab4014c398
Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents:
70
diff
changeset
|
61 void Scan_unlockKeyboard( void ); |
8dab4014c398
Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents:
70
diff
changeset
|
62 void Scan_resetKeyboard( void ); |
450
48ede6680396
Updating MBC-55X scan module
Jacob Alexander <haata@kiibohd.com>
parents:
341
diff
changeset
|
63 void Scan_currentChange( unsigned int current ); |
70
23600aaa5e15
Adding initial Teensy 3 support, compiles, but not fully functional yet.
Jacob Alexander <triplehaata@gmail.com>
parents:
diff
changeset
|
64 |