Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
shell_uart.h File Reference
#include <shell/shell.h>
#include <sys/ring_buffer.h>
#include <sys/atomic.h>
#include "mgmt/mcumgr/smp_shell.h"

Go to the source code of this file.

Data Structures

struct  shell_uart_ctrl_blk
 Shell UART transport instance control block (RW data). More...
 
struct  shell_uart
 Shell UART transport instance structure. More...
 

Macros

#define SHELL_UART_DEFINE(_name, _tx_ringbuf_size, _rx_ringbuf_size)
 Macro for creating shell UART transport instance. More...
 

Functions

const struct shellshell_backend_uart_get_ptr (void)
 This function provides pointer to shell uart backend instance. More...
 

Variables

const struct shell_transport_api shell_uart_transport_api
 

Macro Definition Documentation

◆ SHELL_UART_DEFINE

#define SHELL_UART_DEFINE (   _name,
  _tx_ringbuf_size,
  _rx_ringbuf_size 
)
Value:
static struct shell_uart_ctrl_blk _name##_ctrl_blk; \
Z_UART_SHELL_RX_TIMER_DECLARE(_name); \
Z_UART_SHELL_TX_RINGBUF_DECLARE(_name, _tx_ringbuf_size); \
RING_BUF_DECLARE(_name##_rx_ringbuf, _rx_ringbuf_size); \
static const struct shell_uart _name##_shell_uart = { \
.ctrl_blk = &_name##_ctrl_blk, \
.timer = Z_UART_SHELL_RX_TIMER_PTR(_name), \
.tx_ringbuf = Z_UART_SHELL_TX_RINGBUF_PTR(_name), \
.rx_ringbuf = &_name##_rx_ringbuf, \
}; \
struct shell_transport _name = { \
.ctx = (struct shell_uart *)&_name##_shell_uart \
}
const struct shell_transport_api shell_uart_transport_api
Definition: shell.h:597
const struct shell_transport_api * api
Definition: shell.h:598
Shell UART transport instance control block (RW data).
Definition: shell_uart.h:22
Shell UART transport instance structure.
Definition: shell_uart.h:50
struct shell_uart_ctrl_blk * ctrl_blk
Definition: shell_uart.h:51

Macro for creating shell UART transport instance.

Function Documentation

◆ shell_backend_uart_get_ptr()

const struct shell * shell_backend_uart_get_ptr ( void  )

This function provides pointer to shell uart backend instance.

Function returns pointer to the shell uart instance. This instance can be next used with shell_execute_cmd function in order to test commands behavior.

Returns
Pointer to the shell instance.

Variable Documentation

◆ shell_uart_transport_api

const struct shell_transport_api shell_uart_transport_api
extern