Zephyr API Documentation
3.7.0
A Scalable Open Source RTOS
|
eSPI Emulation Interface More...
Data Structures | |
struct | emul_espi_device_api |
Definition of the eSPI device emulator API. More... | |
struct | espi_emul |
Node in a linked list of emulators for eSPI devices. More... | |
struct | emul_espi_driver_api |
Definition of the eSPI controller emulator API. More... | |
Macros | |
#define | EMUL_ESPI_HOST_CHIPSEL 0 |
Typedefs | |
typedef int(* | emul_espi_api_set_vw) (const struct emul *target, enum espi_vwire_signal vw, uint8_t level) |
Passes eSPI virtual wires set request (virtual wire packet) to the emulator. | |
typedef int(* | emul_espi_api_get_vw) (const struct emul *target, enum espi_vwire_signal vw, uint8_t *level) |
Passes eSPI virtual wires get request (virtual wire packet) to the emulator. | |
typedef struct espi_emul *(* | emul_find_emul) (const struct device *dev, unsigned int chipsel) |
Find an emulator present on a eSPI bus. | |
typedef int(* | emul_trigger_event) (const struct device *dev, struct espi_event *evt) |
Triggers an event on the emulator of eSPI controller side which causes calling specific callbacks. | |
Functions | |
int | espi_emul_register (const struct device *dev, struct espi_emul *emul) |
Register an emulated device on the controller. | |
int | emul_espi_host_send_vw (const struct device *espi_dev, enum espi_vwire_signal vw, uint8_t level) |
Sets the eSPI virtual wire on the host side, which will trigger a proper event(and callbacks) on the emulated eSPI controller. | |
int | emul_espi_host_port80_write (const struct device *espi_dev, uint32_t data) |
Perform port80 write on the emulated host side, which will trigger a proper event(and callbacks) on the emulated eSPI controller. | |
eSPI Emulation Interface
#define EMUL_ESPI_HOST_CHIPSEL 0 |
#include <zephyr/drivers/espi_emul.h>
typedef int(* emul_espi_api_get_vw) (const struct emul *target, enum espi_vwire_signal vw, uint8_t *level) |
#include <zephyr/drivers/espi_emul.h>
Passes eSPI virtual wires get request (virtual wire packet) to the emulator.
The emulator returns the state (level) of its virtual wire.
target | The device Emulator instance |
vw | The signal to be get. |
level | The level of the signal to be get. |
0 | If successful. |
-EIO | General input / output error. |
typedef int(* emul_espi_api_set_vw) (const struct emul *target, enum espi_vwire_signal vw, uint8_t level) |
#include <zephyr/drivers/espi_emul.h>
Passes eSPI virtual wires set request (virtual wire packet) to the emulator.
The emulator updates the state (level) of its virtual wire.
target | The device Emulator instance |
vw | The signal to be set. |
level | The level of signal requested LOW(0) or HIGH(1). |
0 | If successful. |
-EIO | General input / output error. |
#include <zephyr/drivers/espi_emul.h>
Find an emulator present on a eSPI bus.
At present the function is used only to find an emulator of the host device. It may be useful in systems with the SPI flash chips.
dev | eSPI emulation controller device |
chipsel | Chip-select value |
typedef int(* emul_trigger_event) (const struct device *dev, struct espi_event *evt) |
#include <zephyr/drivers/espi_emul.h>
Triggers an event on the emulator of eSPI controller side which causes calling specific callbacks.
dev | Device instance of emulated eSPI controller |
evt | Event to be triggered |
0 | If successful. |
-EIO | General input / output error. |
#include <zephyr/drivers/espi_emul.h>
Perform port80 write on the emulated host side, which will trigger a proper event(and callbacks) on the emulated eSPI controller.
espi_dev | eSPI emulation controller device |
data | The date to be written. |
0 | If successful. |
-EIO | General input / output error. |
int emul_espi_host_send_vw | ( | const struct device * | espi_dev, |
enum espi_vwire_signal | vw, | ||
uint8_t | level | ||
) |
#include <zephyr/drivers/espi_emul.h>
Sets the eSPI virtual wire on the host side, which will trigger a proper event(and callbacks) on the emulated eSPI controller.
espi_dev | eSPI emulation controller device |
vw | The signal to be set. |
level | The level of the signal to be set. |
0 | If successful. |
-EIO | General input / output error. |
#include <zephyr/drivers/espi_emul.h>
Register an emulated device on the controller.
dev | Device that will use the emulator |
emul | eSPI emulator to use |