eSPI Emulation Interface  
More...
eSPI Emulation Interface 
◆ EMUL_ESPI_HOST_CHIPSEL
      
        
          | #define EMUL_ESPI_HOST_CHIPSEL   0 | 
        
      
 
 
◆ emul_espi_api_get_vw
#include <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.
- Parameters
 - 
  
    | target | The device Emulator instance  | 
    | vw | The signal to be get.  | 
    | level | The level of the signal to be get. | 
  
   
- Return values
 - 
  
    | 0 | If successful.  | 
    | -EIO | General input / output error.  | 
  
   
 
 
◆ emul_espi_api_set_vw
#include <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.
- Parameters
 - 
  
    | target | The device Emulator instance  | 
    | vw | The signal to be set.  | 
    | level | The level of signal requested LOW(0) or HIGH(1). | 
  
   
- Return values
 - 
  
    | 0 | If successful.  | 
    | -EIO | General input / output error.  | 
  
   
 
 
◆ emul_find_emul
#include <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.
- Parameters
 - 
  
    | dev | eSPI emulation controller device  | 
    | chipsel | Chip-select value  | 
  
   
- Returns
 - espi_emul to use 
 
- 
NULL if not found 
 
 
 
◆ emul_trigger_event
      
        
          | typedef int(* emul_trigger_event) (const struct device *dev, struct espi_event *evt) | 
        
      
 
#include <include/zephyr/drivers/espi_emul.h>
Triggers an event on the emulator of eSPI controller side which causes calling specific callbacks.
- Parameters
 - 
  
    | dev | Device instance of emulated eSPI controller  | 
    | evt | Event to be triggered | 
  
   
- Return values
 - 
  
    | 0 | If successful.  | 
    | -EIO | General input / output error.  | 
  
   
 
 
◆ emul_espi_host_port80_write()
      
        
          | int emul_espi_host_port80_write  | 
          ( | 
          const struct device *  | 
          espi_dev,  | 
        
        
           | 
           | 
          uint32_t  | 
          data  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
#include <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
- Parameters
 - 
  
    | espi_dev | eSPI emulation controller device  | 
    | data | The date to be written. | 
  
   
- Return values
 - 
  
    | 0 | If successful.  | 
    | -EIO | General input / output error.  | 
  
   
 
 
◆ emul_espi_host_send_vw()
#include <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
- Parameters
 - 
  
    | espi_dev | eSPI emulation controller device  | 
    | vw | The signal to be set.  | 
    | level | The level of the signal to be set. | 
  
   
- Return values
 - 
  
    | 0 | If successful.  | 
    | -EIO | General input / output error.  | 
  
   
 
 
◆ espi_emul_register()
      
        
          | int espi_emul_register  | 
          ( | 
          const struct device *  | 
          dev,  | 
        
        
           | 
           | 
          struct espi_emul *  | 
          emul  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
#include <include/zephyr/drivers/espi_emul.h>
Register an emulated device on the controller
- Parameters
 - 
  
    | dev | Device that will use the emulator  | 
    | emul | eSPI emulator to use  | 
  
   
- Returns
 - 0 indicating success (always)