#ifndef TYPE_DEF
  #define TYPE_DEF

typedef char		    I8;  
typedef unsigned char   U8;
typedef short           I16;
typedef unsigned short  U16;
typedef long            I32;
typedef unsigned long   U32;
typedef float           F32;
typedef double          F64;


typedef struct 
{
	I32 tick;
	I32 data[4]; //Total channel = 4
} STR_SAMP_DATA_4CH;

typedef struct
{
	I16 i16_accType;	//Axis parameter
	I16 i16_decType;	//Axis parameter
	I32 i32_acc;		//Axis parameter
	I32 i32_dec;		//Axis parameter
	I32 i32_initSpeed;	//Axis parameter
	I32 i32_maxSpeed;	//Axis parameter
	I32 i32_endSpeed; 	//Axis parameter
} MOVE_PARA; //Speed pattern

typedef struct 
{
	I32 i32_pos;		// Position data (relative or absolute) (pulse)
	I16 i16_accType;	// Acceleration pattern 0: T-curve,  1: S-curve
	I16 i16_decType;	// Deceleration pattern 0: T-curve,  1: S-curve
	I32 i32_acc;		// Acceleration rate ( pulse / ss )
	I32 i32_dec;		// Deceleration rate ( pulse / ss )
	I32 i32_initSpeed;	// Start velocity	( pulse / s )
	I32 i32_maxSpeed;	// Maximum velocity  ( pulse / s )
	I32 i32_endSpeed; 	// End velocity		( pulse / s )
	I32 i32_angle;		// Arc move angle    ( degree, -360 ~ 360 )
	U32 u32_dwell;		// Dwell times       ( unit: ms )
	I32 i32_opt;    	// Option //0xABCD , D:0 absolute, 1:relative
} POINT_DATA;

typedef struct 
{
	I32 i32_pos[16];	// Position data (relative or absolute) (pulse)
	I32 i32_initSpeed;	// Start velocity	( pulse / s ) 
	I32 i32_maxSpeed;	// Maximum velocity  ( pulse / s ) 
	I32 i32_angle;		// Arc move angle    ( degree, -360 ~ 360 ) 
	U32 u32_dwell;		// Dwell times       ( unit: ms ) 
	I32 i32_opt;    	// Option //0xABCD , D:0 absolute, 1:relative

} POINT_DATA2;

typedef struct
{
	I32 i32_pos[4];
	I32 i32_maxSpeed;
	I32 i32_endPos[2];
	I32 i32_dir;
	I32 i32_opt;
}POINT_DATA3;

typedef struct
{
	I16 i16_jogMode;	// Jog mode. 0:Free running mode, 1:Step mode
	I16 i16_dir;		// Jog direction. 0:positive, 1:negative direction
	I16 i16_accType;	// Acceleration pattern 0: T-curve,  1: S-curve
	I32 i32_acc;		// Acceleration rate ( pulse / ss )
	I32 i32_dec;		// Deceleration rate ( pulse / ss )
	I32 i32_maxSpeed;	// Positive value, maximum velocity  ( pulse / s )
	I32 i32_offset;		// Positive value, a step (pulse)
	I32 i32_delayTime;  // Delay time, ( range: 0 ~ 65535 millisecond, align by cycle time)
} JOG_DATA;

typedef struct
{
	U8 u8_homeMode;
	U8 u8_homeDir;
	U8 u8_curveType;

	I32 i32_orgOffset;
	I32 i32_acceleration;
	I32 i32_startVelocity;
	I32 i32_maxVelocity;
	I32 i32_OrgVelocity;
} HOME_PARA;

typedef struct _POS_DATA_2D
{
    U32 u32_opt;        // option, [0x00000000,0xFFFFFFFF]
    I32 i32_x;          // x-axis component (pulse), [-2147483648,2147484647]
    I32 i32_y;          // y-axis component (pulse), [-2147483648,2147484647]
    I32 i32_theta;      // x-y plane arc move angle (0.001 degree), [-360000,360000]
}
POS_DATA_2D, *PPOS_DATA_2D;

typedef struct _PNT_DATA_2D
{
    U32 u32_opt;        // option, [0x00000000,0xFFFFFFFF]
    I32 i32_x;          // x-axis component (pulse), [-2147483648,2147484647]
    I32 i32_y;          // y-axis component (pulse), [-2147483648,2147484647]
    I32 i32_theta;      // x-y plane arc move angle (0.001 degree), [-360000,360000]
    I32 i32_acc;        // acceleration rate (pulse/ss), [0,2147484647]
    I32 i32_dec;        // deceleration rate (pulse/ss), [0,2147484647]
    I32 i32_vi;         // initial velocity (pulse/s), [0,2147484647]
    I32 i32_vm;         // maximum velocity (pulse/s), [0,2147484647]
    I32 i32_ve;         // ending velocity (pulse/s), [0,2147484647]
}
PNT_DATA_2D, *PPNT_DATA_2D;

// Point table structure (Four dimension)
typedef struct _PNT_DATA_4DL
{
    U32 u32_opt;        // option, [0x00000000,0xFFFFFFFF]
    I32 i32_x;          // x-axis component (pulse), [-2147483648,2147484647]
    I32 i32_y;          // y-axis component (pulse), [-2147483648,2147484647]
    I32 i32_z;          // z-axis component (pulse), [-2147483648,2147484647]
    I32 i32_u;          // u-axis component (pulse), [-2147483648,2147484647]
    I32 i32_acc;        // acceleration rate (pulse/ss), [0,2147484647]
    I32 i32_dec;        // deceleration rate (pulse/ss), [0,2147484647]
    I32 i32_vi;         // initial velocity (pulse/s), [0,2147484647]
    I32 i32_vm;         // maximum velocity (pulse/s), [0,2147484647]
    I32 i32_ve;         // ending velocity (pulse/s), [0,2147484647]
}
PNT_DATA_4DL, *PPNT_DATA_4DL;


// Point table structure (One dimension)
typedef struct _PNT_DATA
{
    U32 u32_opt;        // option, [0x00000000,0xFFFFFFFF]
    I32 i32_x;          // x-axis component (pulse), [-2147483648,2147484647]
    I32 i32_theta;      // x-y plane arc move angle (0.001 degree), [-360000,360000]
    I32 i32_acc;        // acceleration rate (pulse/ss), [0,2147484647]
    I32 i32_dec;        // deceleration rate (pulse/ss), [0,2147484647]
    I32 i32_vi;         // initial velocity (pulse/s), [0,2147484647]
    I32 i32_vm;         // maximum velocity (pulse/s), [0,2147484647]
    I32 i32_ve;         // ending velocity (pulse/s), [0,2147484647]
}
PNT_DATA, *PPNT_DATA;

#endif
