annotate Output/usbMuxUart/output_com.h @ 300:7119c2149abb

Fixing compiler errors for usbMuxUart Output module - Removing (currently) redundant usbMuxUart capabilities.kll file - Issues were due to the recent AddModule cmake function addition
author Jacob Alexander <haata@kiibohd.com>
date Fri, 06 Mar 2015 23:37:09 -0800
parents d5bf41d7f7ef
children e8841d3c6db5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
275
d5bf41d7f7ef Initial code for USB cable detection
Jacob Alexander <haata@kiibohd.com>
parents: 245
diff changeset
1 /* Copyright (C) 2013-2015 by Jacob Alexander
172
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
2 *
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
4 * of this software and associated documentation files (the "Software"), to deal
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
5 * in the Software without restriction, including without limitation the rights
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
7 * copies of the Software, and to permit persons to whom the Software is
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
8 * furnished to do so, subject to the following conditions:
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
9 *
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
10 * The above copyright notice and this permission notice shall be included in
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
11 * all copies or substantial portions of the Software.
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
12 *
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
19 * THE SOFTWARE.
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
20 */
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
21
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
22 #ifndef __output_com_h
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
23 #define __output_com_h
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
24
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
25 // ----- Includes -----
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
26
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
27 // Compiler Includes
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
28 #include <stdint.h>
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
29
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
30 // Local Includes
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
31 #include <buildvars.h> // Defines USB Parameters, partially generated by CMake
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
32
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
33
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
34
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
35 // ----- Defines -----
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
36
227
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
37 // Max size of key buffer needed for NKRO
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
38 // Boot mode uses only the first 6 bytes
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
39 #define USB_NKRO_BITFIELD_SIZE_KEYS 26
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
40 #define USB_BOOT_MAX_KEYS 6
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
41
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
42
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
43
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
44 // ----- Enumerations -----
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
45
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
46 // USB NKRO state transitions (indicates which Report ID's need refreshing)
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
47 // Boot mode just checks if any keys were changed (as everything is sent every time)
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
48 typedef enum USBKeyChangeState {
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
49 USBKeyChangeState_None = 0x00,
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
50 USBKeyChangeState_Modifiers = 0x01,
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
51 USBKeyChangeState_MainKeys = 0x02,
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
52 USBKeyChangeState_SecondaryKeys = 0x04,
245
02cdd66d8856 Fixing pjrc bug affecting Mac OSX CDC driver
Jacob Alexander <haata@kiibohd.com>
parents: 227
diff changeset
53 USBKeyChangeState_TertiaryKeys = 0x08,
02cdd66d8856 Fixing pjrc bug affecting Mac OSX CDC driver
Jacob Alexander <haata@kiibohd.com>
parents: 227
diff changeset
54 USBKeyChangeState_System = 0x10,
02cdd66d8856 Fixing pjrc bug affecting Mac OSX CDC driver
Jacob Alexander <haata@kiibohd.com>
parents: 227
diff changeset
55 USBKeyChangeState_Consumer = 0x20,
02cdd66d8856 Fixing pjrc bug affecting Mac OSX CDC driver
Jacob Alexander <haata@kiibohd.com>
parents: 227
diff changeset
56 USBKeyChangeState_All = 0x3F,
227
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
57 } USBKeyChangeState;
172
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
58
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
59
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
60
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
61 // ----- Variables -----
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
62
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
63 // Variables used to communciate to the output module
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
64 // XXX Even if the output module is not USB, this is internally understood keymapping scheme
227
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
65 extern uint8_t USBKeys_Modifiers;
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
66 extern uint8_t USBKeys_Keys[USB_NKRO_BITFIELD_SIZE_KEYS];
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
67 extern uint8_t USBKeys_Sent;
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
68 extern volatile uint8_t USBKeys_LEDs;
172
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
69
227
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
70 extern uint8_t USBKeys_SysCtrl; // 1KRO container for System Control HID table
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
71 extern uint16_t USBKeys_ConsCtrl; // 1KRO container for Consumer Control HID table
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
72
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
73 extern volatile uint8_t USBKeys_Protocol; // 0 - Boot Mode, 1 - NKRO Mode
172
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
74
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
75 // Misc variables (XXX Some are only properly utilized using AVR)
227
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
76 extern uint8_t USBKeys_Idle_Config;
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
77 extern uint8_t USBKeys_Idle_Count;
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
78
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
79 extern USBKeyChangeState USBKeys_Changed;
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
80
275
d5bf41d7f7ef Initial code for USB cable detection
Jacob Alexander <haata@kiibohd.com>
parents: 245
diff changeset
81 extern uint8_t Output_Available; // 0 - Output module not fully functional, 1 - Output module working
d5bf41d7f7ef Initial code for USB cable detection
Jacob Alexander <haata@kiibohd.com>
parents: 245
diff changeset
82
300
7119c2149abb Fixing compiler errors for usbMuxUart Output module
Jacob Alexander <haata@kiibohd.com>
parents: 275
diff changeset
83 extern uint8_t Output_DebugMode; // 0 - Debug disabled, 1 - Debug enabled
7119c2149abb Fixing compiler errors for usbMuxUart Output module
Jacob Alexander <haata@kiibohd.com>
parents: 275
diff changeset
84
227
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
85
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
86
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
87 // ----- Capabilities -----
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
88
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
89 void Output_consCtrlSend_capability( uint8_t state, uint8_t stateType, uint8_t *args );
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
90 void Output_sysCtrlSend_capability( uint8_t state, uint8_t stateType, uint8_t *args );
ed05fa3555d4 Updating usbMuxUart for NKRO
Jacob Alexander <haata@kiibohd.com>
parents: 172
diff changeset
91 void Output_usbCodeSend_capability( uint8_t state, uint8_t stateType, uint8_t *args );
172
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
92
300
7119c2149abb Fixing compiler errors for usbMuxUart Output module
Jacob Alexander <haata@kiibohd.com>
parents: 275
diff changeset
93 // Configuration capabilities
7119c2149abb Fixing compiler errors for usbMuxUart Output module
Jacob Alexander <haata@kiibohd.com>
parents: 275
diff changeset
94 void Output_kbdProtocolBoot_capability( uint8_t state, uint8_t stateType, uint8_t *args );
7119c2149abb Fixing compiler errors for usbMuxUart Output module
Jacob Alexander <haata@kiibohd.com>
parents: 275
diff changeset
95 void Output_kbdProtocolNKRO_capability( uint8_t state, uint8_t stateType, uint8_t *args );
7119c2149abb Fixing compiler errors for usbMuxUart Output module
Jacob Alexander <haata@kiibohd.com>
parents: 275
diff changeset
96
172
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
97
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
98
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
99 // ----- Functions -----
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
100
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
101 void Output_setup();
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
102 void Output_send();
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
103
300
7119c2149abb Fixing compiler errors for usbMuxUart Output module
Jacob Alexander <haata@kiibohd.com>
parents: 275
diff changeset
104 void Output_flushBuffers();
7119c2149abb Fixing compiler errors for usbMuxUart Output module
Jacob Alexander <haata@kiibohd.com>
parents: 275
diff changeset
105
172
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
106 void Output_firmwareReload();
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
107 void Output_softReset();
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
108
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
109 // Relies on USB serial module
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
110 unsigned int Output_availablechar();
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
111
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
112 int Output_getchar();
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
113 int Output_putchar( char c );
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
114 int Output_putstr( char* str );
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
115
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
116 #endif
a30bddad4115 Adding UART and UART + USB muxed CLI output.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
117