]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2Keyboard.h
Update the copyright notice format
[mirror_edk2.git] / IntelFrameworkModulePkg / Bus / Isa / Ps2KeyboardDxe / Ps2Keyboard.h
index fd97f28d2e3f2037f483c20411b4c0c04e584c33..4ac3cb4184ffe619261af9cf70ecca99ddc98efe 100644 (file)
@@ -1,8 +1,8 @@
-/**@file\r
+/** @file\r
   PS/2 keyboard driver header file\r
 \r
-Copyright (c) 2006 - 2007, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -12,11 +12,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#ifndef _PS2KEYBOARD_H\r
-#define _PS2KEYBOARD_H\r
+#ifndef _PS2KEYBOARD_H_\r
+#define _PS2KEYBOARD_H_\r
 \r
-#include <PiDxe.h>\r
-#include <Framework/StatusCode.h>\r
+#include <FrameworkDxe.h>\r
 \r
 #include <Protocol/SimpleTextIn.h>\r
 #include <Protocol/SimpleTextInEx.h>\r
@@ -33,6 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/BaseMemoryLib.h>\r
+#include <Library/TimerLib.h>\r
 \r
 //\r
 // Global Variables\r
@@ -180,6 +180,32 @@ InstallPs2KeyboardDriver (
 #define SCANCODE_SYS_REQ_MAKE           0x37\r
 #define SCANCODE_MAX_MAKE               0x60\r
 \r
+#define KEYBOARD_STATUS_REGISTER_HAS_OUTPUT_DATA     BIT0        ///< 0 - Output register has no data; 1 - Output register has data\r
+#define KEYBOARD_STATUS_REGISTER_HAS_INPUT_DATA      BIT1        ///< 0 - Input register has no data;  1 - Input register has data\r
+#define KEYBOARD_STATUS_REGISTER_SYSTEM_FLAG         BIT2        ///< Set to 0 after power on reset\r
+#define KEYBOARD_STATUS_REGISTER_INPUT_DATA_TYPE     BIT3        ///< 0 - Data in input register is data; 1 - Data in input register is command\r
+#define KEYBOARD_STATUS_REGISTER_ENABLE_FLAG         BIT4        ///< 0 - Keyboard is disable; 1 - Keyboard is enable\r
+#define KEYBOARD_STATUS_REGISTER_TRANSMIT_TIMEOUT    BIT5        ///< 0 - Transmit is complete without timeout; 1 - Transmit is timeout without complete\r
+#define KEYBOARD_STATUS_REGISTER_RECEIVE_TIMEOUT     BIT6        ///< 0 - Receive is complete without timeout; 1 - Receive is timeout without complete\r
+#define KEYBOARD_STATUS_REGISTER_PARITY              BIT7        ///< 0 - Odd parity; 1 - Even parity\r
+\r
+#define KEYBOARD_8042_COMMAND_READ                          0x20\r
+#define KEYBOARD_8042_COMMAND_WRITE                         0x60\r
+#define KEYBOARD_8042_COMMAND_DISABLE_MOUSE_INTERFACE       0xA7\r
+#define KEYBOARD_8042_COMMAND_ENABLE_MOUSE_INTERFACE        0xA8\r
+#define KEYBOARD_8042_COMMAND_CONTROLLER_SELF_TEST          0xAA\r
+#define KEYBOARD_8042_COMMAND_KEYBOARD_INTERFACE_SELF_TEST  0xAB\r
+#define KEYBOARD_8042_COMMAND_DISABLE_KEYBOARD_INTERFACE    0xAD\r
+\r
+#define KEYBOARD_8048_COMMAND_CLEAR_OUTPUT_DATA             0xF4\r
+#define KEYBOARD_8048_COMMAND_RESET                         0xFF\r
+#define KEYBOARD_8048_COMMAND_SELECT_SCAN_CODE_SET          0xF0\r
+\r
+#define KEYBOARD_8048_RETURN_8042_BAT_SUCCESS               0xAA\r
+#define KEYBOARD_8048_RETURN_8042_BAT_ERROR                 0xFC\r
+#define KEYBOARD_8048_RETURN_8042_ACK                       0xFA\r
+\r
+\r
 //\r
 // Keyboard Controller Status\r
 //\r
@@ -204,7 +230,7 @@ UpdateStatusLights (
   );\r
 \r
 /**\r
-  write key to keyboard\r
+  write key to keyboard.\r
 \r
   @param ConsoleIn Pointer to instance of KEYBOARD_CONSOLE_IN_DEV\r
   @param Data      value wanted to be written\r
@@ -236,7 +262,7 @@ KeyGetchar (
   );\r
 \r
 /**\r
-  Perform 8042 controller and keyboard Initialization\r
+  Perform 8042 controller and keyboard Initialization.\r
   If ExtendedVerification is TRUE, do additional test for\r
   the keyboard interface\r
 \r
@@ -253,7 +279,7 @@ InitKeyboard (
   );\r
 \r
 /**\r
-  Disable the keyboard interface of the 8042 controller\r
+  Disable the keyboard interface of the 8042 controller.\r
 \r
   @param ConsoleIn   - the device instance\r
 \r
@@ -333,7 +359,7 @@ KeyboardWaitForKey (
   );\r
 \r
 /**\r
-  Read status register\r
+  Read status register.\r
 \r
   @param ConsoleIn  Pointer to instance of KEYBOARD_CONSOLE_IN_DEV\r
 \r
@@ -350,7 +376,7 @@ KeyReadStatusRegister (
   If Keyboard receives 0xF4, it will respond with 'ACK'. If it doesn't respond, the device\r
   should not be in system.\r
 \r
-  @param[in]  BiosKeyboardPrivate   Keyboard Private Data Structure\r
+  @param[in]  ConsoleIn   Pointer to instance of KEYBOARD_CONSOLE_IN_DEV\r
 \r
   @retval     TRUE                  Keyboard in System.\r
   @retval     FALSE                 Keyboard not in System.\r