13#ifndef ZEPHYR_INCLUDE_SHELL_UART_H_
14#define ZEPHYR_INCLUDE_SHELL_UART_H_
26#ifndef CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE
27#define CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE 0
30#ifndef CONFIG_SHELL_BACKEND_SERIAL_TX_RING_BUFFER_SIZE
31#define CONFIG_SHELL_BACKEND_SERIAL_TX_RING_BUFFER_SIZE 0
34#ifndef CONFIG_SHELL_BACKEND_SERIAL_ASYNC_RX_BUFFER_COUNT
35#define CONFIG_SHELL_BACKEND_SERIAL_ASYNC_RX_BUFFER_COUNT 0
38#ifndef CONFIG_SHELL_BACKEND_SERIAL_ASYNC_RX_BUFFER_SIZE
39#define CONFIG_SHELL_BACKEND_SERIAL_ASYNC_RX_BUFFER_SIZE 0
42#define ASYNC_RX_BUF_SIZE (CONFIG_SHELL_BACKEND_SERIAL_ASYNC_RX_BUFFER_COUNT * \
43 (CONFIG_SHELL_BACKEND_SERIAL_ASYNC_RX_BUFFER_SIZE + \
44 UART_ASYNC_RX_BUF_OVERHEAD))
51#ifdef CONFIG_MCUMGR_TRANSPORT_SHELL
82#ifdef CONFIG_SHELL_BACKEND_SERIAL_API_POLLING
83#define SHELL_UART_STRUCT struct shell_uart_polling
84#elif defined(CONFIG_SHELL_BACKEND_SERIAL_API_ASYNC)
85#define SHELL_UART_STRUCT struct shell_uart_async
87#define SHELL_UART_STRUCT struct shell_uart_int_driven
96#define SHELL_UART_DEFINE(_name, ...) \
97 static SHELL_UART_STRUCT _name##_shell_uart; \
98 struct shell_transport _name = { \
99 .api = &shell_uart_transport_api, \
100 .ctx = (struct shell_telnet *)&_name##_shell_uart, \
long atomic_t
Definition atomic_types.h:15
void(* shell_transport_handler_t)(enum shell_transport_evt evt, void *context)
Definition shell.h:795
struct smp_shell_data * shell_uart_smp_shell_data_get_ptr(void)
This function provides pointer to the smp shell data of the UART shell transport.
#define CONFIG_SHELL_BACKEND_SERIAL_TX_RING_BUFFER_SIZE
Definition shell_uart.h:31
#define ASYNC_RX_BUF_SIZE
Definition shell_uart.h:42
const struct shell * shell_backend_uart_get_ptr(void)
This function provides pointer to the shell UART backend instance.
#define CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE
Definition shell_uart.h:27
const struct shell_transport_api shell_uart_transport_api
Shell transport for the mcumgr SMP protocol.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
Semaphore structure.
Definition kernel.h:3663
Kernel timer structure.
Definition kernel.h:1777
A structure to represent a ring buffer.
Definition ring_buffer.h:50
Unified shell transport interface.
Definition shell.h:818
Definition shell_uart.h:66
struct k_sem tx_sem
Definition shell_uart.h:68
struct uart_async_rx async_rx
Definition shell_uart.h:69
atomic_t pending_rx_req
Definition shell_uart.h:71
struct uart_async_rx_config async_rx_config
Definition shell_uart.h:70
struct shell_uart_common common
Definition shell_uart.h:67
uint8_t rx_data[(0 *(0+UART_ASYNC_RX_BUF_OVERHEAD))]
Definition shell_uart.h:72
Definition shell_uart.h:46
shell_transport_handler_t handler
Definition shell_uart.h:48
void * context
Definition shell_uart.h:49
const struct device * dev
Definition shell_uart.h:47
bool blocking_tx
Definition shell_uart.h:50
Definition shell_uart.h:56
uint8_t tx_buf[0]
Definition shell_uart.h:60
struct ring_buf tx_ringbuf
Definition shell_uart.h:58
struct shell_uart_common common
Definition shell_uart.h:57
struct ring_buf rx_ringbuf
Definition shell_uart.h:59
struct k_timer dtr_timer
Definition shell_uart.h:62
atomic_t tx_busy
Definition shell_uart.h:63
uint8_t rx_buf[0]
Definition shell_uart.h:61
Definition shell_uart.h:75
struct k_timer rx_timer
Definition shell_uart.h:79
uint8_t rx_buf[0]
Definition shell_uart.h:78
struct ring_buf rx_ringbuf
Definition shell_uart.h:77
struct shell_uart_common common
Definition shell_uart.h:76
Shell instance internals.
Definition shell.h:1063
Data used by SMP shell.
Definition smp_shell.h:32
UART asynchronous RX helper configuration structure.
Definition uart_async_rx.h:62
UART asynchronous RX helper structure.
Definition uart_async_rx.h:36
Helper module for receiving using UART Asynchronous API.