/* * BHBF_ROBOT.h * * Created on: Oct 26, 2023 * Author: shiya */ #ifndef INC_BHBF_ROBOT_H_ #define INC_BHBF_ROBOT_H_ #include "left_right_compensation_control.h" #include "../../BASE/Inc/BSP/bsp_include.h" #include "bsp_PV.pb.h" #include "../../BASE/Inc/MSP/msp_TI5MOTOR.h" #include "../../BASE/Inc/BSP/bsp_UART.h" #include #include #include #include #include "../../BASE/Inc/BSP/BHBF_ROBOT.h" #include "../../BASE/Inc/BSP/bsp_mqtt.h" #include "../../BASE/Inc/BSP/pb.h" #include "../../BASE/Inc/MSP/msp_CMCU.h" #include "../../BASE/Inc/MSP/msp_Dynamometer_Sensor.h" #include "../../BASE/Inc/BSP/pb_decode.h" #include "../../BASE/Inc/BSP/pb_encode.h" #include "../../BASE/Inc/BSP/bsp_EEPROM.h" #include "../../BASE/Inc/BSP/bsp_pb_decode_encode.h" #include "../../BASE/Inc/BSP/bsp_MB_host.h" #include "../../BASE/Inc/MSP/msp_TL720D.h" #include #include #include #include "../../BASE/Inc/BSP/DLT/DLTuc.h" #include "../../BASE/Inc/MSP/msp_U7.h" #include "../../BASE/Inc/BSP/bsp_mqtt.h" #include "../../BASE/Inc/BSP/pb.h" #include "../../BASE/Inc/BSP/pb_decode.h" #include "../../BASE/Inc/BSP/pb_encode.h" #include "../../BASE/Inc/BSP/bsp_EEPROM.h" #include "../../BASE/Inc/BSP/bsp_pb_decode_encode.h" #include "../../BASE/Inc/BSP/bsp_MB_host.h" #include "../../BASE/Inc/BSP/bsp_DLT_Log.h" #include "../../BASE/Inc/BSP/bsp_UDP.h" #include "../../BASE/Inc/BSP/bsp_cpu_flash.h" #include "../../BASE/Inc/BSP/bsp_qspi_w25q128.h" #include "../../BASE/Inc/BSP/bsp_UpperComputer_Handler.h" #include "../../BASE/Inc/MSP/msp_TTMotor_ZQ.h" #include "../../BASE/Inc/BSP/bsp_Error_Detect.h" #include "bsp_IV.pb.h" #include "bsp_PV.pb.h" typedef struct sys_timer_handler { int start_timer; int sys_current_timer_count; int sys_timer_flag; }Sys_timer_handler; extern Sys_timer_handler timer_handler_1; extern Sys_timer_handler timer_handler_2; extern Sys_timer_handler timer_handler_3; extern Sys_timer_handler timer_handler_4; //first start Timer, then WaitTimer extern bool CompareTimer(int32_t DelayMiliSeconds,Sys_timer_handler * timer_handler); extern void SystemTimer_Intialize(); extern void GF_Timer_Count(); #define DLTViewer 1 extern GV_struct_define GV; extern IV_struct_define IV; extern CV_struct_define CV; extern PV_struct_define decoded_PV; extern PV_struct_define _decoded_PV_temp; void GF_Robot_Init(void); void GF_Robot_MainLoop(void); void GF_WatchDog_Loop(void); void CV_GV_Init(); extern void SET_BIT_1(int32_t* num,int32_t k); extern void SET_BIT_0(int32_t* num,int32_t k); extern int32_t Get_BIT(int32_t* num,int32_t k); //A &= ~(1 << bit) extern MotorParameters *Motor[3]; extern int32_t *Motor_ID_Errors[3]; extern int32_t* SystemErrorCode; extern ErrorData* SystemErrorData; typedef enum _Upper_TakeControl_State { Not_Taken_Over = 0, Taken_Over = 1, } Upper_TakeControl_State; typedef enum _Button_Reset_State { Has_Reset = 0, Has_Not_Reset = 1, } Button_Reset_State; typedef enum _HardWare_Disconnected_State { CONNECTED = 0, DISCONNECTED = 1, } HardWare_Disconnected_State; typedef enum _HardWare_ErrorExisted_State { NOT_ErrorExisted = 0, ErrorExisted = 1, } HardWare_ErrorExisted_State; extern TT_MotorParameters* TT_Motor[4]; extern int32_t SystemTimeMiliCount; //2ms加一 #endif /* INC_BHBF_ROBOT_H_ */