14#ifndef ZEPHYR_INCLUDE_DRIVERS_PS2_H_
15#define ZEPHYR_INCLUDE_DRIVERS_PS2_H_
47typedef int (*ps2_config_t)(
const struct device *dev,
49typedef int (*ps2_read_t)(
const struct device *dev,
uint8_t *value);
50typedef int (*ps2_write_t)(
const struct device *dev,
uint8_t value);
51typedef int (*ps2_disable_callback_t)(
const struct device *dev);
52typedef int (*ps2_enable_callback_t)(
const struct device *dev);
54__subsystem
struct ps2_driver_api {
58 ps2_disable_callback_t disable_callback;
59 ps2_enable_callback_t enable_callback;
78static inline int z_impl_ps2_config(
const struct device *dev,
81 const struct ps2_driver_api *api =
82 (
struct ps2_driver_api *)dev->
api;
84 return api->config(dev, callback_isr);
98static inline int z_impl_ps2_write(
const struct device *dev,
uint8_t value)
100 const struct ps2_driver_api *api =
101 (
const struct ps2_driver_api *)dev->
api;
103 return api->write(dev, value);
116static inline int z_impl_ps2_read(
const struct device *dev,
uint8_t *value)
118 const struct ps2_driver_api *api =
119 (
const struct ps2_driver_api *)dev->
api;
121 return api->read(dev, value);
133static inline int z_impl_ps2_enable_callback(
const struct device *dev)
135 const struct ps2_driver_api *api =
136 (
const struct ps2_driver_api *)dev->
api;
138 if (api->enable_callback == NULL) {
142 return api->enable_callback(dev);
154static inline int z_impl_ps2_disable_callback(
const struct device *dev)
156 const struct ps2_driver_api *api =
157 (
const struct ps2_driver_api *)dev->
api;
159 if (api->disable_callback == NULL) {
163 return api->disable_callback(dev);
174#include <syscalls/ps2.h>
void
Definition: eswifi_shell.c:15
int ps2_config(const struct device *dev, ps2_callback_t callback_isr)
Configure a ps2 instance.
int ps2_enable_callback(const struct device *dev)
Enables callback.
int ps2_read(const struct device *dev, uint8_t *value)
Read slave-to-host values from PS/2 device.
void(* ps2_callback_t)(const struct device *dev, uint8_t data)
PS/2 callback called when user types or click a mouse.
Definition: ps2.h:38
int ps2_disable_callback(const struct device *dev)
Disables callback.
int ps2_write(const struct device *dev, uint8_t value)
Write to PS/2 device.
#define ENOSYS
Definition: errno.h:83
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
Runtime device structure (in ROM) per driver instance.
Definition: device.h:367
const void * api
Definition: device.h:373
static fdata_t data[2]
Definition: test_fifo_contexts.c:15