Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
PS/2 Driver APIs

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.
 

Detailed Description

PS/2 Driver APIs .

Typedef Documentation

◆ ps2_callback_t

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

#include <zephyr/drivers/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.

Function Documentation

◆ ps2_config()

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

#include <zephyr/drivers/ps2.h>

Configure a ps2 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.
Return values
0If successful.
Negativeerrno code if failure.

◆ ps2_disable_callback()

int ps2_disable_callback ( const struct device * dev)

#include <zephyr/drivers/ps2.h>

Disables callback.

Parameters
devPointer to the device structure for the driver instance.
Return values
0If successful.
Negativeerrno code if failure.

◆ ps2_enable_callback()

int ps2_enable_callback ( const struct device * dev)

#include <zephyr/drivers/ps2.h>

Enables callback.

Parameters
devPointer to the device structure for the driver instance.
Return values
0If successful.
Negativeerrno code if failure.

◆ ps2_read()

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

#include <zephyr/drivers/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.
Return values
0If successful.
Negativeerrno code if failure.

◆ ps2_write()

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

#include <zephyr/drivers/ps2.h>

Write to PS/2 device.

Parameters
devPointer to the device structure for the driver instance.
valueData for the PS2 device.
Return values
0If successful.
Negativeerrno code if failure.