Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Interfaces for PS/2 devices. More...

Files

file  ps2.h
 Main header file for PS/2 (Personal System/2) driver API.

Data Structures

struct  ps2_driver_api
 @driver_ops{PS/2} 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 PS/2 device instance.
int ps2_write (const struct device *dev, uint8_t value)
 Write to a 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.
typedef int(* ps2_config_t) (const struct device *dev, ps2_callback_t callback_isr)
 @def_driverbackendgroup{PS/2,ps2_interface}
typedef int(* ps2_read_t) (const struct device *dev, uint8_t *value)
 Callback API for reading from a PS/2 device.
typedef int(* ps2_write_t) (const struct device *dev, uint8_t value)
 Callback API for writing to a PS/2 device.
typedef int(* ps2_disable_callback_t) (const struct device *dev)
 Callback API for disabling a PS/2 device callback.
typedef int(* ps2_enable_callback_t) (const struct device *dev)
 Callback API for enabling a PS/2 device callback.

Detailed Description

Interfaces for PS/2 devices.

Callers of this API are responsible for setting the typematic rate and decode keys using their desired scan code tables.

Typedef Documentation

◆ ps2_callback_t

typedef void(* ps2_callback_t) (const struct device *dev, uint8_t data)

#include <ps2.h>

PS/2 callback called when user types or click a mouse.

Parameters
devPointer to the device structure for the driver instance.
dataData byte passed pack to the user.

◆ ps2_config_t

typedef int(* ps2_config_t) (const struct device *dev, ps2_callback_t callback_isr)

#include <ps2.h>

@def_driverbackendgroup{PS/2,ps2_interface}

Callback API for configuring a PS/2 device

See also
ps2_config() for argument descriptions.

◆ ps2_disable_callback_t

typedef int(* ps2_disable_callback_t) (const struct device *dev)

#include <ps2.h>

Callback API for disabling a PS/2 device callback.

◆ ps2_enable_callback_t

typedef int(* ps2_enable_callback_t) (const struct device *dev)

#include <ps2.h>

Callback API for enabling a PS/2 device callback.

See also
ps2_enable_callback() for argument descriptions.

◆ ps2_read_t

typedef int(* ps2_read_t) (const struct device *dev, uint8_t *value)

#include <ps2.h>

Callback API for reading from a PS/2 device.

See also
ps2_read() for argument descriptions.

◆ ps2_write_t

typedef int(* ps2_write_t) (const struct device *dev, uint8_t value)

#include <ps2.h>

Callback API for writing to a PS/2 device.

See also
ps2_write() for argument descriptions.

Function Documentation

◆ ps2_config()

int ps2_config ( const struct device * dev,
ps2_callback_t callback_isr )

#include <ps2.h>

Configure a PS/2 device instance.

Parameters
devPointer to the device structure for the driver instance.
callback_isrcalled when PS/2 devices reply to a configuration command or when a mouse/keyboard send data to the client application.
Returns
0 on success, negative errno value on failure.

◆ ps2_disable_callback()

int ps2_disable_callback ( const struct device * dev)

#include <ps2.h>

Disables callback.

Parameters
devPointer to the device structure for the driver instance.
Returns
0 on success, negative errno value on failure.

◆ ps2_enable_callback()

int ps2_enable_callback ( const struct device * dev)

#include <ps2.h>

Enables callback.

Parameters
devPointer to the device structure for the driver instance.
Returns
0 on success, negative errno value on failure.

◆ ps2_read()

int ps2_read ( const struct device * dev,
uint8_t * value )

#include <ps2.h>

Read slave-to-host values from PS/2 device.

Parameters
devPointer to the device structure for the driver instance.
valuePointer used for reading the PS/2 device.
Returns
0 on success, negative errno value on failure.

◆ ps2_write()

int ps2_write ( const struct device * dev,
uint8_t value )

#include <ps2.h>

Write to a PS/2 device.

Parameters
devPointer to the device structure for the driver instance.
valueData for the PS2 device.
Returns
0 on success, negative errno value on failure.