TianoCore EDK2 master
|
#include "Ps2Mouse.h"
Go to the source code of this file.
Macros | |
#define | PS2_PACKET_LENGTH 3 |
#define | PS2_SYNC_MASK 0xc |
#define | PS2_SYNC_BYTE 0x8 |
#define | IS_PS2_SYNC_BYTE(byte) ((byte & PS2_SYNC_MASK) == PS2_SYNC_BYTE) |
#define | PS2_READ_BYTE_ONE 0 |
#define | PS2_READ_DATA_BYTE 1 |
#define | PS2_PROCESS_PACKET 2 |
#define | TIMEOUT 50000 |
#define | BAT_TIMEOUT 500000 |
#define | KBC_DATA_PORT 0x60 |
#define | KBC_CMD_STS_PORT 0x64 |
#define | READ_CMD_BYTE 0x20 |
#define | WRITE_CMD_BYTE 0x60 |
#define | DISABLE_AUX 0xa7 |
#define | ENABLE_AUX 0xa8 |
#define | SELF_TEST 0xaa |
#define | DISABLE_KB 0xad |
#define | ENABLE_KB 0xae |
#define | WRITE_AUX_DEV 0xd4 |
#define | CMD_SYS_FLAG 0x04 |
#define | CMD_KB_STS 0x10 |
#define | CMD_KB_DIS 0x10 |
#define | CMD_KB_EN 0x0 |
#define | SETSF1_CMD 0xe6 |
#define | SETSF2_CMD 0xe7 |
#define | SETRE_CMD 0xe8 |
#define | READ_CMD 0xeb |
#define | SETRM_CMD 0xf0 |
#define | SETSR_CMD 0xf3 |
#define | ENABLE_CMD 0xf4 |
#define | DISABLE_CMD 0xf5 |
#define | RESET_CMD 0xff |
#define | PS2_ACK 0xfa |
#define | PS2_RESEND 0xfe |
#define | PS2MOUSE_BAT1 0xaa |
#define | PS2MOUSE_BAT2 0x0 |
#define | KBC_PARE 0x80 |
#define | KBC_TIM 0x40 |
#define | KBC_AUXB 0x20 |
#define | KBC_KEYL 0x10 |
#define | KBC_CD 0x08 |
#define | KBC_SYSF 0x04 |
#define | KBC_INPB 0x02 |
#define | KBC_OUTB 0x01 |
Functions | |
EFI_STATUS | KbcSelfTest (VOID) |
EFI_STATUS | KbcEnableAux (VOID) |
EFI_STATUS | KbcDisableAux (VOID) |
EFI_STATUS | KbcEnableKb (VOID) |
EFI_STATUS | KbcDisableKb (VOID) |
EFI_STATUS | CheckKbStatus (OUT BOOLEAN *KeyboardEnable) |
EFI_STATUS | PS2MouseReset (VOID) |
EFI_STATUS | PS2MouseSetSampleRate (IN MOUSE_SR SampleRate) |
EFI_STATUS | PS2MouseSetResolution (IN MOUSE_RE Resolution) |
EFI_STATUS | PS2MouseSetScaling (IN MOUSE_SF Scaling) |
EFI_STATUS | PS2MouseEnable (VOID) |
EFI_STATUS | PS2MouseGetPacket (PS2_MOUSE_DEV *MouseDev) |
EFI_STATUS | PS2MouseRead (OUT UINT8 *Buffer, IN OUT UINTN *BufSize, IN UINTN State) |
EFI_STATUS | Out8042Command (IN UINT8 Command) |
EFI_STATUS | In8042Data (IN OUT UINT8 *Data) |
EFI_STATUS | Out8042Data (IN UINT8 Data) |
EFI_STATUS | Out8042AuxCommand (IN UINT8 Command, IN BOOLEAN Resend) |
EFI_STATUS | In8042AuxData (IN OUT UINT8 *Data) |
EFI_STATUS | Out8042AuxData (IN UINT8 Data) |
EFI_STATUS | CheckForInput (VOID) |
EFI_STATUS | WaitInputEmpty (IN UINTN Timeout) |
EFI_STATUS | WaitOutputFull (IN UINTN Timeout) |
PS2 Mouse Communication Interface
Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file CommPs2.h.
#define IS_PS2_SYNC_BYTE | ( | byte | ) | ((byte & PS2_SYNC_MASK) == PS2_SYNC_BYTE) |
#define KBC_AUXB 0x20 |
#define KBC_CD 0x08 |
#define KBC_INPB 0x02 |
#define KBC_KEYL 0x10 |
#define KBC_OUTB 0x01 |
#define KBC_SYSF 0x04 |
EFI_STATUS CheckForInput | ( | VOID | ) |
EFI_STATUS CheckKbStatus | ( | OUT BOOLEAN * | KeyboardEnable | ) |
EFI_STATUS In8042AuxData | ( | IN OUT UINT8 * | Data | ) |
EFI_STATUS In8042Data | ( | IN OUT UINT8 * | Data | ) |
EFI_STATUS KbcDisableAux | ( | VOID | ) |
EFI_STATUS KbcDisableKb | ( | VOID | ) |
EFI_STATUS KbcEnableAux | ( | VOID | ) |
EFI_STATUS KbcEnableKb | ( | VOID | ) |
EFI_STATUS KbcSelfTest | ( | VOID | ) |
EFI_STATUS Out8042AuxCommand | ( | IN UINT8 | Command, |
IN BOOLEAN | Resend | ||
) |
EFI_STATUS Out8042AuxData | ( | IN UINT8 | Data | ) |
I/O work flow of outing 8042 Aux data.
Data | Buffer holding return value |
EFI_SUCCESS | Success to execute I/O work flow |
EFI_TIMEOUT | Keyboard controller time out. |
I/O work flow of outing 8042 Aux data.
Data | Buffer holding return value |
EFI_SUCCESS | Success to execute I/O work flow. |
EFI_TIMEOUT | Keyboard controller time out. |
EFI_STATUS Out8042Command | ( | IN UINT8 | Command | ) |
EFI_STATUS Out8042Data | ( | IN UINT8 | Data | ) |
EFI_STATUS PS2MouseEnable | ( | VOID | ) |
EFI_STATUS PS2MouseGetPacket | ( | PS2_MOUSE_DEV * | MouseDev | ) |
Get mouse packet . Only care first 3 bytes
MouseDev | Pointer of PS2 Mouse Private Data Structure |
EFI_NOT_READY | Mouse Device not ready to input data packet, or some error happened during getting the packet |
EFI_SUCCESS | The data packet is gotten successfully. |
EFI_STATUS PS2MouseReset | ( | VOID | ) |
EFI_STATUS PS2MouseSetResolution | ( | IN MOUSE_RE | Resolution | ) |
EFI_STATUS PS2MouseSetSampleRate | ( | IN MOUSE_SR | SampleRate | ) |
EFI_STATUS PS2MouseSetScaling | ( | IN MOUSE_SF | Scaling | ) |
EFI_STATUS WaitInputEmpty | ( | IN UINTN | Timeout | ) |
EFI_STATUS WaitOutputFull | ( | IN UINTN | Timeout | ) |