![](/media/cache/profiles/0f0ee3310223fe38a989b2c818709393.50x50_q85.jpg)
Command all jmCLIG modules from serial port
Diff: jmCommands.c
- Revision:
- 0:9112e09912db
diff -r 000000000000 -r 9112e09912db jmCommands.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jmCommands.c Sat Feb 12 16:50:25 2011 +0000 @@ -0,0 +1,153 @@ +/** @file jmCommands.c + * Auto Generated by jmCLIG + * Saturday, February 12, 2011 11:21 AM + * @version 2011.01.05 + */ + +#include "main.h" +#include "jmCommands.h" +#include "jmMessages.h" +#include "jmRingBuffer.h" +#include "jmLPC17xx_gpio.h" +#include "jmMotor.h" +#include "jmPulse.h" +#include "jmStepper.h" +#include "jmStepperAxis.h" +#include "jmSwitch.h" + +const char jmCLIG[] = {"\njmCLIG Version 2011.01.05 \nInstance Saturday, February 12, 2011 11:21 AM\n"}; + +// Command Name Table +const char cmdNames[]= + { + 'i','p','o','r','t',0, + 'i','p','o','r','t','s',0, + 'G','P','P','G','0',0, + 'g','p','i','o','B','i','t','s',0, + 'g','p','i','o','B','i','t',0, + 'b','i','t','R','e','a','d',0, + 'l','i','s','t',0, + 'v','e','r',0, + 'h','e','l','p',0, + 'f','e','e','d','b','a','c','k',0, + 'e','c','h','o',0, + 'm','o','t','o','r',0, + 'G','P','P','M','T',0, + 'm','o','t','o','r','S','p','e','e','d',0, + 'p','u','l','s','e',0, + 'p','u','l','s','e','I','n','i','t',0, + 'p','u','l','s','e','S','t','o','p',0, + 'G','P','P','P','0',0, + 's','t','e','p','p','e','r',0, + 's','t','e','p','p','e','r','S','t','o','p',0, + 'G','P','P','S','T',0, + 's','t','e','p','S','p','e','e','d',0, + 's','t','e','p','p','e','r','A','x','i','s',0, + 'G','P','P','S','T','A',0, + 's','w','R','e','a','d',0, + 's','w','I','n','i','t',0, + 'G','P','P','S','0',0, + 'i','n','i','t',0, + 0 + }; + +// Section Definitions +#define iport 0 +#define iports 1 +#define GPPG0 2 +#define gpioBits 3 +#define gpioBit 4 +#define bitRead 5 +#define list 6 +#define ver 7 +#define help 8 +#define feedback 9 +#define echo 10 +#define motor 11 +#define GPPMT 12 +#define motorSpeed 13 +#define pulse 14 +#define pulseInit 15 +#define pulseStop 16 +#define GPPP0 17 +#define stepper 18 +#define stepperStop 19 +#define GPPST 20 +#define stepSpeed 21 +#define stepperAxis 22 +#define GPPSTA 23 +#define swRead 24 +#define swInit 25 +#define GPPS0 26 +#define init 27 + + +/*********************************************************************** + * @brief Command steering + * Command Associated with Command Number is Executed + * @param[in] cmdNum Command Number + * @return none + **********************************************************************/ +void Action(int cmdNum){ + switch(cmdNum){ + case iport : cli_PortInfo(); + break; + case iports : PortsInfo(); + break; + case GPPG0 : cli_GPPG0(); + break; + case gpioBits : cli_gpioBits(); + break; + case gpioBit : cli_gpioBit(); + break; + case bitRead : cli_BitRead(); + break; + case list : cli_list(); + break; + case ver : cli_version(); + break; + case help : cli_help(); + break; + case feedback : cli_feedback(); + break; + case echo : cli_echo(); + break; + case motor : cli_Motor(); + break; + case GPPMT : cli_GPPMT(); + break; + case motorSpeed : cli_MotorSpeed(); + break; + case pulse : cli_Pulse(); + break; + case pulseInit : PulseInit(); + break; + case pulseStop : cli_PulseStop(); + break; + case GPPP0 : cli_GPPP0(); + break; + case stepper : cli_Stepper(); + break; + case stepperStop : cli_StepperStop(); + break; + case GPPST : cli_GPPST(); + break; + case stepSpeed : cli_StepSpeed(); + break; + case stepperAxis : cli_StepperAxis(); + break; + case GPPSTA : cli_GPPSTA(); + break; + case swRead : cli_SwitchRead(); + break; + case swInit : cli_SwitchInit(); + break; + case GPPS0 : cli_GPPS0(); + break; + case init : Inits(); + break; + default : UnknownCommand(); + NextCommand(nl,pLine); + } +} +