/*
 * msp_BJ_Auto_IPC.h
 *
 *  Created on: Feb 1, 2024
 *      Author: Administrator
 */

#ifndef INC_MSP_MSP_BJ_AUTO_IPC_H_
#define INC_MSP_MSP_BJ_AUTO_IPC_H_

#include "BSP/bsp_include.h"



typedef struct
 {
	uint8_t Robot_Operation_mode;//0,无操作//1,手动//2,自动//4,故障死机
	uint8_t Robot_Operation_mode_1;//0,无操作//1,手动//2,自动//4,故障死机

	int16_t Weld_status;

	int16_t Start_Detection;
//	int16_t Arrived_Collection;

	int16_t Battery_level;
	int16_t Laser_Rang_Value;

	int16_t Offset_Data[15];//[0] bais_angle_rad/1000; //[1]bais_mm;
	int16_t Offset_angle[2];//[0] bais_angle_rad/1000; //[1]bais_mm;

	int16_t Weld_fault_signal;

	uint8_t Weld_Dete_Res[40];

	uint8_t Weld_Dete_Res_IPC[40];
	uint8_t Weld_Dete_Res_Proto_Buf[40];



	uint8_t IPC_State[100];
	uint8_t Collection_Completed;
	uint8_t IPC_2D_Came_State;
	uint8_t IPC_3D_Came_State;

	uint8_t STM32_Reply_State;


	int16_t Handshake_Counter;
	//01 Ok;02 NG;

	int16_t IPC_Ship_Reply[10];//01OK //02NG
	int16_t IPC_Strat_Dect_Reply[10];//01OK //02NG
	int16_t IPC_Vertical_State_Reply[10];//01OK //02NG
	int16_t IPC_Defult_Reply[10];//01OK //02NG




 }SP_MSP_Controller_IPC_parameters;

uint8_t GF_MSP_BJ_IPC_Init(UART_HandleTypeDef* huart,SP_MSP_Controller_IPC_parameters *_Control_IPC);

void GF_MSP_Cont_T_IPC_Value(int16_t battery_Level,int16_t Robot_Fault, int16_t Robot_Mode, int16_t Start_Detect_Signal, uint8_t Ship_Weld_mARK[],uint8_t *Cont_T_IPC);
void GF_MSP_Cont_T_IPC_Value_1(int16_t battery_Level,int16_t Dis_Sensor_State, int16_t Robot_Opera_Mode, int16_t Start_Detect_Signal, uint8_t Ship_Weld_mARK[]);
void GF_MSP_Cont_T_IPC_Offset();
void GF_MSP_Handshake_Reply_IPC();

#endif /* INC_MSP_MSP_BJ_AUTO_IPC_H_ */
