28#ifdef CONFIG_MCUMGR_TRANSPORT_SHELL 
   33#ifdef CONFIG_SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN 
   34#define Z_UART_SHELL_TX_RINGBUF_DECLARE(_name, _size) \ 
   35        RING_BUF_DECLARE(_name##_tx_ringbuf, _size) 
   37#define Z_UART_SHELL_RX_TIMER_DECLARE(_name)  
   38#define Z_UART_SHELL_TX_RINGBUF_PTR(_name) (&_name##_tx_ringbuf) 
   40#define Z_UART_SHELL_RX_TIMER_PTR(_name) NULL 
   42#define Z_UART_SHELL_DTR_TIMER_DECLARE(_name) static struct k_timer _name##_dtr_timer 
   43#define Z_UART_SHELL_DTR_TIMER_PTR(_name) (&_name##_dtr_timer) 
   46#define Z_UART_SHELL_TX_RINGBUF_DECLARE(_name, _size)  
   47#define Z_UART_SHELL_RX_TIMER_DECLARE(_name) static struct k_timer _name##_timer 
   48#define Z_UART_SHELL_TX_RINGBUF_PTR(_name) NULL 
   49#define Z_UART_SHELL_RX_TIMER_PTR(_name) (&_name##_timer) 
   50#define Z_UART_SHELL_DTR_TIMER_DECLARE(_name)  
   51#define Z_UART_SHELL_DTR_TIMER_PTR(_name) NULL 
   64#define SHELL_UART_DEFINE(_name, _tx_ringbuf_size, _rx_ringbuf_size)    \ 
   65        static struct shell_uart_ctrl_blk _name##_ctrl_blk;             \ 
   66        Z_UART_SHELL_RX_TIMER_DECLARE(_name);                           \ 
   67        Z_UART_SHELL_DTR_TIMER_DECLARE(_name);                          \ 
   68        Z_UART_SHELL_TX_RINGBUF_DECLARE(_name, _tx_ringbuf_size);       \ 
   69        RING_BUF_DECLARE(_name##_rx_ringbuf, _rx_ringbuf_size);         \ 
   70        static const struct shell_uart _name##_shell_uart = {           \ 
   71                .ctrl_blk = &_name##_ctrl_blk,                          \ 
   72                .timer = Z_UART_SHELL_RX_TIMER_PTR(_name),              \ 
   73                .dtr_timer = Z_UART_SHELL_DTR_TIMER_PTR(_name),         \ 
   74                .tx_ringbuf = Z_UART_SHELL_TX_RINGBUF_PTR(_name),       \ 
   75                .rx_ringbuf = &_name##_rx_ringbuf,                      \ 
   77        struct shell_transport _name = {                                \ 
   78                .api = &shell_uart_transport_api,                       \ 
   79                .ctx = (struct shell_uart *)&_name##_shell_uart         \ 
long atomic_t
Definition: atomic.h:22
 
void(* shell_transport_handler_t)(enum shell_transport_evt evt, void *context)
Definition: shell.h:586
 
const struct shell * shell_backend_uart_get_ptr(void)
This function provides pointer to shell uart backend instance.
 
const struct shell_transport_api shell_uart_transport_api
 
Shell transport for the mcumgr SMP protocol.
 
Runtime device structure (in ROM) per driver instance.
Definition: device.h:380
 
A structure to represent a ring buffer.
Definition: ring_buffer.h:32
 
Unified shell transport interface.
Definition: shell.h:607
 
Shell UART transport instance control block (RW data).
Definition: shell_uart.h:22
 
const struct device * dev
Definition: shell_uart.h:23
 
shell_transport_handler_t handler
Definition: shell_uart.h:24
 
bool blocking_tx
Definition: shell_uart.h:27
 
atomic_t tx_busy
Definition: shell_uart.h:26
 
void * context
Definition: shell_uart.h:25
 
Shell UART transport instance structure.
Definition: shell_uart.h:55
 
struct ring_buf * tx_ringbuf
Definition: shell_uart.h:59
 
struct k_timer * timer
Definition: shell_uart.h:57
 
struct shell_uart_ctrl_blk * ctrl_blk
Definition: shell_uart.h:56
 
struct k_timer * dtr_timer
Definition: shell_uart.h:58
 
struct ring_buf * rx_ringbuf
Definition: shell_uart.h:60
 
Shell instance internals.
Definition: shell.h:843
 
Data used by SMP shell.
Definition: smp_shell.h:23