#ifndef TM_DEFINES_H
#define TM_DEFINES_H

#define g 9.8
#define Pi 3.1315

/* Put your global defines for all libraries here used in your project */
typedef struct{
	int32_t posEncoder_PPR;
	int32_t previous_posEncoder_PPR;
	int32_t offset;
	int32_t offset_index1e; // elemento
	int32_t offset_index2e; // elemento
	int32_t offset_index1m; // motor
	int32_t offset_index2m; // motor
	float posEncoder_rad;
	float previous_posEncoder_rad;
	float velEncoder_rad;
	float previous_velEncoder_rad;		
}encoder;

extern volatile encoder encoder1, encoder2, encoder3, encoder4;

typedef struct{
	int8_t DOF;
	float L1;
	float d1;
	float m1;
	float L2;
	float d2;
	float m2;
	float mr2;
	float K;
}robot;

typedef struct{
	float *position;
	float *velocity;
	float *aceleration;
	float *jerk;
	float *der_jerk;	
	float *time;
	int size;
}trapezoidal;

typedef struct{
	uint8_t state;
	uint8_t B0;
	uint8_t B1;
	uint8_t B2;
	uint8_t B3;
	uint8_t Index1e;
	uint8_t Index1m;
	uint8_t Index2e;
	uint8_t Index2m;
}homing_t;


/*typedef struct{
	float PD_action[2];
	float K_p[2];
	float K_d[2];
	float pos_error[2];
	float previous_pos_error[2];
	float P_action[2];
	float D_action[2];
}PDG_struct;*/

#endif
