核心板上调试端口显示V2630的测试程序 长的新大板
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.

161 lines
2.9 KiB

/*
* BHBF_ROBOT.h
*
* Created on: Oct 26, 2023
* Author: shiya
*/
#ifndef INC_BHBF_ROBOT_H_
#define INC_BHBF_ROBOT_H_
#include "BSP/bsp_include.h"
#include "bsp_PV.pb.h"
#include "BSP/bsp_UART.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include "BHBF_ROBOT.h"
#include "BSP/pb.h"
#include "BSP/pb_decode.h"
#include "BSP/pb_encode.h"
#include "BSP/bsp_EEPROM.h"
#include "bsp_pb_decode_encode.h"
#include "bsp_MB_host.h"
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include "DLTuc.h"
#include "MSP/msp_MK32_1.h"
//#include "MSP/msp_MK32.h"
#include "BSP/pb.h"
#include "BSP/pb_decode.h"
#include "BSP/pb_encode.h"
#include "BSP/bsp_EEPROM.h"
#include "bsp_pb_decode_encode.h"
#include "bsp_MB_host.h"
#include "bsp_include.h"
#include "bsp_DLT_Log.h"
#include "bsp_UDP.h"
#include "BSP/bsp_cpu_flash.h"
#include <bsp_qspi_w25q128.h>
#include <bsp_UpperComputer_Handler.h>
#include "bsp_Error_Detect.h"
#include "bsp_IV.pb.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
bool CompareTimer_Delay(int32_t Delay);
extern GV_struct_define GV;
//extern PV_struct_define PV;
extern IV_struct_define IV;
extern CV_struct_define CV;
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
bool CompareTimer(int32_t DelayMiliSeconds,Sys_timer_handler * timer_handler);
void SystemTimer_Intialize();
void GF_Timer_Count();
void GF_Robot_Init(void);
void GF_Robot_MainLoop(void);
void GF_WatchDog_Loop(void);
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);
extern int32_t *Motor_ID_Errors[7];
extern int32_t* SystemErrorCode;
extern ErrorData* SystemErrorData;
#define IV_Run_Mode_Automation 1
#define IV_Run_Mode_Maunal 0
#define IV_Run_Mode_EmergencyStop 2
#define IV_Run_Mode_Vertical_LaneChange 3
#define IV_Run_Mode_Horizontal_LaneChange 4
#define IV_Run_Mode_Forward 5
#define IV_Run_Mode_BackWard 6
#define IV_Run_Mode_TurnLeft 7
#define IV_Run_Mode_TurnRight 8
#define IV_Run_Mode_HALT 9
#endif /* INC_BHBF_ROBOT_H_ */