SikendeRTOS
RTOS for ARM Cortex M3+ SoCs designed and written from scratch
Interpreter.c File Reference

Runs on TM4C123 UART Command Line Interface. More...

#include "Interpreter.h"
#include "UART0.h"
#include "OS.h"
#include "cpu.h"
Include dependency graph for Interpreter.c:

Go to the source code of this file.

Macros

#define CMD_MENU   0
 
#define CMD_HELP   1
 
#define CMD_ECHO   2
 
#define CMD_MEASURE   3
 
#define CMD_DISPLAY   4
 
#define CMD_LED   5
 
#define CMD_OS   6
 
#define MEASURE_ADC   1
 

Functions

char * readline (char *str)
 
void parseString (char *str, char cmd[MAX_WORDS][MAX_CHARS_PER_WORD])
 
int32_t findCommandType (char cmd[MAX_WORDS][MAX_CHARS_PER_WORD])
 
void executeCommand (int32_t cmdType, char cmd[MAX_WORDS][MAX_CHARS_PER_WORD])
 
void printWelcomeMenu (void)
 
void printGenericMenu (void)
 
void printHelpMenu (void)
 
void commandMeasure (char cmd[MAX_WORDS][MAX_CHARS_PER_WORD])
 
void commandDisplay (char cmd[MAX_WORDS][MAX_CHARS_PER_WORD])
 
void commandOS (char cmd[MAX_WORDS][MAX_CHARS_PER_WORD])
 
void commandLED (char cmd[MAX_WORDS][MAX_CHARS_PER_WORD])
 
void newLine (void)
 
void Interpreter (void)
 

Detailed Description

Runs on TM4C123 UART Command Line Interface.

Author
Sikender Ashraf and Sijin Woo

Definition in file Interpreter.c.

Macro Definition Documentation

◆ CMD_DISPLAY

#define CMD_DISPLAY   4

Definition at line 18 of file Interpreter.c.

◆ CMD_ECHO

#define CMD_ECHO   2

Definition at line 16 of file Interpreter.c.

◆ CMD_HELP

#define CMD_HELP   1

Definition at line 15 of file Interpreter.c.

◆ CMD_LED

#define CMD_LED   5

Definition at line 19 of file Interpreter.c.

◆ CMD_MEASURE

#define CMD_MEASURE   3

Definition at line 17 of file Interpreter.c.

◆ CMD_MENU

#define CMD_MENU   0

Definition at line 14 of file Interpreter.c.

◆ CMD_OS

#define CMD_OS   6

Definition at line 20 of file Interpreter.c.

◆ MEASURE_ADC

#define MEASURE_ADC   1

Definition at line 23 of file Interpreter.c.

Function Documentation

◆ commandDisplay()

void commandDisplay ( char  cmd[MAX_WORDS][MAX_CHARS_PER_WORD])

commandDisplay Displays message onto the ST7735 Format: display -device -line "<string>" @params cmd input by user that has been tokenized

Definition at line 404 of file Interpreter.c.

Here is the caller graph for this function:

◆ commandLED()

void commandLED ( char  cmd[MAX_WORDS][MAX_CHARS_PER_WORD])

commandLED Toggles specified LED Format: display -device -line "<string>" @params cmd input by user that has been tokenized

Definition at line 427 of file Interpreter.c.

Here is the caller graph for this function:

◆ commandMeasure()

void commandMeasure ( char  cmd[MAX_WORDS][MAX_CHARS_PER_WORD])

commandMeasure Gathers data from the module depending on what module the user indicated Format: measure -module -channel -samples -rate @params cmd input by user that has been tokenized

Definition at line 349 of file Interpreter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ commandOS()

void commandOS ( char  cmd[MAX_WORDS][MAX_CHARS_PER_WORD])

commandOS Runs specified OS command Format: display -device -line "<string>" @params cmd input by user that has been tokenized

Definition at line 413 of file Interpreter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ executeCommand()

void executeCommand ( int32_t  cmdType,
char  cmd[MAX_WORDS][MAX_CHARS_PER_WORD] 
)

executeCommand NOTE!!!! Modify this function when adding more commands

Definition at line 184 of file Interpreter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findCommandType()

int32_t findCommandType ( char  cmd[MAX_WORDS][MAX_CHARS_PER_WORD])

findCommandType Determines which type of command the user has typed. The first word should specify what type.

Returns
CMD id. Listed as macros at top of this file.

Definition at line 144 of file Interpreter.c.

Here is the caller graph for this function:

◆ Interpreter()

void Interpreter ( void  )

Interpretert The following function starts Interpreter with UART

Definition at line 51 of file Interpreter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ newLine()

void newLine ( void  )

newLine Create new line on UART interface

Definition at line 43 of file Interpreter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseString()

void parseString ( char *  str,
char  cmd[MAX_WORDS][MAX_CHARS_PER_WORD] 
)

parseString Tokenizes each word

Parameters
stringto tokenize
Returns
double pointer to each word in the whole string

Definition at line 104 of file Interpreter.c.

Here is the caller graph for this function:

◆ printGenericMenu()

void printGenericMenu ( void  )

printGenericMenu This is a condensed list of all the possible commands

Definition at line 248 of file Interpreter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printHelpMenu()

void printHelpMenu ( void  )

printHelpMenu Prints all the details for each command that has been implemented

Definition at line 262 of file Interpreter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ printWelcomeMenu()

void printWelcomeMenu ( void  )

printWelcomeMenu Add graphics here

Definition at line 231 of file Interpreter.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readline()

char * readline ( char *  str)

readline Acts exactly the same as the readline function from readline.h library

Parameters
strto be printed
Returns
string that has been typed by user

Definition at line 71 of file Interpreter.c.

Here is the call graph for this function:
Here is the caller graph for this function: