annotate Output/pjrcUSB/output_com.h @ 449:45feb80a2ad1

Major USB update, fixes most (if not all) known issues USB - General - Refactored descriptors - Enabled/Disable USB endpoints - Added debug flags for special features - Code cleanup - Interface count calculation based off of enabled endpoints - Delayed wTotalLength calculation to simplify descriptor offsets - Re-ordered endpoints and interfaces - Added more debug output - Added usbInitTime to show how long keyboard initialization took (Useful when debugging bad init sequences) - Added function for usb_resume() which takes care of the resume sequence * Resume is now only called if packets are starting to timeout USB - Special Options - Added enableDeviceRestartOnUSBTimeout * A last resort hammer for bad USB Chipsets/OSs, don't use if you can help it * Disabled - Added enableUSBResume * Enables host resume wake-up signalling, required to wake a computer from sleep * Enabled - Added enableUSBLowPowerNegotiation * Enables power negotiation hack * Required to use firmware with an IPad and other hard-limit low-power USB hosts * Hasn't been tested with the recent changes * Disabled - Added enableUSBSuspend * Enables power down events on host USB bus suspend * Enabled USB - Keyboard - Attempted to cleanup HID SET_REPORT * Works much better * Still has an issue under Linux which generates *a lot* of NAKs (initializes quickly regardless) + Not present on other keyboards + SETUP -> OUT -> IN : This sequence is the problem + Specifically during the OUT phase - Enabled USB - CDC Virtual Serial Port - Code cleanup - Added convenience struct USBCDCLineCoding for easier debugging - Attempted to cleanup CDC_SET_LING_CODING * Works much better * Still has an issue under Linux which generates *a lot* of NAKs (initializes quickly regardless) + SETUP -> OUT -> IN : This sequence is the problem + Specifically during the OUT phase + Likely the same issues as HID SET_REPORT - Enabled USB - Mouse - Enabled USB - Joystick - Disabled USB - RawIO - Initial code, API not used yet - Disabled DFU - Updated load script, now faster
author Jacob Alexander <haata@kiibohd.com>
date Tue, 31 May 2016 00:19:45 -0700
parents 56237ba5da6f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
420
23a1868b4ac2 Adding dynamic USB power support
Jacob Alexander <haata@kiibohd.com>
parents: 370
diff changeset
1 /* Copyright (C) 2013-2016 by Jacob Alexander
122
2bb16439e6ca Preparing Teensy 3.1 and CLI merge for DPH controller code.
Jacob Alexander <haata@kiibohd.com>
parents: 109
diff changeset
2 *
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
4 * of this software and associated documentation files (the "Software"), to deal
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
5 * in the Software without restriction, including without limitation the rights
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
7 * copies of the Software, and to permit persons to whom the Software is
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
8 * furnished to do so, subject to the following conditions:
122
2bb16439e6ca Preparing Teensy 3.1 and CLI merge for DPH controller code.
Jacob Alexander <haata@kiibohd.com>
parents: 109
diff changeset
9 *
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
10 * The above copyright notice and this permission notice shall be included in
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
11 * all copies or substantial portions of the Software.
122
2bb16439e6ca Preparing Teensy 3.1 and CLI merge for DPH controller code.
Jacob Alexander <haata@kiibohd.com>
parents: 109
diff changeset
12 *
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
19 * THE SOFTWARE.
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
20 */
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
21
341
66eccdd9ced5 Code cleanup
Jacob Alexander <haata@kiibohd.com>
parents: 322
diff changeset
22 #pragma once
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
23
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
24 // ----- Includes -----
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
25
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
26 // Compiler Includes
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
27 #include <stdint.h>
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
28
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
29 // Local Includes
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
30 #include <buildvars.h> // Defines USB Parameters, partially generated by CMake
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
31
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
32
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
33
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
34 // ----- Defines -----
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
35
223
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
36 // Max size of key buffer needed for NKRO
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
37 // Boot mode uses only the first 6 bytes
237
01b686cc94e8 Fixing USB NKRO key buffer bug
Jacob Alexander <haata@kiibohd.com>
parents: 236
diff changeset
38 #define USB_NKRO_BITFIELD_SIZE_KEYS 27
223
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
39 #define USB_BOOT_MAX_KEYS 6
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
40
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
41
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
42
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
43 // ----- Enumerations -----
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
44
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
45 // USB NKRO state transitions (indicates which Report ID's need refreshing)
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
46 // Boot mode just checks if any keys were changed (as everything is sent every time)
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
47 typedef enum USBKeyChangeState {
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
48 USBKeyChangeState_None = 0x00,
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
49 USBKeyChangeState_Modifiers = 0x01,
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
50 USBKeyChangeState_MainKeys = 0x02,
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
51 USBKeyChangeState_SecondaryKeys = 0x04,
236
d494b74d5242 Fixed Linux NKRO bitmap bug.
Jacob Alexander <haata@kiibohd.com>
parents: 234
diff changeset
52 USBKeyChangeState_TertiaryKeys = 0x08,
248
2e098cf8f71d Fixing Linux NKRO Delete bug
Jacob Alexander <haata@kiibohd.com>
parents: 244
diff changeset
53 USBKeyChangeState_QuartiaryKeys = 0x10,
2e098cf8f71d Fixing Linux NKRO Delete bug
Jacob Alexander <haata@kiibohd.com>
parents: 244
diff changeset
54 USBKeyChangeState_System = 0x20,
2e098cf8f71d Fixing Linux NKRO Delete bug
Jacob Alexander <haata@kiibohd.com>
parents: 244
diff changeset
55 USBKeyChangeState_Consumer = 0x40,
2e098cf8f71d Fixing Linux NKRO Delete bug
Jacob Alexander <haata@kiibohd.com>
parents: 244
diff changeset
56 USBKeyChangeState_All = 0x7F,
223
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
57 } USBKeyChangeState;
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
58
430
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
59 // Allows for selective USB descriptor pushes
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
60 // However, in most cases everything is updated for each packet push
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
61 typedef enum USBMouseChangeState {
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
62 USBMouseChangeState_None = 0x00,
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
63 USBMouseChangeState_Buttons = 0x01,
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
64 USBMouseChangeState_Relative = 0x02,
447
56237ba5da6f Adding auto-restart support whenever USB gets into an odd state
Jacob Alexander <haata@kiibohd.com>
parents: 430
diff changeset
65 USBMouseChangeState_All = 0x03,
430
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
66 } USBMouseChangeState;
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
67
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
68
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
69
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
70 // ----- Variables -----
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
71
125
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 123
diff changeset
72 // Variables used to communciate to the output module
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 123
diff changeset
73 // XXX Even if the output module is not USB, this is internally understood keymapping scheme
223
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
74 extern uint8_t USBKeys_Modifiers;
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
75 extern uint8_t USBKeys_Keys[USB_NKRO_BITFIELD_SIZE_KEYS];
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
76 extern uint8_t USBKeys_Sent;
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
77 extern volatile uint8_t USBKeys_LEDs;
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
78
223
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
79 extern uint8_t USBKeys_SysCtrl; // 1KRO container for System Control HID table
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
80 extern uint16_t USBKeys_ConsCtrl; // 1KRO container for Consumer Control HID table
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
81
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
82 extern volatile uint8_t USBKeys_Protocol; // 0 - Boot Mode, 1 - NKRO Mode
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
83
429
970dab727f47 Adding basic mouse button support
Jacob Alexander <haata@kiibohd.com>
parents: 420
diff changeset
84 extern volatile uint16_t USBMouse_Buttons; // Bitmask for mouse buttons
430
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
85 extern volatile uint16_t USBMouse_Relative_x;
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
86 extern volatile uint16_t USBMouse_Relative_y;
429
970dab727f47 Adding basic mouse button support
Jacob Alexander <haata@kiibohd.com>
parents: 420
diff changeset
87
447
56237ba5da6f Adding auto-restart support whenever USB gets into an odd state
Jacob Alexander <haata@kiibohd.com>
parents: 430
diff changeset
88 // Keeps track of the idle timeout refresh (used on Mac OSX)
223
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
89 extern uint8_t USBKeys_Idle_Config;
447
56237ba5da6f Adding auto-restart support whenever USB gets into an odd state
Jacob Alexander <haata@kiibohd.com>
parents: 430
diff changeset
90 extern uint32_t USBKeys_Idle_Expiry;
56237ba5da6f Adding auto-restart support whenever USB gets into an odd state
Jacob Alexander <haata@kiibohd.com>
parents: 430
diff changeset
91 extern uint8_t USBKeys_Idle_Count; // AVR only
223
fc3b9cb190cc Adding NKRO support to AVR/DPH.
Jacob Alexander <haata@kiibohd.com>
parents: 218
diff changeset
92
430
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
93 extern USBKeyChangeState USBKeys_Changed;
d3cef419c849 Adding relative movement mouse key support
Jacob Alexander <haata@kiibohd.com>
parents: 429
diff changeset
94 extern USBMouseChangeState USBMouse_Changed;
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
95
347
136e47478441 UARTConnect enumeration working!
Jacob Alexander <haata@kiibohd.com>
parents: 341
diff changeset
96 extern volatile uint8_t Output_Available; // 0 - Output module not fully functional, 1 - Output module working
275
d5bf41d7f7ef Initial code for USB cable detection
Jacob Alexander <haata@kiibohd.com>
parents: 248
diff changeset
97
285
1495b4504a59 Adding outputDebug command
Jacob Alexander <haata@kiibohd.com>
parents: 275
diff changeset
98 extern uint8_t Output_DebugMode; // 0 - Debug disabled, 1 - Debug enabled
1495b4504a59 Adding outputDebug command
Jacob Alexander <haata@kiibohd.com>
parents: 275
diff changeset
99
420
23a1868b4ac2 Adding dynamic USB power support
Jacob Alexander <haata@kiibohd.com>
parents: 370
diff changeset
100 extern uint16_t Output_ExtCurrent_Available; // mA - Set by outside module if not using USB (i.e. Interconnect)
23a1868b4ac2 Adding dynamic USB power support
Jacob Alexander <haata@kiibohd.com>
parents: 370
diff changeset
101
449
45feb80a2ad1 Major USB update, fixes most (if not all) known issues
Jacob Alexander <haata@kiibohd.com>
parents: 447
diff changeset
102 extern volatile uint32_t USBInit_TimeStart; // Timetamp when usb_init was triggered
45feb80a2ad1 Major USB update, fixes most (if not all) known issues
Jacob Alexander <haata@kiibohd.com>
parents: 447
diff changeset
103 extern volatile uint32_t USBInit_TimeEnd; // Timetamp since last call to the Configuration endpoint
45feb80a2ad1 Major USB update, fixes most (if not all) known issues
Jacob Alexander <haata@kiibohd.com>
parents: 447
diff changeset
104 extern volatile uint16_t USBInit_Ticks; // Number of times the end time has been updated
45feb80a2ad1 Major USB update, fixes most (if not all) known issues
Jacob Alexander <haata@kiibohd.com>
parents: 447
diff changeset
105
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
106
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
107
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
108 // ----- Functions -----
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
109
125
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 123
diff changeset
110 void Output_setup();
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 123
diff changeset
111 void Output_send();
122
2bb16439e6ca Preparing Teensy 3.1 and CLI merge for DPH controller code.
Jacob Alexander <haata@kiibohd.com>
parents: 109
diff changeset
112
234
aaf14110ea7b Adding NKRO and Boot mode capabilities.
Jacob Alexander <haata@kiibohd.com>
parents: 223
diff changeset
113 void Output_flushBuffers();
aaf14110ea7b Adding NKRO and Boot mode capabilities.
Jacob Alexander <haata@kiibohd.com>
parents: 223
diff changeset
114
125
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 123
diff changeset
115 void Output_firmwareReload();
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 123
diff changeset
116 void Output_softReset();
123
0c5d1fe99302 Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents: 122
diff changeset
117
0c5d1fe99302 Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents: 122
diff changeset
118 // Relies on USB serial module
125
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 123
diff changeset
119 unsigned int Output_availablechar();
123
0c5d1fe99302 Adding CLI and CDC Serial support for Teensy 2.0 and Teensy 2.0++
Jacob Alexander <haata@kiibohd.com>
parents: 122
diff changeset
120
420
23a1868b4ac2 Adding dynamic USB power support
Jacob Alexander <haata@kiibohd.com>
parents: 370
diff changeset
121 // Returns the total mA available (total, if used in a chain, each device will have to use a slice of it)
23a1868b4ac2 Adding dynamic USB power support
Jacob Alexander <haata@kiibohd.com>
parents: 370
diff changeset
122 unsigned int Output_current_available();
23a1868b4ac2 Adding dynamic USB power support
Jacob Alexander <haata@kiibohd.com>
parents: 370
diff changeset
123
23a1868b4ac2 Adding dynamic USB power support
Jacob Alexander <haata@kiibohd.com>
parents: 370
diff changeset
124 void Output_update_external_current( unsigned int current );
23a1868b4ac2 Adding dynamic USB power support
Jacob Alexander <haata@kiibohd.com>
parents: 370
diff changeset
125 void Output_update_usb_current( unsigned int current );
23a1868b4ac2 Adding dynamic USB power support
Jacob Alexander <haata@kiibohd.com>
parents: 370
diff changeset
126
125
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 123
diff changeset
127 int Output_getchar();
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 123
diff changeset
128 int Output_putchar( char c );
8dab4014c398 Major code cleanup and preparation for PartialMap Macro Module
Jacob Alexander <haata@kiibohd.com>
parents: 123
diff changeset
129 int Output_putstr( char* str );
104
e84738d174bc Moving USB to Output in preparation for additional Output types.
Jacob Alexander <haata@kiibohd.com>
parents:
diff changeset
130