Zephyr Project API  3.4.0
A Scalable Open Source RTOS
backend.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Google LLC.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12#ifndef ZEPHYR_INCLUDE_MGMT_EC_HOST_CMD_BACKEND_H_
13#define ZEPHYR_INCLUDE_MGMT_EC_HOST_CMD_BACKEND_H_
14
15#include <zephyr/sys/__assert.h>
16#include <zephyr/device.h>
17#include <zephyr/kernel.h>
18#include <zephyr/types.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
28 void *ctx;
29};
30
49 size_t len;
54 struct k_sem handler_owns;
55};
56
67 void *buf;
69 size_t len;
71 size_t len_max;
72};
73
91typedef int (*ec_host_cmd_backend_api_init)(const struct ec_host_cmd_backend *backend,
92 struct ec_host_cmd_rx_ctx *rx_ctx,
93 struct ec_host_cmd_tx_buf *tx);
94
105typedef int (*ec_host_cmd_backend_api_send)(const struct ec_host_cmd_backend *backend);
106
107__subsystem struct ec_host_cmd_backend_api {
110};
111
123
130
137
149
154#ifdef __cplusplus
155}
156#endif
157
158#endif /* ZEPHYR_INCLUDE_MGMT_EC_HOST_CMD_EC_HOST_CMD_BACKEND_H_ */
int(* ec_host_cmd_backend_api_send)(const struct ec_host_cmd_backend *backend)
Sends data to the host.
Definition: backend.h:105
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_uart(const struct device *dev)
Get the UART Host Command backend pointer.
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.
Definition: backend.h:91
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_shi_npcx(void)
Get the SHI NPCX Host Command backend pointer.
Public kernel APIs.
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition: device.h:380
Definition: backend.h:107
ec_host_cmd_backend_api_init init
Definition: backend.h:108
ec_host_cmd_backend_api_send send
Definition: backend.h:109
Definition: backend.h:24
void * ctx
Definition: backend.h:28
const struct ec_host_cmd_backend_api * api
Definition: backend.h:26
Context for host command backend and handler to pass rx data.
Definition: backend.h:41
struct k_sem handler_owns
Definition: backend.h:54
size_t len
Definition: backend.h:49
uint8_t * buf
Definition: backend.h:47
Context for host command backend and handler to pass tx data.
Definition: backend.h:60
size_t len_max
Definition: backend.h:71
void * buf
Definition: backend.h:67
size_t len
Definition: backend.h:69