SimpleTextIn.h

Go to the documentation of this file.
00001 /** @file
00002   Simple Text In protocol from the UEFI 2.0 specification.
00003 
00004   Abstraction of a very simple input device like a keyboard or serial
00005   terminal.
00006 
00007   Copyright (c) 2006 - 2008, Intel Corporation
00008   All rights reserved. This program and the accompanying materials
00009   are licensed and made available under the terms and conditions of the BSD License
00010   which accompanies this distribution.  The full text of the license may be found at
00011   http://opensource.org/licenses/bsd-license.php
00012 
00013   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00014   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00015 
00016 **/
00017 
00018 #ifndef __SIMPLE_TEXT_IN_PROTOCOL_H__
00019 #define __SIMPLE_TEXT_IN_PROTOCOL_H__
00020 
00021 #include <gpxe/efi/ProcessorBind.h>
00022 
00023 #define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \
00024   { \
00025     0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
00026   }
00027 
00028 ///
00029 /// Protocol GUID defined in EFI1.1.
00030 ///
00031 #define SIMPLE_INPUT_PROTOCOL   EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID
00032 
00033 typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL  EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
00034 
00035 ///
00036 /// Backward-compatible with EFI1.1.
00037 ///
00038 typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL  SIMPLE_INPUT_INTERFACE;
00039 //
00040 // Data structures
00041 //
00042 typedef struct {
00043   UINT16  ScanCode;
00044   CHAR16  UnicodeChar;
00045 } EFI_INPUT_KEY;
00046 
00047 //
00048 // Required unicode control chars
00049 //
00050 #define CHAR_NULL             0x0000
00051 #define CHAR_BACKSPACE        0x0008
00052 #define CHAR_TAB              0x0009
00053 #define CHAR_LINEFEED         0x000A
00054 #define CHAR_CARRIAGE_RETURN  0x000D
00055 
00056 //
00057 // EFI Scan codes
00058 //
00059 #define SCAN_NULL       0x0000
00060 #define SCAN_UP         0x0001
00061 #define SCAN_DOWN       0x0002
00062 #define SCAN_RIGHT      0x0003
00063 #define SCAN_LEFT       0x0004
00064 #define SCAN_HOME       0x0005
00065 #define SCAN_END        0x0006
00066 #define SCAN_INSERT     0x0007
00067 #define SCAN_DELETE     0x0008
00068 #define SCAN_PAGE_UP    0x0009
00069 #define SCAN_PAGE_DOWN  0x000A
00070 #define SCAN_F1         0x000B
00071 #define SCAN_F2         0x000C
00072 #define SCAN_F3         0x000D
00073 #define SCAN_F4         0x000E
00074 #define SCAN_F5         0x000F
00075 #define SCAN_F6         0x0010
00076 #define SCAN_F7         0x0011
00077 #define SCAN_F8         0x0012
00078 #define SCAN_F9         0x0013
00079 #define SCAN_F10        0x0014
00080 #define SCAN_F11        0x0015
00081 #define SCAN_F12        0x0016
00082 #define SCAN_ESC        0x0017
00083 
00084 /**
00085   Reset the input device and optionaly run diagnostics
00086 
00087   @param  This                 Protocol instance pointer.
00088   @param  ExtendedVerification Driver may perform diagnostics on reset.
00089 
00090   @retval EFI_SUCCESS          The device was reset.
00091   @retval EFI_DEVICE_ERROR     The device is not functioning properly and could not be reset.
00092 
00093 **/
00094 typedef
00095 EFI_STATUS
00096 (EFIAPI *EFI_INPUT_RESET)(
00097   IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL       *This,
00098   IN BOOLEAN                              ExtendedVerification
00099   );
00100 
00101 /**
00102   Reads the next keystroke from the input device. The WaitForKey Event can
00103   be used to test for existance of a keystroke via WaitForEvent () call.
00104 
00105   @param  This Protocol instance pointer.
00106   @param  Key  Driver may perform diagnostics on reset.
00107 
00108   @retval EFI_SUCCESS      The keystroke information was returned.
00109   @retval EFI_NOT_READY    There was no keystroke data availiable.
00110   @retval EFI_DEVICE_ERROR The keydtroke information was not returned due to
00111                            hardware errors.
00112 
00113 **/
00114 typedef
00115 EFI_STATUS
00116 (EFIAPI *EFI_INPUT_READ_KEY)(
00117   IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL       *This,
00118   OUT EFI_INPUT_KEY                       *Key
00119   );
00120 
00121 ///
00122 /// The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device.
00123 /// It is the minimum required protocol for ConsoleIn.
00124 ///
00125 struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
00126   EFI_INPUT_RESET     Reset;
00127   EFI_INPUT_READ_KEY  ReadKeyStroke;
00128   ///
00129   /// Event to use with WaitForEvent() to wait for a key to be available
00130   ///
00131   EFI_EVENT           WaitForKey;
00132 };
00133 
00134 extern EFI_GUID gEfiSimpleTextInProtocolGuid;
00135 
00136 #endif

Generated on Tue Apr 6 20:01:07 2010 for gPXE by  doxygen 1.5.7.1