/*
 * BHBF_ROBOT.h
 *
 *  Created on: Oct 26, 2023
 *      Author: shiya
 */

#ifndef INC_BHBF_ROBOT_H_
#define INC_BHBF_ROBOT_H_

#define DF_GL_MotorNum 2
#define SA_GL_MotorNum 3

#include "BSP/bsp_include.h"

#include "MSP/msp_OBD.h"

#include "MSP/msp_PID.h"
//#include "MSP/msp_LeiSai_Motor.h"
#include "MSP/msp_LeiSaiCan_Motor.h"

#include "MSP/msp_DC_CAN_Paint.h" //DHcan

#include "MSP/msp_DC_CAN.h"

//#include "MSP/msp_DH_W_H.h"//RS485

#include "MSP/msp_TL720D.h"


struct CV_struct_define{
	int32_t Speed_1;
	int32_t Speed_2;
	int32_t Speed_3;
};

struct GV_struct_define
{
	int32_t State_Index_U;
	int32_t State_Index_U_Elapse;
	int32_t State_Index_N;
	int32_t State_Index_N_Elapse;

	int32_t NC_ARRAY_u8_0;//5
	int32_t NC_ARRAY_u8_01;
	int32_t NC_ARRAY_u8_1;
	int32_t NC_ARRAY_u8_11;
	int32_t NC_ARRAY_u8_2;

	SP_MSP_LeiSaiCan_MotorParameters   Motor_LeiSai[2];

	SP_MSP_DH_CAN_Parameters DH_CAN_Paint;

	SP_MSP_RF_TL720D_Parameters  RFTL720_D;

};

struct PV_struct_define{

	int32_t MK32_RxIndex_Last;
	int32_t State_Index_U_Last;
	int32_t State_Index_N_Last;
};


//Global variables related to program execution interfaces
//Interface variables, decision variables
//All types are int32_t
extern struct GV_struct_define GV;

//Process variables related to program execution buffering
//Temporary variables, buffers,intermediate variable
extern struct PV_struct_define PV;

//Configuration variables related to robots
extern struct CV_struct_define CV;

void GF_Robot_Init(void);
void GF_Robot_MainLoop(void);
void GF_WatchDog_Loop(void);

#endif /* INC_BHBF_ROBOT_H_ */
