26#ifndef _ULTIBO_PL050_H
27#define _ULTIBO_PL050_H
38#define PL050_KEYBOARD_DESCRIPTION "ARM PrimeCell PL050 PS2 Keyboard"
39#define PL050_MOUSE_DESCRIPTION "ARM PrimeCell PL050 PS2 Mouse"
41#define PL050_KEYBOARD_SCANCODE_COUNT 256
42#define PL050_MOUSE_PACKET_COUNT 256
44#define PL050_KEYBOARD_CLOCK_RATE 8000000
45#define PL050_MOUSE_CLOCK_RATE 8000000
47#define PL050_KEYBOARD_SHIFTSTATE_MASK KEYBOARD_LEFT_CTRL | KEYBOARD_LEFT_SHIFT | KEYBOARD_LEFT_ALT | KEYBOARD_RIGHT_CTRL | KEYBOARD_RIGHT_SHIFT | KEYBOARD_RIGHT_ALT
50#define PL050_CR_TYPE (1 << 5)
51#define PL050_CR_RXINTREN (1 << 4)
52#define PL050_CR_TXINTREN (1 << 3)
53#define PL050_CR_EN (1 << 2)
54#define PL050_CR_FDL (1 << 1)
55#define PL050_CR_FCL (1 << 0)
58#define PL050_STAT_TXEMPTY (1 << 6)
59#define PL050_STAT_TXBUSY (1 << 5)
60#define PL050_STAT_RXFULL (1 << 4)
61#define PL050_STAT_RXBUSY (1 << 3)
62#define PL050_STAT_RXPARITY (1 << 2)
63#define PL050_STAT_IC (1 << 1)
64#define PL050_STAT_ID (1 << 0)
67#define PL050_IIR_TXINTR (1 << 1)
68#define PL050_IIR_RXINTR (1 << 0)
#define STDCALL
Definition globaltypes.h:45
struct _KEYBOARD_DEVICE KEYBOARD_DEVICE
Definition keyboard.h:203
struct _MOUSE_DEVICE MOUSE_DEVICE
Definition mouse.h:193
struct _PL050_MOUSE PL050_MOUSE
Definition pl050.h:114
struct _PL050_KMI_REGISTERS PL050_KMI_REGISTERS
Definition pl050.h:72
MOUSE_DEVICE *STDCALL pl050_mouse_create(size_t address, char *name, uint32_t irq, uint32_t clockrate)
Create, register and attach a new PL050 Mouse device which can be accessed using the mouse API.
#define PL050_KEYBOARD_SCANCODE_COUNT
Number of keyboard scancode buffers for receive.
Definition pl050.h:41
uint32_t STDCALL pl050_keyboard_destroy(KEYBOARD_DEVICE *keyboard)
Detach, deregister and destroy a PL050 Keyboard device created by this driver.
struct _PL050_KEYBOARD_SCANCODE PL050_KEYBOARD_SCANCODE
Definition pl050.h:85
uint32_t STDCALL pl050_mouse_destroy(MOUSE_DEVICE *mouse)
Detach, deregister and destroy a PL050 Mouse device created by this driver.
#define PL050_MOUSE_PACKET_COUNT
Number of mouse packet buffers for receive.
Definition pl050.h:42
KEYBOARD_DEVICE *STDCALL pl050_keyboard_create(size_t address, char *name, uint32_t irq, uint32_t clockrate)
Create, register and attach a new PL050 Keyboard device which can be accessed using the keyboard API.
struct _PL050_KEYBOARD PL050_KEYBOARD
Definition pl050.h:83
struct _PL050_MOUSE_PACKET PL050_MOUSE_PACKET
Definition pl050.h:116
struct _PS2_KEYBOARD_SCANCODE PS2_KEYBOARD_SCANCODE
Definition ps2.h:169
PL050_KEYBOARD * keyboard
Definition pl050.h:88
uint32_t count
Definition pl050.h:89
PS2_KEYBOARD_SCANCODE scancode
Definition pl050.h:91
int32_t index
Definition pl050.h:90
uint32_t discardcount
Number of received bytes discarded (due to no buffer or other reasons).
Definition pl050.h:109
uint32_t irq
Definition pl050.h:100
PL050_KEYBOARD_SCANCODE scancodedata[PL050_KEYBOARD_SCANCODE_COUNT]
Buffers for scancode receiving.
Definition pl050.h:103
PL050_KMI_REGISTERS * registers
Device registers.
Definition pl050.h:101
uint32_t scancodestart
The scancode buffer to use for the next receive.
Definition pl050.h:104
uint8_t scancodeset
The currently selected scancode set.
Definition pl050.h:102
uint16_t lastcode
The scan code of the last key pressed.
Definition pl050.h:106
uint32_t interruptcount
Number of interrupt requests received by the device.
Definition pl050.h:110
uint32_t scancodecount
The number of scancode buffers that are in use.
Definition pl050.h:105
uint32_t shiftstate
The modifier flags of the current shift state.
Definition pl050.h:107
KEYBOARD_DEVICE keyboard
Definition pl050.h:98
uint32_t iir
Interrupt status register.
Definition pl050.h:79
uint32_t data
Received data (read)/ Data to be transmitted (write).
Definition pl050.h:77
uint32_t clkdiv
Clock divisor register.
Definition pl050.h:78
uint32_t stat
Status register.
Definition pl050.h:76
uint32_t cr
Control register.
Definition pl050.h:75
PL050_MOUSE * mouse
Definition pl050.h:119
PL050_MOUSE_PACKET packet
Definition pl050.h:121
uint32_t count
Definition pl050.h:120
PL050_MOUSE_PACKET packetdata[PL050_MOUSE_PACKET_COUNT]
Buffers for mouse packet receiving.
Definition pl050.h:132
uint32_t discardcount
Number of received bytes discarded (due to no buffer or other reasons).
Definition pl050.h:136
uint32_t irq
Definition pl050.h:130
PL050_KMI_REGISTERS * registers
Device registers.
Definition pl050.h:131
uint32_t interruptcount
Number of interrupt requests received by the device.
Definition pl050.h:137
MOUSE_DEVICE mouse
Definition pl050.h:128
uint32_t packetstart
The mouse packet buffer to use for the next receive.
Definition pl050.h:133
uint32_t packetcount
The number of mouse packet buffers that are in use.
Definition pl050.h:134