Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
microrlShell.h
Go to the documentation of this file.
1 #pragma once
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 
BaseSequentialStream * sc_channel
I/O channel associated to the shell.
Definition: microrlShell.h:39
const ShellCommand * sc_commands
Shell extra commands table.
Definition: microrlShell.h:41
shellcmd_f * sc_function
Command function.
Definition: microrlShell.h:32
const char * sc_name
Command name.
Definition: microrlShell.h:31
void shellInit(void)
Shell manager initialization.
Definition: microrlShell.c:378
event_source_t shell_terminated
Shell termination event source.
Definition: microrlShell.c:30
void() shellcmd_f(BaseSequentialStream *chp, int argc, const char *const argv[])
Command handler function type.
Definition: microrlShell.h:24
void modeShell(void)
Definition: microrlShell.c:459
void modeAlternate(void(*funcp)(uint8_t c, uint32_t mode), uint32_t mode)
Definition: microrlShell.c:451
bool shellGetLine(BaseSequentialStream *chp, char *line, unsigned size)
thread_t * shellCreateStatic(const ShellConfig *scp, void *wsp, size_t size, tprio_t prio)
Spawns a new shell.
Definition: microrlShell.c:412
Custom command entry type.
Definition: microrlShell.h:30
Shell descriptor type.
Definition: microrlShell.h:38
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
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
Definition: vl53l1_types.h:78
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98