E:/Ablage_Gerhard/10_Hobby/Elektronik/30_Atmel/20_Prog/AVR_CMD_INTERFACE/cmd_interface.h File Reference

Header-File for cmd_interface.c. More...

#include <avr\io.h>
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  cmd_interface_command_table_t

Defines

#define _cmd_interface_max_length   80
#define _cmd_interface_max_operand_length   12
#define _cmd_interface_max_no_operands   5
#define _cmd_interface_no_of_commands   5
#define _cmd_interface_operand_split_sign   _ASCII_COMMA
#define _cmd_interface_command_split_sign   _ASCII_SPACE
#define _cmd_interface_EOL   _ASCII_CR
#define _ASCII_BEL   0x07
#define _ASCII_BS   0x08
#define _ASCII_CR   0x0D
#define _ASCII_LF   0x0A
#define _ASCII_ESC   0x1B
#define _ASCII_DEL   0x7F
#define _ASCII_SPACE   0x20
#define _ASCII_COMMA   0x2C
#define _CMD_INTERFACE_ERR_MASK   0xF8
#define _CMD_INTERFACE_ERR_OP_CHAR   0x84
#define _CMD_INTERFACE_ERR_OP_2_MANY   0x90
#define _CMD_INTERFACE_ERR_NO_CMD   0xA0
#define _CMD_INTERFACE_ERR_CMD_LINE   0xB0

Functions

int8_t execute_cmd_interface (char *string)
 routine called to execute command interface
void cmd_interface_init ()
 initialisation routine for command interface variables

Variables

volatile
cmd_interface_command_table_t 
cmd_interface_table [_cmd_interface_no_of_commands]

Detailed Description

Header-File for cmd_interface.c.

Simple implementation of an command-interface Target/Compiler: AVR_MEGA / GCC(WinAVR)

Author:
Gerhard Bruenner
Version:
V2.00
Date:
2009.10.31 - changed the way how commandline is interpret - GB
2009.10.21 - small updates - GB
2009.02.01 - Created - GB
Bug:
none that I am aware so far

\


Function Documentation

void cmd_interface_init (  ) 

initialisation routine for command interface variables

Parameters:
none 
Returns:
void
int8_t execute_cmd_interface ( char *  string  ) 

routine called to execute command interface

Parameters:
*string - to attach at the actual command_line buffer
Returns:
The content of the return-value have been split into two parts
The three lowest bits are used as counter for executed commands
The remaining "upper" bits represent bit-coded errors,
due to the possibilitiy of multiple errors per call.
<0 - error occured
#1000 1XXX - #84 - operands have to many characters
#1001 0XXX - #90 - too many operands in the command-line
#1010 0XXX - A0 - no valid command found
#1100 0XXX - B0 - too many signs in comand-line
0 - no end of command-line detects
0> - number of commands which have been executed

This routine has to be called to execute the command-interface It attaches the forwarded string to the internal command-line buffer and its sub-functions interprets the line before it executes the corresponding command-function given by the user


Generated on Wed Nov 11 21:04:06 2009 for AVR_CMD_INTERFACE by  doxygen 1.6.1