/****************************************************************************/
/* rhino.h  (c++)                                                           */
/*------------------------------------------------------------------------- */
/* Licencia GPL                                                             */
/* Enumeracion de los comandos de la clase Rhino                            */
/* Clase para la gestion del estado del controlador del Servo Robot XR4     */
/*                             RHINO                                        */
/****************************************************************************/
/* Marco Alvarez Reyna                                                      */
/* CIII UTN-FRC Argentina                                                   */
/* Abril 2008                                                               */
/* mail: marcoalrey@gmail.com                                               */
/****************************************************************************/

#ifndef CMDDEF_H
#define CMDDEF_H

typedef enum SystemsStatusCommands{
    NC = 0,
    SA, //Read motor status
    SC, //Read system configuration
    SD, //Stop/Start delay time
    SE, //Read error stack
    SM, //Read motor mode
    SP, //Read teach pedant error byte
    SR, //Reset motor current limit circuit
    SS, //Read system status
    ST, //Execute diagnostic
    SU, //Read usage time
    SV, //Read versioin and I.D. number
    SX, //Execute diagnostic and return results
    SZ  //Read the delay timer value
}SSCmd;

typedef enum ConfigurationCommands{
    CC=14, //Set coordinate position
    CG, //Enable/Disable gripper mode
    CM, //Set motor mode
    CR  //Set robot type
}CCmd;

typedef enum MotorReadCommands{
    AR=18, //Read system acceleration
    DR, //Read motor PWM level and direction
    GS, //Read gripper status
    HR, //Read soft home position
    PA, //Read actual position
    PW, //Read destination position
    RL, //Read limit switches
    UA, //Read XYZ rotation angle
    UH, //Read XYZ home position
    UO, //Read XYZ offset
    UT, //Read tool length
    UY, //Read height of the Elbow rotation axis
    VA, //Read motor actual velocity
    VR, //Read motor desired velocity
    VX, //Read system velocity
    XR  //Read aux port level and direction
}MRCmd;

typedef enum MotorSetCommands{
    AC=34, //Clear motor actual position
    AS, //Set system aceleration
    DS, //Set motor PWM level and direction
    GC, //Close griper
    GO, //Open gripper
    HA, //Go to the hard home position
    HG, //Go to the soft home position
    HH, //Execute a hard home
    HL, //Hard home on limit switch
    HS, //Set soft home
    MA, //Stop all motors and auxiliary ports
    MC, //Start coordinated move
    MI, //Start all motors, immediate mode
    MM, //Stop single motor
    MS, //Start single motor
    MX, //Start XYZ move
    PD, //Set destination position, ansolute
    PR, //Set destination position, relative
    PX, //Set XYZ destination position, ansolute
    PY, //Set XYZ destination position, relative
    VG, //Set system velocity
    VS, //Set motor velocity
    XA, //Set XYZ rotation angle
    XH, //Set XYZ home position
    XO, //Set XYZ offset
    XS, //Set aux port level and direction
    XT, //Set tool lenghth
    XY, //Set height of the elbow rotation axis
}MSCmd;

typedef enum TeachPedantCommands{
    FR=62, //Receive teach pedant file from host
    FT, //Transmit teach pedant file to host
    FX, //Execute teach pedant program
    TA, //Abort/Terminate teach pedant program
    TC, //Clear teach pedant display
    TD, //Print to teach pedant display
    TE, //Enable/Disable teach pedant to move motors
    TH, //Give control to host
    TX, //Give control to Teach pedant
    TK, //Return to host the next key code
    TL, //Return to host the last key code
    TR, //Reset the teach pedant
    TS, //Set the teach pedant display cursor
    TT  // Execute teach pedant diagnostic and return results
}TPCmd;

typedef enum GainCommands{
    KA=76, //Set proportional gain
    KB, //Set diferential gain
    KC, //Set integral gain
    RA, //Read proportional gain
    RB, //Read diferential gain
    RC, //Read integral gain
    KR, //Restore user gains from EEPROM
    KS, //Store user gains to EEPROM
    KX  //Restore factory gains
}GCmd;

typedef enum InputOutputCommands{
    IB=85, //Read input or switch bit
    IP, //Read input port
    IX, //Read switch port
    OB, //Set output bit
    OP, //Set output port
    OR, //Read output port
    OT, //Toggle output bit
    WA, //Abort all wait
    WI  //Wait on input or switch
}IOCmd;




#endif //CMDDEF_H
