All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vexshell.c File Reference

Simple Command line interface shell. More...

#include <string.h>
#include "ch.h"
#include "hal.h"
#include "vex.h"

Macros

#define CR   '\r'
 
#define LF   '\n'
 
#define CTRL_C   0x03
 
#define CTRL_D   0x04
 
#define CTRL_Q   0x11
 
#define BKSPACE_CHAR   '\b'
 
#define ABORT_CHAR   CTRL_C
 
#define QUIT_APPEND   CTRL_Q
 
#define HISTORY_CHAR   '!'
 
#define ESC   0x1B
 
#define SYMVAL(sym)   (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0))
 

Functions

void shellInit (void)
 Shell manager initialization. More...
 
Thread * shellCreate (const ShellConfig *scp, size_t size, tprio_t prio)
 Spawns a new shell using dynamic memory allocation. More...
 
Thread * shellCreateStatic (const ShellConfig *scp, void *wsp, size_t size, tprio_t prio)
 Create statically allocated shell thread. More...
 

Variables

EventSource shell_terminated
 
uint32_t _textdata
 
uint32_t _data
 
uint32_t _edata
 

Detailed Description

Simple Command line interface shell.

Macro Definition Documentation

#define CR   '\r'
#define LF   '\n'
#define CTRL_C   0x03
#define CTRL_D   0x04
#define CTRL_Q   0x11
#define BKSPACE_CHAR   '\b'
#define ABORT_CHAR   CTRL_C
#define QUIT_APPEND   CTRL_Q
#define HISTORY_CHAR   '!'
#define ESC   0x1B
#define SYMVAL (   sym)    (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0))

Function Documentation

void shellInit ( void  )

Shell manager initialization.

Thread* shellCreate ( const ShellConfig scp,
size_t  size,
tprio_t  prio 
)

Spawns a new shell using dynamic memory allocation.

Parameters
[in]scppointer to a ShellConfig object
[in]sizesize of the shell working area to be allocated
[in]priopriority level for the new shell
Returns
A pointer to the shell thread.
Return values
NULLthread creation failed because memory allocation.
Note
CH_USE_MALLOC_HEAP and CH_USE_DYNAMIC must be enabled.
Thread* shellCreateStatic ( const ShellConfig scp,
void *  wsp,
size_t  size,
tprio_t  prio 
)

Create statically allocated shell thread.

Parameters
[in]scppointer to a ShellConfig object
[in]wsppointer to a working area dedicated to the shell thread stack
[in]sizesize of the shell working area to be allocated
[in]priopriority level for the new shell
Returns
A pointer to the shell thread.

Variable Documentation

EventSource shell_terminated
uint32_t _textdata
uint32_t _data
uint32_t _edata