TianoCore EDK2 master
|
#include "Ps2Keyboard.h"
Go to the source code of this file.
Variables | |
struct { | |
UINT8 ScanCode | |
follows value defined in Scan Code Set1 More... | |
UINT16 EfiScanCode | |
CHAR16 UnicodeChar | |
CHAR16 ShiftUnicodeChar | |
} | ConvertKeyboardScanCodeToEfiKey [] |
UINTN | mWaitForValueTimeOut = KEYBOARD_WAITFORVALUE_TIMEOUT |
BOOLEAN | mEnableMouseInterface |
Routines that access 8042 keyboard controller
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Ps2KbdCtrller.c.
BOOLEAN EFIAPI CheckKeyboardConnect | ( | IN KEYBOARD_CONSOLE_IN_DEV * | ConsoleIn | ) |
Check whether there is Ps/2 Keyboard device in system by 0xF4 Keyboard Command If Keyboard receives 0xF4, it will respond with 'ACK'. If it doesn't respond, the device should not be in system.
[in] | ConsoleIn | Keyboard Private Data Structure |
TRUE | Keyboard in System. |
FALSE | Keyboard not in System. |
Definition at line 1840 of file Ps2KbdCtrller.c.
UINTN GetScancodeBufCount | ( | IN SCAN_CODE_QUEUE * | Queue | ) |
Return the count of scancode in the queue.
Queue | Pointer to instance of SCAN_CODE_QUEUE. |
Definition at line 568 of file Ps2KbdCtrller.c.
EFI_STATUS GetScancodeBufHead | ( | IN SCAN_CODE_QUEUE * | Queue, |
IN UINTN | Count, | ||
OUT UINT8 * | Buf | ||
) |
Read several bytes from the scancode buffer without removing them. This function is called to see if there are enough bytes of scancode representing a single key.
Queue | Pointer to instance of SCAN_CODE_QUEUE. |
Count | Number of bytes to be read |
Buf | Store the results |
EFI_SUCCESS | success to scan the keyboard code |
EFI_NOT_READY | invalid parameter |
Definition at line 592 of file Ps2KbdCtrller.c.
VOID InitializeKeyState | ( | IN KEYBOARD_CONSOLE_IN_DEV * | ConsoleIn, |
OUT EFI_KEY_STATE * | KeyState | ||
) |
Initialize the key state.
ConsoleIn | The KEYBOARD_CONSOLE_IN_DEV instance. |
KeyState | A pointer to receive the key state information. |
Definition at line 1111 of file Ps2KbdCtrller.c.
EFI_STATUS InitKeyboard | ( | IN OUT KEYBOARD_CONSOLE_IN_DEV * | ConsoleIn, |
IN BOOLEAN | ExtendedVerification | ||
) |
Perform 8042 controller and keyboard Initialization. If ExtendedVerification is TRUE, do additional test for the keyboard interface
ConsoleIn | - KEYBOARD_CONSOLE_IN_DEV instance pointer |
ExtendedVerification | - indicates a thorough initialization |
EFI_DEVICE_ERROR | Fail to init keyboard |
EFI_SUCCESS | Success to init keyboard |
Definition at line 1483 of file Ps2KbdCtrller.c.
EFI_STATUS KeyboardCommand | ( | IN KEYBOARD_CONSOLE_IN_DEV * | ConsoleIn, |
IN UINT8 | Data | ||
) |
Issue keyboard command.
ConsoleIn | Pointer to instance of KEYBOARD_CONSOLE_IN_DEV |
Data | The buff holding the command |
EFI_TIMEOUT | Keyboard is not ready to issuing |
EFI_SUCCESS | Success to issue keyboard command |
Definition at line 924 of file Ps2KbdCtrller.c.
VOID KeyboardError | ( | IN KEYBOARD_CONSOLE_IN_DEV * | ConsoleIn, |
IN CHAR16 * | ErrMsg | ||
) |
Display error message.
ConsoleIn | Pointer to instance of KEYBOARD_CONSOLE_IN_DEV |
ErrMsg | Unicode string of error message |
Definition at line 751 of file Ps2KbdCtrller.c.
EFI_STATUS KeyboardRead | ( | IN KEYBOARD_CONSOLE_IN_DEV * | ConsoleIn, |
OUT UINT8 * | Data | ||
) |
Read key value .
ConsoleIn | - Pointer to instance of KEYBOARD_CONSOLE_IN_DEV |
Data | - Pointer to outof buffer for keeping key value |
EFI_TIMEOUT | Status register time out |
EFI_SUCCESS | Success to read keyboard |
Definition at line 835 of file Ps2KbdCtrller.c.
Timer event handler: read a series of scancodes from 8042 and put them into memory scancode buffer. it read as much scancodes to either fill the memory buffer or empty the keyboard buffer. It is registered as running under TPL_NOTIFY
Event | The timer event |
Context | A KEYBOARD_CONSOLE_IN_DEV pointer |
Definition at line 772 of file Ps2KbdCtrller.c.
EFI_STATUS KeyboardWaitForValue | ( | IN KEYBOARD_CONSOLE_IN_DEV * | ConsoleIn, |
IN UINT8 | Value | ||
) |
wait for a specific value to be presented on 8042 Data register by keyboard and then read it, used in keyboard commands ack
ConsoleIn | Pointer to instance of KEYBOARD_CONSOLE_IN_DEV |
Value | the value wanted to be waited. |
EFI_TIMEOUT | Fail to get specific value in given time |
EFI_SUCCESS | Success to get specific value in given time. |
Definition at line 989 of file Ps2KbdCtrller.c.
EFI_STATUS KeyboardWrite | ( | IN KEYBOARD_CONSOLE_IN_DEV * | ConsoleIn, |
IN UINT8 | Data | ||
) |
write key to keyboard
ConsoleIn | Pointer to instance of KEYBOARD_CONSOLE_IN_DEV |
Data | value wanted to be written |
EFI_TIMEOUT | The input buffer register is full for putting new value util timeout |
EFI_SUCCESS | The new value is success put into input buffer register. |
Definition at line 878 of file Ps2KbdCtrller.c.
VOID KeyGetchar | ( | IN OUT KEYBOARD_CONSOLE_IN_DEV * | ConsoleIn | ) |
Get scancode from scancode buffer and translate into EFI-scancode and unicode defined by EFI spec.
The function is always called in TPL_NOTIFY.
ConsoleIn | KEYBOARD_CONSOLE_IN_DEV instance pointer |
Definition at line 1145 of file Ps2KbdCtrller.c.
UINT8 KeyReadDataRegister | ( | IN KEYBOARD_CONSOLE_IN_DEV * | ConsoleIn | ) |
Read data register .
ConsoleIn | Pointer to instance of KEYBOARD_CONSOLE_IN_DEV |
Definition at line 687 of file Ps2KbdCtrller.c.
UINT8 KeyReadStatusRegister | ( | IN KEYBOARD_CONSOLE_IN_DEV * | ConsoleIn | ) |
Read status register.
ConsoleIn | Pointer to instance of KEYBOARD_CONSOLE_IN_DEV |
Definition at line 720 of file Ps2KbdCtrller.c.
VOID KeyWriteCommandRegister | ( | IN KEYBOARD_CONSOLE_IN_DEV * | ConsoleIn, |
IN UINT8 | Data | ||
) |
Write command register .
ConsoleIn | Pointer to instance of KEYBOARD_CONSOLE_IN_DEV |
Data | The value wanted to be written |
Definition at line 735 of file Ps2KbdCtrller.c.
VOID KeyWriteDataRegister | ( | IN KEYBOARD_CONSOLE_IN_DEV * | ConsoleIn, |
IN UINT8 | Data | ||
) |
Write data register.
ConsoleIn | Pointer to instance of KEYBOARD_CONSOLE_IN_DEV |
Data | value wanted to be written |
Definition at line 703 of file Ps2KbdCtrller.c.
EFI_STATUS PopScancodeBufHead | ( | IN SCAN_CODE_QUEUE * | Queue, |
IN UINTN | Count, | ||
OUT UINT8 *Buf | OPTIONAL | ||
) |
Read & remove several bytes from the scancode buffer. This function is usually called after GetScancodeBufHead()
Queue | Pointer to instance of SCAN_CODE_QUEUE. |
Count | Number of bytes to be read |
Buf | Store the results |
EFI_SUCCESS | success to scan the keyboard code |
EFI_NOT_READY | invalid parameter |
Definition at line 631 of file Ps2KbdCtrller.c.
VOID PushScancodeBufTail | ( | IN SCAN_CODE_QUEUE * | Queue, |
IN UINT8 | Scancode | ||
) |
Push one byte to the scancode buffer.
Queue | Pointer to instance of SCAN_CODE_QUEUE. |
Scancode | The byte to push. |
Definition at line 665 of file Ps2KbdCtrller.c.
EFI_STATUS UpdateStatusLights | ( | IN KEYBOARD_CONSOLE_IN_DEV * | ConsoleIn | ) |
Show keyboard status lights according to indicators in ConsoleIn.
ConsoleIn | Pointer to instance of KEYBOARD_CONSOLE_IN_DEV |
Definition at line 1061 of file Ps2KbdCtrller.c.
UINT16 EfiScanCode |
Definition at line 13 of file Ps2KbdCtrller.c.
BOOLEAN mEnableMouseInterface |
Definition at line 558 of file Ps2KbdCtrller.c.
UINTN mWaitForValueTimeOut = KEYBOARD_WAITFORVALUE_TIMEOUT |
Definition at line 556 of file Ps2KbdCtrller.c.
UINT8 ScanCode |
follows value defined in Scan Code Set1
Definition at line 12 of file Ps2KbdCtrller.c.
CHAR16 ShiftUnicodeChar |
Definition at line 15 of file Ps2KbdCtrller.c.
CHAR16 UnicodeChar |
Definition at line 14 of file Ps2KbdCtrller.c.