// © RiceMotion ( Robert Carl Rice ) 2012-2016 - All rights reserved


// This software makes use of tools and libraries obtained from open source projects or released for

// use by relevant hardware manufactures. However, this software is NOT a part of any open source project.

// It is released only on a "need to know" basis for beta testers of the "RiceCNC Interpolation Engine".

// Recipents of this source code must respect the confidential nature of this software and prevent any

// distribution that could result in counterfeit copies of the "RiceCNC Interpolation Engine".


// © RiceMotion ( Robert Carl Rice ) 2012-2016 - All rights reserved

#ifndef MainCommands_h

#define MainCommands_h


#include "Energia.h"


#if defined( PART_TM4C1294NCPDT )  // Connected LaunchPad

     #include <MyEEProm.h>

#endif



#define     INTERPOLATOR_NAME           'I'

#define          RESET_COMMAND              'R'

#define          CONFIGURE_INTERPOLATOR   'i'

#define          CREATE_MACHINE                'm'

#define          CONFIGURE_SSI                's'

#define               SSI_TYPE_ST                    'S'

#define               SSI_TYPE_8711               'T'

#define               SSI_TYPE_8305               'B'

#define          GET_VERSION                     'v'

#define          WATCHDOG                 'w'

#define          SET_ETHERNET_ADDRESSES   'e'


#if defined( PART_TM4C1294NCPDT )  // Connected LaunchPad

  #define firmware_version        61


#elif defined( PART_LM4F120H5QR )  // LaunchPad

  #define firmware_version        61


#endif


class MainCommands {

public:

     static uint32_t          interpolationInterruptRate;

     static uint32_t          hostTimeout;

     static uint32_t          hardwareOvesampling;

    static uint32_t          periodicReportingInterval;     // micro-seconds


     static float      stopFactor;

     static float      targetLead;


#if defined( PART_TM4C1294NCPDT )  // Connected LaunchPad

     static void

          softwareReset( MyEEProm::SoftResetReason softResetReason );

#else

     static void

          softwareReset();

#endif


     static void

          configureInterpolator(

               char*     data,

               String* msgPtr );


     static void

          configureSSI(

               char*     data,

               String* msgPtr );


     static void

          createMachine(

               char*     data,

               String* msgPtr );


     static void

          deleteMachine(

               char*     data,

               String* msgPtr );


     static void

          signOnMsg(

               String* msg );


     static void

          processCommand(

               char*     commandPtr,

               String* msgPtr );


     static void

          processInterpolatorCommand(

               char*     iCommandPtr,

               String* msgPtr );

};


#endif