Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
microrlShell.h
Go to the documentation of this file.
1 #pragma once
2 
10 #include "ch.h"
11 #include "hal.h"
12 
13 
14 #ifndef SHELL_DYNAMIC_ENTRIES_NUMBER
15 #define SHELL_DYNAMIC_ENTRIES_NUMBER 0U
16 #endif
17 
18 // legacy compatibility
19 #define shellCreate(C, S, P) shellCreateFromHeap(C, S, P)
20 
24 typedef void (shellcmd_f)(BaseSequentialStream *chp, int argc, const char * const argv[]);
25 
26 
30 typedef struct {
31  const char *sc_name;
33 } ShellCommand;
34 
38 typedef struct {
39  BaseSequentialStream *sc_channel;
43 } ShellConfig;
44 
45 #if !defined(__DOXYGEN__)
46 extern event_source_t shell_terminated;
47 #endif
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52  void shellInit(void);
53 #if CH_CFG_USE_HEAP && CH_CFG_USE_DYNAMIC
54  thread_t *shellCreateFromHeap(const ShellConfig *scp, size_t size, tprio_t prio);
55 #endif
56  thread_t *shellCreateStatic(const ShellConfig *scp, void *wsp,
57  size_t size, tprio_t prio);
58 #if SHELL_DYNAMIC_ENTRIES_NUMBER
59  bool shellAddEntry(const ShellCommand sc);
60 #endif
61  bool shellGetLine(BaseSequentialStream *chp, char *line, unsigned size);
62  void modeAlternate (void (*) (uint8_t c, uint32_t mode), uint32_t mode);
63  void modeShell (void);
64 #ifdef __cplusplus
65 }
66 #endif
67 
68 
c
VIC slots used for the LPC2148 define name e g gps UART1_VIC_SLOT e g modem SPI1_VIC_SLOT SPI1 in mcu_periph spi_arch c or spi_slave_hs_arch c(and some others not using the SPI peripheral yet..) I2C0_VIC_SLOT 8 mcu_periph/i2c_arch.c I2C1_VIC_SLOT 9 mcu_periph/i2c_arch.c USB_VIC_SLOT 10 usb
shellInit
void shellInit(void)
Shell manager initialization.
Definition: microrlShell.c:382
modeAlternate
void modeAlternate(void(*funcp)(uint8_t c, uint32_t mode), uint32_t mode)
Definition: microrlShell.c:455
uint32_t
unsigned long uint32_t
Definition: types.h:18
shellCreateStatic
thread_t * shellCreateStatic(const ShellConfig *scp, void *wsp, size_t size, tprio_t prio)
Spawns a new shell.
Definition: microrlShell.c:416
shellcmd_f
void() shellcmd_f(BaseSequentialStream *chp, int argc, const char *const argv[])
Command handler function type.
Definition: microrlShell.h:24
ShellConfig::sc_commands
const ShellCommand * sc_commands
Shell extra commands table.
Definition: microrlShell.h:41
ShellCommand
Custom command entry type.
Definition: microrlShell.h:30
shell_terminated
event_source_t shell_terminated
Shell termination event source.
Definition: microrlShell.c:30
uint8_t
unsigned char uint8_t
Definition: types.h:14
modeShell
void modeShell(void)
Definition: microrlShell.c:463
ShellConfig
Shell descriptor type.
Definition: microrlShell.h:38
ShellCommand::sc_function
shellcmd_f * sc_function
Command function.
Definition: microrlShell.h:32
ShellConfig::sc_channel
BaseSequentialStream * sc_channel
I/O channel associated to the shell.
Definition: microrlShell.h:39
ShellCommand::sc_name
const char * sc_name
Command name.
Definition: microrlShell.h:31
mode
static uint8_t mode
mode holds the current sonar mode mode = 0 used at high altitude, uses 16 wave patterns mode = 1 used...
Definition: sonar_bebop.c:69
shellGetLine
bool shellGetLine(BaseSequentialStream *chp, char *line, unsigned size)