PS/2¶
Overview¶
The PS/2 connector first hit the market in 1987 on IBM’s desktop PC line of the same name before becoming an industry-wide standard for mouse and keyboard connections. Starting around 2007, USB superseded PS/2 and is the modern peripheral device connection standard. For legacy support on boards with a PS/2 connector, Zephyr provides these PS/2 driver APIs.
API Reference¶
-
group
ps2_interface
PS/2 Driver APIs.
Typedefs
Functions
-
int
ps2_config
(const struct device *dev, ps2_callback_t callback_isr)¶ Configure a ps2 instance.
- Parameters
dev
: Pointer to the device structure for the driver instance.callback_isr
: called when PS/2 devices reply to a configuration command or when a mouse/keyboard send data to the client application.
- Return Value
0
: If successful.Negative
: errno code if failure.
-
int
ps2_write
(const struct device *dev, uint8_t value)¶ Write to PS/2 device.
- Parameters
dev
: Pointer to the device structure for the driver instance.value
: Data for the PS2 device.
- Return Value
0
: If successful.Negative
: errno code if failure.
-
int
ps2_read
(const struct device *dev, uint8_t *value)¶ Read slave-to-host values from PS/2 device.
- Parameters
dev
: Pointer to the device structure for the driver instance.value
: Pointer used for reading the PS/2 device.
- Return Value
0
: If successful.Negative
: errno code if failure.
-
int