Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
Host Command Peripherals API

Host Command Peripherals API. More...

Data Structures

struct  ec_host_cmd_periph_rx_ctx
 Context for host command peripheral and framework to pass rx data. More...
 
struct  ec_host_cmd_periph_tx_buf
 Context for host command peripheral and framework to pass tx data. More...
 
struct  ec_host_cmd_periph_api
 

Typedefs

typedef int(* ec_host_cmd_periph_api_init) (const struct device *dev, struct ec_host_cmd_periph_rx_ctx *rx_ctx)
 
typedef int(* ec_host_cmd_periph_api_send) (const struct device *dev, const struct ec_host_cmd_periph_tx_buf *tx_buf)
 

Functions

int ec_host_cmd_periph_init (const struct device *dev, struct ec_host_cmd_periph_rx_ctx *rx_ctx)
 Initialize a host command device. More...
 
int ec_host_cmd_periph_send (const struct device *dev, const struct ec_host_cmd_periph_tx_buf *tx_buf)
 Sends the specified data to the host. More...
 

Detailed Description

Host Command Peripherals API.

Typedef Documentation

◆ ec_host_cmd_periph_api_init

typedef int(* ec_host_cmd_periph_api_init) (const struct device *dev, struct ec_host_cmd_periph_rx_ctx *rx_ctx)

◆ ec_host_cmd_periph_api_send

typedef int(* ec_host_cmd_periph_api_send) (const struct device *dev, const struct ec_host_cmd_periph_tx_buf *tx_buf)

Function Documentation

◆ ec_host_cmd_periph_init()

int ec_host_cmd_periph_init ( const struct device dev,
struct ec_host_cmd_periph_rx_ctx rx_ctx 
)

#include <include/drivers/ec_host_cmd_periph.h>

Initialize a host command device.

This routine initializes a host command device, prior to its first use. The receive context object are an output of this function and are valid for the lifetime of this device. The RX context is used by the client to receive data from the host.

Parameters
devPointer to the device structure for the driver instance.
rx_ctx[out] The receiving context object that are valid for the lifetime of the device. These objects are used to receive data from the driver when the host send data.
Return values
0if successful

◆ ec_host_cmd_periph_send()

int ec_host_cmd_periph_send ( const struct device dev,
const struct ec_host_cmd_periph_tx_buf tx_buf 
)

#include <include/drivers/ec_host_cmd_periph.h>

Sends the specified data to the host.

Sends the data specified in tx_buf to the host over the host communication bus.

Parameters
devPointer to the device structure for the driver instance.
tx_bufThe data to transmit to the host.
Return values
0if successful