Skip to content

An extensible C++ CLI designed for embedded systems.

License

Notifications You must be signed in to change notification settings

o7-machinehum/turnip_cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Turnip CLI

An extensible C++ CLI (Command line interface) designed for embedded systems. This example is built with freertos/libopencm3/stm32f1, however it's straight forward to rip out the CLI part. Please note the assets inside the lib folder are not covered under MIT, they have their own licences.

Creating commands

Each command is a seperate .h/.cpp pair (or just .h), please see inc/hellocmd.h for an example. Each command class should implement...

virtual const char* parse(char* input)

The parse function what gets called when the user enters the command. The class should also inherit from from the Cmd class. Just look at the code you should be able to figure it out.

Registering commands

Commands are dynamically registered like so...

Cmd* menu[] = {
     new HelloCmd("hello", uart1),
     0
};

Running the CLI

Just call present(), it will not return. The first argument is the menu shown above which is built at runtime.

cli.present(menu);

Building

git clone https://github.com/Machine-Hum/turnip_cli
cd turnip_cli
git submodule update --init --recursive
cd lib/libopencm3
make
cd ../..
make
make flash 

About

An extensible C++ CLI designed for embedded systems.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages