Zephyr API Documentation 4.1.0-rc2
A Scalable Open Source RTOS
|
|
4.1.0-rc2 |
PS/2 Driver APIs . More...
Typedefs | |
typedef void(* | ps2_callback_t) (const struct device *dev, uint8_t data) |
PS/2 callback called when user types or click a mouse. | |
Functions | |
int | ps2_config (const struct device *dev, ps2_callback_t callback_isr) |
Configure a ps2 instance. | |
int | ps2_write (const struct device *dev, uint8_t value) |
Write to PS/2 device. | |
int | ps2_read (const struct device *dev, uint8_t *value) |
Read slave-to-host values from PS/2 device. | |
int | ps2_enable_callback (const struct device *dev) |
Enables callback. | |
int | ps2_disable_callback (const struct device *dev) |
Disables callback. | |
PS/2 Driver APIs .
#include <zephyr/drivers/ps2.h>
PS/2 callback called when user types or click a mouse.
dev | Pointer to the device structure for the driver instance. |
data | Data byte passed pack to the user. |
int ps2_config | ( | const struct device * | dev, |
ps2_callback_t | callback_isr ) |
#include <zephyr/drivers/ps2.h>
Configure a ps2 instance.
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. |
0 | If successful. |
Negative | errno code if failure. |
int ps2_disable_callback | ( | const struct device * | dev | ) |
#include <zephyr/drivers/ps2.h>
Disables callback.
dev | Pointer to the device structure for the driver instance. |
0 | If successful. |
Negative | errno code if failure. |
int ps2_enable_callback | ( | const struct device * | dev | ) |
#include <zephyr/drivers/ps2.h>
Enables callback.
dev | Pointer to the device structure for the driver instance. |
0 | If successful. |
Negative | errno code if failure. |
#include <zephyr/drivers/ps2.h>
Read slave-to-host values from PS/2 device.
dev | Pointer to the device structure for the driver instance. |
value | Pointer used for reading the PS/2 device. |
0 | If successful. |
Negative | errno code if failure. |
#include <zephyr/drivers/ps2.h>
Write to PS/2 device.
dev | Pointer to the device structure for the driver instance. |
value | Data for the PS2 device. |
0 | If successful. |
Negative | errno code if failure. |