1 /*++ 2 3 Copyright (c) 2004, Intel Corporation. All rights reserved.<BR> 4 This program and the accompanying materials 5 are licensed and made available under the terms and conditions of the BSD License 6 which accompanies this distribution. The full text of the license may be found at 7 http://opensource.org/licenses/bsd-license.php 8 9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 12 Module Name: 13 14 SimpleTextIn.h 15 16 Abstract: 17 18 Simple Text In protocol from the EFI 1.0 specification. 19 20 Abstraction of a very simple input device like a keyboard or serial 21 terminal. 22 23 --*/ 24 25 #ifndef _SIMPLE_TEXT_IN_H_ 26 #define _SIMPLE_TEXT_IN_H_ 27 28 #define EFI_SIMPLE_TEXT_IN_PROTOCOL_GUID \ 29 { \ 30 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} \ 31 } 32 33 EFI_FORWARD_DECLARATION (EFI_SIMPLE_TEXT_IN_PROTOCOL); 34 35 // 36 // Data structures 37 // 38 typedef struct { 39 UINT16 ScanCode; 40 CHAR16 UnicodeChar; 41 } EFI_INPUT_KEY; 42 43 // 44 // Required unicode control chars 45 // 46 #define CHAR_NULL 0x0000 47 #define CHAR_BACKSPACE 0x0008 48 #define CHAR_TAB 0x0009 49 #define CHAR_LINEFEED 0x000A 50 #define CHAR_CARRIAGE_RETURN 0x000D 51 52 // 53 // EFI Scan codes 54 // 55 #define SCAN_NULL 0x0000 56 #define SCAN_UP 0x0001 57 #define SCAN_DOWN 0x0002 58 #define SCAN_RIGHT 0x0003 59 #define SCAN_LEFT 0x0004 60 #define SCAN_HOME 0x0005 61 #define SCAN_END 0x0006 62 #define SCAN_INSERT 0x0007 63 #define SCAN_DELETE 0x0008 64 #define SCAN_PAGE_UP 0x0009 65 #define SCAN_PAGE_DOWN 0x000A 66 #define SCAN_F1 0x000B 67 #define SCAN_F2 0x000C 68 #define SCAN_F3 0x000D 69 #define SCAN_F4 0x000E 70 #define SCAN_F5 0x000F 71 #define SCAN_F6 0x0010 72 #define SCAN_F7 0x0011 73 #define SCAN_F8 0x0012 74 #define SCAN_F9 0x0013 75 #define SCAN_F10 0x0014 76 #define SCAN_F11 0x0015 77 #define SCAN_F12 0x0016 78 #define SCAN_ESC 0x0017 79 80 typedef 81 EFI_STATUS 82 (EFIAPI *EFI_INPUT_RESET) ( 83 IN EFI_SIMPLE_TEXT_IN_PROTOCOL * This, 84 IN BOOLEAN ExtendedVerification 85 ) 86 /*++ 87 88 Routine Description: 89 Reset the input device and optionaly run diagnostics 90 91 Arguments: 92 This - Protocol instance pointer. 93 ExtendedVerification - Driver may perform diagnostics on reset. 94 95 Returns: 96 EFI_SUCCESS - The device was reset. 97 EFI_DEVICE_ERROR - The device is not functioning properly and could 98 not be reset. 99 100 --*/ 101 ; 102 103 typedef 104 EFI_STATUS 105 (EFIAPI *EFI_INPUT_READ_KEY) ( 106 IN EFI_SIMPLE_TEXT_IN_PROTOCOL * This, 107 OUT EFI_INPUT_KEY * Key 108 ) 109 /*++ 110 111 Routine Description: 112 Reads the next keystroke from the input device. The WaitForKey Event can 113 be used to test for existance of a keystroke via WaitForEvent () call. 114 115 Arguments: 116 This - Protocol instance pointer. 117 Key - Driver may perform diagnostics on reset. 118 119 Returns: 120 EFI_SUCCESS - The keystroke information was returned. 121 EFI_NOT_READY - There was no keystroke data availiable. 122 EFI_DEVICE_ERROR - The keydtroke information was not returned due to 123 hardware errors. 124 125 --*/ 126 ; 127 128 struct _EFI_SIMPLE_TEXT_IN_PROTOCOL { 129 EFI_INPUT_RESET Reset; 130 EFI_INPUT_READ_KEY ReadKeyStroke; 131 EFI_EVENT WaitForKey; 132 }; 133 134 extern EFI_GUID gEfiSimpleTextInProtocolGuid; 135 136 #endif 137