You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
173 lines
3.8 KiB
173 lines
3.8 KiB
1 week ago
|
/*
|
||
|
* BHBF_ROBOT.h
|
||
|
*
|
||
|
* Created on: Oct 26, 2023
|
||
|
* Author: shiya
|
||
|
*/
|
||
|
|
||
|
#ifndef INC_BHBF_ROBOT_H_
|
||
|
#define INC_BHBF_ROBOT_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 <stdio.h>
|
||
|
#include <string.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <assert.h>
|
||
|
|
||
|
#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_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_CMCU.h"
|
||
|
#include "../../BASE/Inc/MSP/msp_T_F4.h"
|
||
|
#include "../../BASE/Inc/MSP/msp_PaintThickness.h"
|
||
|
#include "../../BASE/Inc/MSP/msp_Ultrasonic_Sensor.h"
|
||
|
|
||
|
|
||
|
#include "../../BASE/Inc/MSP/msp_TL720D.h"
|
||
|
#include <stdio.h>
|
||
|
#include <stdbool.h>
|
||
|
#include <stdlib.h>
|
||
|
#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"
|
||
|
//#include "msp_pressure_sensor.h"
|
||
|
//#include "robot_state.h"
|
||
|
//FLASH (rx) : ORIGIN = 0x08020000, LENGTH = 896K
|
||
|
//#define VECT_TAB_OFFSET 0x00020000U
|
||
|
|
||
|
//关键全局变量定义:GV、CV、PV
|
||
|
//其他变量定义:X1_X2_X3_X4
|
||
|
//X1:变量类型
|
||
|
//X2:所属层级 GL、MSP、BSP
|
||
|
//X3:所属模块
|
||
|
//X4:名称
|
||
|
|
||
|
//全局变量定义 X1=V
|
||
|
//宏定义 X1=DF
|
||
|
//结构体类型声明 X1=SP
|
||
|
//结构体定义 X1=ST
|
||
|
//指针类型定义 X1=P
|
||
|
//全局函数定义 X1=GF
|
||
|
//内部函数定义 X1为空,不要下划线,X2开头
|
||
|
//函数参数定义、函数局部变量定义 X1为空,下划线开头
|
||
|
|
||
|
|
||
|
#define DLTViewer 1
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
extern GV_struct_define GV;
|
||
|
//extern PV_struct_define PV;
|
||
|
extern IV_struct_define IV;
|
||
|
extern CV_struct_define CV;
|
||
|
|
||
|
|
||
|
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;
|
||
|
//Error Bit Define
|
||
|
|
||
|
#define AngleEncoderErrorBitFlag 0
|
||
|
#define DAM_Relay_ErrorBitFlag 1
|
||
|
#define DH_CAN_Remote_Controller_1E4 2
|
||
|
#define DH_CAN_Remote_Controller_2E4 3
|
||
|
#define DH_Remote 4
|
||
|
#define force_sensor 5
|
||
|
#define LeiSai_ISV2CAN 6
|
||
|
#define mk32_sbus 7
|
||
|
#define steering_engine 8
|
||
|
#define Weld_seam_Tracking 9
|
||
|
|
||
|
#define Ti5_1 11
|
||
|
#define Ti5_2 12
|
||
|
#define Ti5_3 13
|
||
|
#define Ti5_4 14
|
||
|
#define Ti5_5 15
|
||
|
#define Ti5_6 16
|
||
|
|
||
|
#define TL720D 17
|
||
|
|
||
|
|
||
|
#define ZQ_CAN_ID1_LeftMotor 18
|
||
|
#define ZQ_CAN_ID2_RightMotor 19
|
||
|
#define ZQ_CAN_ID3_SwingMotor 20
|
||
|
#define wire_sensor 21
|
||
|
|
||
|
#define DHRougheningController 22
|
||
|
#define DAM040D_Relay_ErrorBitFlag 23
|
||
|
|
||
|
#define DMAKE_1 24
|
||
|
#define DMAKE_2 25
|
||
|
#define DMAKE_3 26
|
||
|
#define pressure_sensor 27
|
||
|
#define u7_sbus 28
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
extern TT_MotorParameters* TT_Motor[4];
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
#endif /* INC_BHBF_ROBOT_H_ */
|