Zephyr API 3.6.99
Loading...
Searching...
No Matches

Interface to EC Host Command backends . More...

Files

file  backend.h
 Public APIs for Host Command backends that respond to host commands.
 

Data Structures

struct  ec_host_cmd_backend
 EC Host Command Backend. More...
 
struct  ec_host_cmd_rx_ctx
 Context for host command backend and handler to pass rx data. More...
 
struct  ec_host_cmd_tx_buf
 Context for host command backend and handler to pass tx data. More...
 
struct  ec_host_cmd_backend_api
 

Typedefs

typedef int(* ec_host_cmd_backend_api_init) (const struct ec_host_cmd_backend *backend, struct ec_host_cmd_rx_ctx *rx_ctx, struct ec_host_cmd_tx_buf *tx)
 Initialize a host command backend.
 
typedef int(* ec_host_cmd_backend_api_send) (const struct ec_host_cmd_backend *backend)
 Sends data to the host.
 

Functions

struct ec_host_cmd_backendec_host_cmd_backend_get_espi (const struct device *dev)
 Get the eSPI Host Command backend pointer.
 
struct ec_host_cmd_backendec_host_cmd_backend_get_shi_npcx (void)
 Get the SHI NPCX Host Command backend pointer.
 
struct ec_host_cmd_backendec_host_cmd_backend_get_shi_ite (void)
 Get the SHI ITE Host Command backend pointer.
 
struct ec_host_cmd_backendec_host_cmd_backend_get_uart (const struct device *dev)
 Get the UART Host Command backend pointer.
 
struct ec_host_cmd_backendec_host_cmd_backend_get_spi (struct gpio_dt_spec *cs)
 Get the SPI Host Command backend pointer.
 
void ec_host_cmd_backend_usb_trigger_event (void)
 Signal event over USB.
 

Detailed Description

Interface to EC Host Command backends .

Typedef Documentation

◆ ec_host_cmd_backend_api_init

typedef int(* ec_host_cmd_backend_api_init) (const struct ec_host_cmd_backend *backend, struct ec_host_cmd_rx_ctx *rx_ctx, struct ec_host_cmd_tx_buf *tx)

#include <zephyr/mgmt/ec_host_cmd/backend.h>

Initialize a host command backend.

This routine initializes a host command backend. It includes initialization a device used to communication and setting up buffers. This function is called by the ec_host_cmd_init function.

Parameters
[in]backendPointer to the backend structure for the driver instance.
[in,out]rx_ctxPointer to the receive context object. These objects are used to receive data from the driver when the host sends data. The buf member can be assigned by the backend.
[in,out]txPointer to the transmit buffer object. The buf and len_max members can be assigned by the backend. These objects are used to send data by the backend with the ec_host_cmd_backend_api_send function.
Return values
0if successful

◆ ec_host_cmd_backend_api_send

typedef int(* ec_host_cmd_backend_api_send) (const struct ec_host_cmd_backend *backend)

#include <zephyr/mgmt/ec_host_cmd/backend.h>

Sends data to the host.

Sends data from tx buf that was passed via ec_host_cmd_backend_api_init function.

Parameters
backendPointer to the backed to send data.
Return values
0if successful.

Function Documentation

◆ ec_host_cmd_backend_get_espi()

struct ec_host_cmd_backend * ec_host_cmd_backend_get_espi ( const struct device * dev)

#include <zephyr/mgmt/ec_host_cmd/backend.h>

Get the eSPI Host Command backend pointer.

Get the eSPI pointer backend and pass a pointer to eSPI device instance that will be used for the Host Command communication.

Parameters
devPointer to eSPI device instance.
Return values
TheeSPI backend pointer.

◆ ec_host_cmd_backend_get_shi_ite()

struct ec_host_cmd_backend * ec_host_cmd_backend_get_shi_ite ( void )

#include <zephyr/mgmt/ec_host_cmd/backend.h>

Get the SHI ITE Host Command backend pointer.

Return values
theSHI ITE backend pointer

◆ ec_host_cmd_backend_get_shi_npcx()

struct ec_host_cmd_backend * ec_host_cmd_backend_get_shi_npcx ( void )

#include <zephyr/mgmt/ec_host_cmd/backend.h>

Get the SHI NPCX Host Command backend pointer.

Return values
theSHI NPCX backend pointer

◆ ec_host_cmd_backend_get_spi()

struct ec_host_cmd_backend * ec_host_cmd_backend_get_spi ( struct gpio_dt_spec * cs)

#include <zephyr/mgmt/ec_host_cmd/backend.h>

Get the SPI Host Command backend pointer.

Get the SPI pointer backend and pass a chip select pin that will be used for the Host Command communication.

Parameters
csChip select pin..
Return values
TheSPI backend pointer.

◆ ec_host_cmd_backend_get_uart()

struct ec_host_cmd_backend * ec_host_cmd_backend_get_uart ( const struct device * dev)

#include <zephyr/mgmt/ec_host_cmd/backend.h>

Get the UART Host Command backend pointer.

Get the UART pointer backend and pass a pointer to UART device instance that will be used for the Host Command communication.

Parameters
devPointer to UART device instance.
Return values
TheUART backend pointer.

◆ ec_host_cmd_backend_usb_trigger_event()

void ec_host_cmd_backend_usb_trigger_event ( void )

#include <zephyr/mgmt/ec_host_cmd/backend.h>

Signal event over USB.

Signal event using USB interrupt endpoint. It informs host that there is a pending event that has to be handled. The function performs remote wake-up if needed.