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 
   43#define Z_UART_SHELL_TX_RINGBUF_DECLARE(_name, _size)  
   44#define Z_UART_SHELL_RX_TIMER_DECLARE(_name) static struct k_timer _name##_timer 
   45#define Z_UART_SHELL_TX_RINGBUF_PTR(_name) NULL 
   46#define Z_UART_SHELL_RX_TIMER_PTR(_name) (&_name##_timer) 
   58#define SHELL_UART_DEFINE(_name, _tx_ringbuf_size, _rx_ringbuf_size)    \ 
   59        static struct shell_uart_ctrl_blk _name##_ctrl_blk;             \ 
   60        Z_UART_SHELL_RX_TIMER_DECLARE(_name);                           \ 
   61        Z_UART_SHELL_TX_RINGBUF_DECLARE(_name, _tx_ringbuf_size);       \ 
   62        RING_BUF_DECLARE(_name##_rx_ringbuf, _rx_ringbuf_size);         \ 
   63        static const struct shell_uart _name##_shell_uart = {           \ 
   64                .ctrl_blk = &_name##_ctrl_blk,                          \ 
   65                .timer = Z_UART_SHELL_RX_TIMER_PTR(_name),              \ 
   66                .tx_ringbuf = Z_UART_SHELL_TX_RINGBUF_PTR(_name),       \ 
   67                .rx_ringbuf = &_name##_rx_ringbuf,                      \ 
   69        struct shell_transport _name = {                                \ 
   70                .api = &shell_uart_transport_api,                       \ 
   71                .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:584
 
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:378
 
A structure to represent a ring buffer.
Definition: ring_buffer.h:32
 
Unified shell transport interface.
Definition: shell.h:605
 
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:50
 
struct ring_buf * tx_ringbuf
Definition: shell_uart.h:53
 
struct k_timer * timer
Definition: shell_uart.h:52
 
struct shell_uart_ctrl_blk * ctrl_blk
Definition: shell_uart.h:51
 
struct ring_buf * rx_ringbuf
Definition: shell_uart.h:54
 
Shell instance internals.
Definition: shell.h:840
 
Data used by SMP shell.
Definition: smp_shell.h:23