Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
uart_emul.h
Go to the documentation of this file.
1/*
2 * Copyright 2024 Basalte bv
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_DRIVERS_UART_EMUL_H_
8#define ZEPHYR_INCLUDE_DRIVERS_UART_EMUL_H_
9
10#include <zephyr/device.h>
11#include <zephyr/drivers/emul.h>
12#include <zephyr/drivers/uart.h>
13#include <zephyr/sys/slist.h>
14#include <zephyr/types.h>
15
29#ifdef __cplusplus
30extern "C" {
31#endif
32
34
42typedef void (*uart_emul_device_tx_data_ready_t)(const struct device *dev, size_t size,
43 const struct emul *target);
44
46struct uart_emul {
49 const struct emul *target;
52};
53
58
66int uart_emul_register(const struct device *dev, struct uart_emul *emul);
67
68#ifdef __cplusplus
69}
70#endif
71
76#endif /* ZEPHYR_INCLUDE_DRIVERS_UART_EMUL_H_ */
Public APIs for UART drivers.
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
int uart_emul_register(const struct device *dev, struct uart_emul *emul)
Register an emulated device on the controller.
void(* uart_emul_device_tx_data_ready_t)(const struct device *dev, size_t size, const struct emul *target)
Define the emulation callback function signature.
Definition uart_emul.h:42
Runtime device structure (in ROM) per driver instance.
Definition device.h:411
An emulator instance - represents the target emulated device/peripheral that is interacted with throu...
Definition emul.h:82
Definition of the emulator API.
Definition uart_emul.h:55
uart_emul_device_tx_data_ready_t tx_data_ready
Definition uart_emul.h:56
Node in a linked list of emulators for UART devices.
Definition uart_emul.h:46
sys_snode_t node
Definition uart_emul.h:47
const struct uart_emul_device_api * api
API provided for this device.
Definition uart_emul.h:51
const struct emul * target
Target emulator - REQUIRED for all emulated bus nodes of any type.
Definition uart_emul.h:49