Code Monkey home page Code Monkey logo

cli's Introduction

Command Line Interface (CLI) for embedded projects (WIP)

I was tired of writing ad hoc CLIs, so I wrote one to rule them all (all of mine that is).

I tried to make it similar to bash. It has a commands history, accessed with and . You can also navigate and edit the command using /, Home/End, and Backspace/Del.

I've tested it with minicom, screen, and PuTTY during development and tried to contemplate their escape sequences for aforementioned keys.

I plan to test it with different MCUs and upload an example project here. For now there is one available for NXP S32K148 using S32DS.

The code per se is in the "cli" folder. The list of commands is at the end of file "cli_cmds.c". In the same file are defined the callbacks functions for the commands.

It is interrupt oriented (therefore CliSendString is non blocking), relying on the "Rx buffer full" and "Rx buffer empty" (for each character) interrupts of the UART peripheral. For this, just call CliRxISR and CliTxISR where appropriate.

The structure tCli needs to be passed functions for enabling and disabling the Tx interrupts to function pointers EnableUartInt and DisableUartInt, respectively. It also needs the address of the Rx and Tx char buffers to be assigned to rx_reg_addr and tx_reg_addr, respectively.

cli's People

Contributors

avatarbecker avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.