Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
|
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_backend * | ec_host_cmd_backend_get_espi (const struct device *dev) |
Get the eSPI Host Command backend pointer. | |
struct ec_host_cmd_backend * | ec_host_cmd_backend_get_shi_npcx (void) |
Get the SHI NPCX Host Command backend pointer. | |
struct ec_host_cmd_backend * | ec_host_cmd_backend_get_shi_ite (void) |
Get the SHI ITE Host Command backend pointer. | |
struct ec_host_cmd_backend * | ec_host_cmd_backend_get_uart (const struct device *dev) |
Get the UART Host Command backend pointer. | |
struct ec_host_cmd_backend * | ec_host_cmd_backend_get_spi (struct gpio_dt_spec *cs) |
Get the SPI Host Command backend pointer. |
Interface to EC Host Command backends.
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.
[in] | backend | Pointer to the backend structure for the driver instance. |
[in,out] | rx_ctx | Pointer 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] | tx | Pointer 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. |
0 | if successful |
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.
backend | Pointer to the backed to send data. |
0 | if successful. |
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.
dev | Pointer to eSPI device instance. |
The | eSPI backend pointer. |
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.
the | SHI ITE backend pointer |
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.
the | SHI NPCX backend pointer |
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.
cs | Chip select pin.. |
The | SPI backend pointer. |
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.
dev | Pointer to UART device instance. |
The | UART backend pointer. |