![]() |
Ultibo API
C/C++ API for Ultibo Core
|
Go to the source code of this file.
Data Structures | |
| struct | _PL050_KMI_REGISTERS |
| struct | _PL050_KEYBOARD_SCANCODE |
| struct | _PL050_KEYBOARD |
| struct | _PL050_MOUSE_PACKET |
| struct | _PL050_MOUSE |
Macros | |
| #define | PL050_KEYBOARD_DESCRIPTION "ARM PrimeCell PL050 PS2 Keyboard" |
| Description of PL050 Keyboard device. | |
| #define | PL050_MOUSE_DESCRIPTION "ARM PrimeCell PL050 PS2 Mouse" |
| Description of PL050 Mouse device. | |
| #define | PL050_KEYBOARD_SCANCODE_COUNT 256 |
| Number of keyboard scancode buffers for receive. | |
| #define | PL050_MOUSE_PACKET_COUNT 256 |
| Number of mouse packet buffers for receive. | |
| #define | PL050_KEYBOARD_CLOCK_RATE 8000000 |
| Default clock rate. | |
| #define | PL050_MOUSE_CLOCK_RATE 8000000 |
| Default clock rate. | |
| #define | PL050_KEYBOARD_SHIFTSTATE_MASK KEYBOARD_LEFT_CTRL | KEYBOARD_LEFT_SHIFT | KEYBOARD_LEFT_ALT | KEYBOARD_RIGHT_CTRL | KEYBOARD_RIGHT_SHIFT | KEYBOARD_RIGHT_ALT |
| #define | PL050_CR_TYPE (1 << 5) |
| 0 = PS2/AT mode / 1 = No line control bit mode | |
| #define | PL050_CR_RXINTREN (1 << 4) |
| Enable receiver interrupt. This bit field is used to enable the PrimeCell KMI receiver interrupt (If KMIRXINTREn = 1, the receiver interrupt is enabled). | |
| #define | PL050_CR_TXINTREN (1 << 3) |
| Enable transmitter interrupt. This bit field is used to enable the PrimeCell KMI transmitter interrupt (If KMITXINTREn = 1, the transfer interrupt is enabled). | |
| #define | PL050_CR_EN (1 << 2) |
| The enable PrimeCell KMI bit field is used to enable the KMI (If KmiEn = 1, the KMI is enabled). | |
| #define | PL050_CR_FDL (1 << 1) |
| The force KMI data LOW bit field is used to force the PrimeCell KMI data pad LOW regardless of the state of the KMI finite state machine (FSM) (If FKMID = 1, the PrimeCell KMI data pad is forced LOW). | |
| #define | PL050_CR_FCL (1 << 0) |
| The force KMI clock LOW bit field is used to force the PrimeCell KMI clock pad LOW regardless of the state of the KMI FSM (If FKMIC = 1, the PrimeCell KMI clock pad is forced LOW). | |
| #define | PL050_STAT_TXEMPTY (1 << 6) |
| This bit indicates that the transmit register is empty and ready to transmit (0 = Transmit register full / 1 = Transmit register empty, ready to be written). | |
| #define | PL050_STAT_TXBUSY (1 << 5) |
| This bit indicates that the PrimeCell KMI is currently sending data (0 = Idle / 1 = Currently sending data). | |
| #define | PL050_STAT_RXFULL (1 << 4) |
| This bit indicates that the receiver register is full and ready to be read (0 = Receive register empty / 1 = Receive register full, ready to be read). | |
| #define | PL050_STAT_RXBUSY (1 << 3) |
| This bit indicates that the PrimeCell KMI is currently receiving data (0 = Idle / 1 = Currently receiving data). | |
| #define | PL050_STAT_RXPARITY (1 << 2) |
| This bit reflects the parity bit for the last received data byte (odd parity). | |
| #define | PL050_STAT_IC (1 << 1) |
| This bit reflects the status of the KMICLKIN line after synchronizing and sampling. | |
| #define | PL050_STAT_ID (1 << 0) |
| This bit reflects the status of the KMIDATAIN line after synchronizing. | |
| #define | PL050_IIR_TXINTR (1 << 1) |
| This bit is set to 1 if the KMITXINTR transmit interrupt is asserted. | |
| #define | PL050_IIR_RXINTR (1 << 0) |
| This bit is set to 1 if the KMIRXINTR receive interrupt is asserted. | |
Typedefs | |
| typedef struct _PL050_KMI_REGISTERS | PL050_KMI_REGISTERS |
| typedef struct _PL050_KEYBOARD | PL050_KEYBOARD |
| typedef struct _PL050_KEYBOARD_SCANCODE | PL050_KEYBOARD_SCANCODE |
| typedef struct _PL050_MOUSE | PL050_MOUSE |
| typedef struct _PL050_MOUSE_PACKET | PL050_MOUSE_PACKET |
Functions | |
| 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. | |
| uint32_t STDCALL | pl050_keyboard_destroy (KEYBOARD_DEVICE *keyboard) |
| Detach, deregister and destroy a PL050 Keyboard device created by this driver. | |
| 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. | |
| uint32_t STDCALL | pl050_mouse_destroy (MOUSE_DEVICE *mouse) |
| Detach, deregister and destroy a PL050 Mouse device created by this driver. | |
| #define PL050_KEYBOARD_DESCRIPTION "ARM PrimeCell PL050 PS2 Keyboard" |
Description of PL050 Keyboard device.
PL050 specific constants
| #define PL050_MOUSE_DESCRIPTION "ARM PrimeCell PL050 PS2 Mouse" |
Description of PL050 Mouse device.
| #define PL050_KEYBOARD_SCANCODE_COUNT 256 |
Number of keyboard scancode buffers for receive.
| #define PL050_MOUSE_PACKET_COUNT 256 |
Number of mouse packet buffers for receive.
| #define PL050_KEYBOARD_CLOCK_RATE 8000000 |
Default clock rate.
| #define PL050_MOUSE_CLOCK_RATE 8000000 |
Default clock rate.
| #define PL050_KEYBOARD_SHIFTSTATE_MASK KEYBOARD_LEFT_CTRL | KEYBOARD_LEFT_SHIFT | KEYBOARD_LEFT_ALT | KEYBOARD_RIGHT_CTRL | KEYBOARD_RIGHT_SHIFT | KEYBOARD_RIGHT_ALT |
| #define PL050_CR_TYPE (1 << 5) |
0 = PS2/AT mode / 1 = No line control bit mode
PL050 Control register bits
| #define PL050_CR_RXINTREN (1 << 4) |
Enable receiver interrupt. This bit field is used to enable the PrimeCell KMI receiver interrupt (If KMIRXINTREn = 1, the receiver interrupt is enabled).
| #define PL050_CR_TXINTREN (1 << 3) |
Enable transmitter interrupt. This bit field is used to enable the PrimeCell KMI transmitter interrupt (If KMITXINTREn = 1, the transfer interrupt is enabled).
| #define PL050_CR_EN (1 << 2) |
The enable PrimeCell KMI bit field is used to enable the KMI (If KmiEn = 1, the KMI is enabled).
| #define PL050_CR_FDL (1 << 1) |
The force KMI data LOW bit field is used to force the PrimeCell KMI data pad LOW regardless of the state of the KMI finite state machine (FSM) (If FKMID = 1, the PrimeCell KMI data pad is forced LOW).
| #define PL050_CR_FCL (1 << 0) |
The force KMI clock LOW bit field is used to force the PrimeCell KMI clock pad LOW regardless of the state of the KMI FSM (If FKMIC = 1, the PrimeCell KMI clock pad is forced LOW).
| #define PL050_STAT_TXEMPTY (1 << 6) |
This bit indicates that the transmit register is empty and ready to transmit (0 = Transmit register full / 1 = Transmit register empty, ready to be written).
PL050 Status register bits
| #define PL050_STAT_TXBUSY (1 << 5) |
This bit indicates that the PrimeCell KMI is currently sending data (0 = Idle / 1 = Currently sending data).
| #define PL050_STAT_RXFULL (1 << 4) |
This bit indicates that the receiver register is full and ready to be read (0 = Receive register empty / 1 = Receive register full, ready to be read).
| #define PL050_STAT_RXBUSY (1 << 3) |
This bit indicates that the PrimeCell KMI is currently receiving data (0 = Idle / 1 = Currently receiving data).
| #define PL050_STAT_RXPARITY (1 << 2) |
This bit reflects the parity bit for the last received data byte (odd parity).
| #define PL050_STAT_IC (1 << 1) |
This bit reflects the status of the KMICLKIN line after synchronizing and sampling.
| #define PL050_STAT_ID (1 << 0) |
This bit reflects the status of the KMIDATAIN line after synchronizing.
| #define PL050_IIR_TXINTR (1 << 1) |
This bit is set to 1 if the KMITXINTR transmit interrupt is asserted.
PL050 Interrupt register bits
| #define PL050_IIR_RXINTR (1 << 0) |
This bit is set to 1 if the KMIRXINTR receive interrupt is asserted.
| typedef struct _PL050_KMI_REGISTERS PL050_KMI_REGISTERS |
PL050 specific types Layout of the PL050 registers (See: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0143c/i1005653.html)
| typedef struct _PL050_KEYBOARD PL050_KEYBOARD |
| typedef struct _PL050_KEYBOARD_SCANCODE PL050_KEYBOARD_SCANCODE |
| typedef struct _PL050_MOUSE PL050_MOUSE |
| typedef struct _PL050_MOUSE_PACKET PL050_MOUSE_PACKET |
| 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.
PL050 Functions
| Address | The address of the PL050 registers |
| Name | The text description of this device which will show in the device list (Optional) |
| IRQ | The interrupt number for the PL050 |
| ClockRate | The clock source frequency for the PL050 |
| uint32_t STDCALL pl050_keyboard_destroy | ( | KEYBOARD_DEVICE * | keyboard | ) |
Detach, deregister and destroy a PL050 Keyboard device created by this driver.
| Keyboard | The Keyboard device to destroy |
| 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.
| Address | The address of the PL050 registers |
| Name | The text description of this device which will show in the device list (Optional) |
| IRQ | The interrupt number for the PL050 |
| ClockRate | The clock source frequency for the PL050 |
| uint32_t STDCALL pl050_mouse_destroy | ( | MOUSE_DEVICE * | mouse | ) |
Detach, deregister and destroy a PL050 Mouse device created by this driver.
| Mouse | The Mouse device to destroy |