Paparazzi UAS  v6.2_unstable
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 
uint32_t
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
Definition: vl53l1_types.h:78
uint8_t
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98
shellInit
void shellInit(void)
Shell manager initialization.
Definition: microrlShell.c:378
modeAlternate
void modeAlternate(void(*funcp)(uint8_t c, uint32_t mode), uint32_t mode)
Definition: microrlShell.c:451
shellCreateStatic
thread_t * shellCreateStatic(const ShellConfig *scp, void *wsp, size_t size, tprio_t prio)
Spawns a new shell.
Definition: microrlShell.c:412
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
modeShell
void modeShell(void)
Definition: microrlShell.c:459
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)