stextin.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /*++
  2. Copyright (c) 2014 Minoca Corp.
  3. This file is licensed under the terms of the GNU General Public License
  4. version 3. Alternative licensing terms are available. Contact
  5. info@minocacorp.com for details. See the LICENSE file at the root of this
  6. project for complete licensing information.
  7. Module Name:
  8. stextin.h
  9. Abstract:
  10. This header contains definitions for the UEFI Simple Text Protocol.
  11. Author:
  12. Evan Green 8-Feb-2014
  13. --*/
  14. //
  15. // ------------------------------------------------------------------- Includes
  16. //
  17. //
  18. // ---------------------------------------------------------------- Definitions
  19. //
  20. #define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \
  21. { \
  22. 0x387477C1, 0x69C7, 0x11D2, \
  23. {0x8E, 0x39, 0x0, 0xA0, 0xC9, 0x69, 0x72, 0x3B} \
  24. }
  25. //
  26. // Protocol GUID name defined in EFI1.1.
  27. //
  28. #define SIMPLE_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID
  29. //
  30. // Required unicode control chars
  31. //
  32. #define CHAR_NULL 0x0000
  33. #define CHAR_BACKSPACE 0x0008
  34. #define CHAR_TAB 0x0009
  35. #define CHAR_LINEFEED 0x000A
  36. #define CHAR_CARRIAGE_RETURN 0x000D
  37. //
  38. // EFI Scan codes
  39. //
  40. #define SCAN_NULL 0x0000
  41. #define SCAN_UP 0x0001
  42. #define SCAN_DOWN 0x0002
  43. #define SCAN_RIGHT 0x0003
  44. #define SCAN_LEFT 0x0004
  45. #define SCAN_HOME 0x0005
  46. #define SCAN_END 0x0006
  47. #define SCAN_INSERT 0x0007
  48. #define SCAN_DELETE 0x0008
  49. #define SCAN_PAGE_UP 0x0009
  50. #define SCAN_PAGE_DOWN 0x000A
  51. #define SCAN_F1 0x000B
  52. #define SCAN_F2 0x000C
  53. #define SCAN_F3 0x000D
  54. #define SCAN_F4 0x000E
  55. #define SCAN_F5 0x000F
  56. #define SCAN_F6 0x0010
  57. #define SCAN_F7 0x0011
  58. #define SCAN_F8 0x0012
  59. #define SCAN_F9 0x0013
  60. #define SCAN_F10 0x0014
  61. #define SCAN_ESC 0x0017
  62. //
  63. // ------------------------------------------------------ Data Type Definitions
  64. //
  65. typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
  66. //
  67. // Protocol name in EFI1.1 for backwards compatibility.
  68. //
  69. typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL SIMPLE_INPUT_INTERFACE;
  70. /*++
  71. Structure Description:
  72. This structure defines the keystroke information for a pressed key.
  73. Members:
  74. ScanCode - Stores the scan code of the key.
  75. UnicodeChar - Stores the Unicode character equivalent of the key.
  76. --*/
  77. typedef struct {
  78. UINT16 ScanCode;
  79. CHAR16 UnicodeChar;
  80. } EFI_INPUT_KEY;
  81. typedef
  82. EFI_STATUS
  83. (EFIAPI *EFI_INPUT_RESET) (
  84. EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
  85. BOOLEAN ExtendedVerification
  86. );
  87. /*++
  88. Routine Description:
  89. This routine resets the input device and optionally runs diagnostics.
  90. Arguments:
  91. This - Supplies a pointer to the protocol instance.
  92. ExtendedVerification - Supplies a boolean indicating if the driver should
  93. perform diagnostics on reset.
  94. Return Value:
  95. EFI_SUCCESS on success.
  96. EFI_DEVICE_ERROR if the device is not functioning properly and could not be
  97. reset.
  98. --*/
  99. typedef
  100. EFI_STATUS
  101. (EFIAPI *EFI_INPUT_READ_KEY) (
  102. EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
  103. EFI_INPUT_KEY *Key
  104. );
  105. /*++
  106. Routine Description:
  107. This routine reads the next keystroke from the input device. The WaitForKey
  108. event can be used to test for the existence of a keystroke via the
  109. WaitForEvent call.
  110. Arguments:
  111. This - Supplies a pointer to the protocol instance.
  112. Key - Supplies a pointer where the keystroke information for the pressed
  113. key will be returned.
  114. Return Value:
  115. EFI_SUCCESS on success.
  116. EFI_NOT_READY if there was no keystroke data available.
  117. EFI_DEVICE_ERROR if the device is not functioning properly and could not be
  118. read.
  119. --*/
  120. /*++
  121. Structure Description:
  122. This structure defines the simple text protocol used on the ConsoleIn
  123. device. This is the minimum required protocol for console input.
  124. Members:
  125. Reset - Stores a pointer to the reset device function.
  126. ReadKeyStroke - Stores a pointer to a function used to read input key
  127. information.
  128. WaitForKey - Stores the event that can be waited on to wait for a key to
  129. be available.
  130. --*/
  131. struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
  132. EFI_INPUT_RESET Reset;
  133. EFI_INPUT_READ_KEY ReadKeyStroke;
  134. EFI_EVENT WaitForKey;
  135. };
  136. //
  137. // -------------------------------------------------------------------- Globals
  138. //
  139. //
  140. // -------------------------------------------------------- Function Prototypes
  141. //