Mercurial > louis > kiibohd-controller
annotate Scan/DPH/scan_loop.h @ 421:ad693d70c292
As per request of original author, updating license to MIT
author | Jacob Alexander <jacob@datrium.com> |
---|---|
date | Tue, 23 Feb 2016 14:35:08 -0800 |
parents | 66eccdd9ced5 |
children |
rev | line source |
---|---|
341 | 1 /* Copyright (C) 2013-2015 by Jacob Alexander |
125
8dab4014c398
Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents:
123
diff
changeset
|
2 * |
421
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
3 * Permission is hereby granted, free of charge, to any person obtaining a copy |
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
4 * of this software and associated documentation files (the "Software"), to deal |
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
5 * in the Software without restriction, including without limitation the rights |
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
7 * copies of the Software, and to permit persons to whom the Software is |
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
8 * furnished to do so, subject to the following conditions: |
123
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
9 * |
421
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
10 * The above copyright notice and this permission notice shall be included in |
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
11 * all copies or substantial portions of the Software. |
123
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
12 * |
421
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
ad693d70c292
As per request of original author, updating license to MIT
Jacob Alexander <jacob@datrium.com>
parents:
341
diff
changeset
|
19 * THE SOFTWARE. |
123
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
20 */ |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
21 |
341 | 22 #pragma once |
123
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
23 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
24 // ----- Includes ----- |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
25 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
26 // Compiler Includes |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
27 #include <stdint.h> |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
28 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
29 // Local Includes |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
30 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
31 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
32 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
33 // ----- Defines ----- |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
34 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
35 #define KEYBOARD_KEYS 0xFF // TODO Determine max number of keys |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
36 #define KEYBOARD_BUFFER 24 // Max number of key signals to buffer |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
37 // This limits the NKRO-ability, so at 24, the keyboard is 24KRO |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
38 // The buffer is really only needed for converter modules |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
39 // An alternative macro module could be written for matrix modules and still work well |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
40 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
41 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
42 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
43 // ----- Variables ----- |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
44 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
45 extern volatile uint8_t KeyIndex_Buffer[KEYBOARD_BUFFER]; |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
46 extern volatile uint8_t KeyIndex_BufferUsed; |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
47 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
48 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
49 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
50 // ----- Functions ----- |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
51 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
52 // Functions used by main.c |
138
ecb10c2cc819
DPH Scan Module now compiles with recent architecture cleanups.
Jacob Alexander <haata@kiibohd.com>
parents:
125
diff
changeset
|
53 void Scan_setup(); |
ecb10c2cc819
DPH Scan Module now compiles with recent architecture cleanups.
Jacob Alexander <haata@kiibohd.com>
parents:
125
diff
changeset
|
54 uint8_t Scan_loop(); |
123
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
55 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
56 |
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
57 // Functions available to macro.c |
125
8dab4014c398
Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents:
123
diff
changeset
|
58 uint8_t Scan_sendData( uint8_t dataPayload ); |
123
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
59 |
200
048c8a266a08
Updating DPH to compile with PartialLayer module
Jacob Alexander <haata@kiibohd.com>
parents:
138
diff
changeset
|
60 void Scan_finishedWithMacro( uint8_t sentKeys ); |
048c8a266a08
Updating DPH to compile with PartialLayer module
Jacob Alexander <haata@kiibohd.com>
parents:
138
diff
changeset
|
61 void Scan_finishedWithOutput( uint8_t sentKeys ); |
123
0c5d1fe99302
Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents:
diff
changeset
|
62 |