7#ifndef ZEPHYR_INCLUDE_SHELL_UART_H_ 
    8#define ZEPHYR_INCLUDE_SHELL_UART_H_ 
   20#ifndef CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE 
   21#define CONFIG_SHELL_BACKEND_SERIAL_RX_RING_BUFFER_SIZE 0 
   24#ifndef CONFIG_SHELL_BACKEND_SERIAL_TX_RING_BUFFER_SIZE 
   25#define CONFIG_SHELL_BACKEND_SERIAL_TX_RING_BUFFER_SIZE 0 
   28#ifndef CONFIG_SHELL_BACKEND_SERIAL_ASYNC_RX_BUFFER_COUNT 
   29#define CONFIG_SHELL_BACKEND_SERIAL_ASYNC_RX_BUFFER_COUNT 0 
   32#ifndef CONFIG_SHELL_BACKEND_SERIAL_ASYNC_RX_BUFFER_SIZE 
   33#define CONFIG_SHELL_BACKEND_SERIAL_ASYNC_RX_BUFFER_SIZE 0 
   36#define ASYNC_RX_BUF_SIZE (CONFIG_SHELL_BACKEND_SERIAL_ASYNC_RX_BUFFER_COUNT * \ 
   37                (CONFIG_SHELL_BACKEND_SERIAL_ASYNC_RX_BUFFER_SIZE + \ 
   38                 UART_ASYNC_RX_BUF_OVERHEAD)) 
 
   45#ifdef CONFIG_MCUMGR_TRANSPORT_SHELL 
 
   76#ifdef CONFIG_SHELL_BACKEND_SERIAL_API_POLLING 
   77#define SHELL_UART_STRUCT struct shell_uart_polling 
   78#elif defined(CONFIG_SHELL_BACKEND_SERIAL_API_ASYNC) 
   79#define SHELL_UART_STRUCT struct shell_uart_async 
   81#define SHELL_UART_STRUCT struct shell_uart_int_driven 
   90#define SHELL_UART_DEFINE(_name, ...)                                                              \ 
   91        static SHELL_UART_STRUCT _name##_shell_uart;                                               \ 
   92        struct shell_transport _name = {                                                           \ 
   93                .api = &shell_uart_transport_api,                                                  \ 
   94                .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:778
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:25
#define ASYNC_RX_BUF_SIZE
Definition shell_uart.h:36
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:21
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:510
Semaphore structure.
Definition kernel.h:3418
Kernel timer structure.
Definition kernel.h:1641
A structure to represent a ring buffer.
Definition ring_buffer.h:49
Unified shell transport interface.
Definition shell.h:800
Definition shell_uart.h:60
struct k_sem tx_sem
Definition shell_uart.h:62
struct uart_async_rx async_rx
Definition shell_uart.h:63
atomic_t pending_rx_req
Definition shell_uart.h:65
struct uart_async_rx_config async_rx_config
Definition shell_uart.h:64
struct shell_uart_common common
Definition shell_uart.h:61
uint8_t rx_data[(0 *(0+UART_ASYNC_RX_BUF_OVERHEAD))]
Definition shell_uart.h:66
Definition shell_uart.h:40
shell_transport_handler_t handler
Definition shell_uart.h:42
void * context
Definition shell_uart.h:43
const struct device * dev
Definition shell_uart.h:41
bool blocking_tx
Definition shell_uart.h:44
Definition shell_uart.h:50
uint8_t tx_buf[0]
Definition shell_uart.h:54
struct ring_buf tx_ringbuf
Definition shell_uart.h:52
struct shell_uart_common common
Definition shell_uart.h:51
struct ring_buf rx_ringbuf
Definition shell_uart.h:53
struct k_timer dtr_timer
Definition shell_uart.h:56
atomic_t tx_busy
Definition shell_uart.h:57
uint8_t rx_buf[0]
Definition shell_uart.h:55
Definition shell_uart.h:69
struct k_timer rx_timer
Definition shell_uart.h:73
uint8_t rx_buf[0]
Definition shell_uart.h:72
struct ring_buf rx_ringbuf
Definition shell_uart.h:71
struct shell_uart_common common
Definition shell_uart.h:70
Shell instance internals.
Definition shell.h:1038
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.