Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hdlc_rcp_if.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024, NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_NET_HDLC_RCP_IF_HDLC_RCP_IF_H_
8#define ZEPHYR_INCLUDE_NET_HDLC_RCP_IF_HDLC_RCP_IF_H_
9
16
17#include <zephyr/sys/util.h>
18#include <zephyr/net/net_if.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
29typedef void (*hdlc_rx_callback_t)(const uint8_t *data, uint16_t len, void *param);
30
32struct hdlc_api {
36 struct net_if_api iface_api;
37
47 int (*register_rx_cb)(hdlc_rx_callback_t hdlc_rx_callback, void *param);
48
60 int (*send)(const uint8_t *frame, uint16_t length);
61
70 int (*deinit)(void);
71
81 int (*deferred_init)(void);
82};
83
84/* Make sure that the interface API is properly setup inside
85 * HDLC interface API struct (it is the first one).
86 */
87BUILD_ASSERT(offsetof(struct hdlc_api, iface_api) == 0);
88
89#ifdef __cplusplus
90}
91#endif
92
93#endif /* ZEPHYR_INCLUDE_NET_HDLC_RCP_IF_HDLC_RCP_IF_H_ */
void(* hdlc_rx_callback_t)(const uint8_t *data, uint16_t len, void *param)
OT RCP HDLC RX callback function.
Definition hdlc_rcp_if.h:29
Public API for network interface.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
HDLC interface configuration data.
Definition hdlc_rcp_if.h:32
int(* register_rx_cb)(hdlc_rx_callback_t hdlc_rx_callback, void *param)
Register the Spinel HDLC RX callback.
Definition hdlc_rcp_if.h:47
int(* deinit)(void)
Deinitialize the device.
Definition hdlc_rcp_if.h:70
int(* send)(const uint8_t *frame, uint16_t length)
Transmit a HDLC frame.
Definition hdlc_rcp_if.h:60
struct net_if_api iface_api
HDLC interface API.
Definition hdlc_rcp_if.h:36
int(* deferred_init)(void)
Optional: complete the RCP interface initialization in deferred init mode.
Definition hdlc_rcp_if.h:81
Misc utilities.