stextin.h 4.2 KB

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