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.

158 lines
3.4 KiB

3 days ago
/*
* msp_T_F4.h
*
* Created on: Jun 18, 2025
* Author: akeguo
*/
#ifndef BASE_INC_MSP_MSP_T_F4_H_
#define BASE_INC_MSP_MSP_T_F4_H_
#include "stdint.h"
#include "../../BASE/Inc/BSP/bsp_UART.h"
extern void T_F4_Remote_Controller_intialize(struct UARTHandler *Handler);
typedef union
{
struct
{
int16_t left_reserved_1 :1; //first byte
int16_t swing_left :1;
int16_t reserved_A :1;
int16_t reserved_B :1;
int16_t reserved_C :1;
int16_t reserved_D :1;
int16_t reserved_1 :1;
int16_t reserved_2 :1; //8 bit
int16_t reserved_3 :1; //first byte
int16_t reserved_4 :1;
int16_t swing_home :1; //机械臂零位
int16_t swing_right :1;
int16_t sand_blast :1;
int16_t polish :1; //打磨
int16_t spray :1;
int16_t reserved_null :1; //8 bit
} type00; // 解释方式A
int16_t rawValue; // 原始字节访问方式 (8位)
} _00Union;
typedef union
{
struct
{
int16_t reserved_open :1; //first byte
int16_t reserved_close :1;
int16_t auto_forward :1;
int16_t auto_backward :1;
int16_t left_lane_change :1;
int16_t right_lane_change :1;
int16_t bit6 :1;
int16_t bit7 :1; //8 bit
int16_t heart_beat :1; //first byte
int16_t bit9 :1;
int16_t bit10 :1;
int16_t bit11 :1;
int16_t bit12 :1;
int16_t bit13 :1;
int16_t bit14 :1;
int16_t emergency_stop :1; //8 bit
} type00; // 解释方式A
int16_t rawValue; // 原始字节访问方式 (8位)
} _01Union;
typedef union
{
struct
{
uint16_t bit0_to_7 :8; //first byte
uint16_t bit8_to_15 :8;
} type00; // 解释方式A
int16_t rawValue; // 原始字节访问方式 (8位)
} _01_Reverse_Union;
typedef struct
{
//byte 0 8-15
uint16_t Work_Horizonal :1; //first byte
uint16_t Work_Vertical :1;
uint16_t ChgLeft_Hor :1;
uint16_t ChgRight_Hor :1;
uint16_t AutoForWard :1;
uint16_t AutoBackWard :1;
uint16_t ChgUp_Ver :1;
uint16_t ChgDown_Ver :1; //8 bit
//byte 0 0-7
uint16_t FA :1; //first byte
uint16_t FB :1;
uint16_t F1 :1;
uint16_t F2 :1;
uint16_t F3 :1;
uint16_t F4 :1;
uint16_t F5 :1;
uint16_t F6 :1; //8 bit
//byte 1 8-15
uint16_t heart_beat :1; //first byte
uint16_t _1_bit9 :1;
uint16_t _1_bit10 :1;
uint16_t _1_bit11 :1;
uint16_t _1_bit12 :1;
uint16_t _1_bit13 :1;
uint16_t _1_bit14 :1;
uint16_t emergency_stop :1; //8 bit
//byte 1 0-7
uint16_t Lift_Up :1; //first byte
uint16_t Lift_Down :1;
uint16_t Spray_On :1;
uint16_t Spray_Off :1;
uint16_t Test_On :1;
uint16_t Test_Off :1;
uint16_t _1_bit6 :1;
uint16_t _1_bit7 :1; //8 bit
//byte 2 8-12
uint16_t Speed_Level_9:1;
uint16_t Speed_Level_10:1;
uint16_t RES_1:1;
uint16_t RES_2:1;
uint16_t RES_3:1;
uint16_t RES_4:1;
uint16_t RES_5:1;
uint16_t RES_6:1;
//byte 2 0-7
uint16_t Speed_Level_1:1;
uint16_t Speed_Level_2:1;
uint16_t Speed_Level_3:1;
uint16_t Speed_Level_4:1;
uint16_t Speed_Level_5:1;
uint16_t Speed_Level_6:1;
uint16_t Speed_Level_7:1;
uint16_t Speed_Level_8:1;
uint16_t robot_left_right_turn_speed :8;
uint16_t robot_forward_backward_speed :8;
uint16_t robot_Compensation_Right :8;
uint16_t robot_Compensation_Left :8;
} T_F4_Value;
extern T_F4_Value Current_T_F4_Value;
typedef struct
{
_00Union _00;
_01Union _01;
_01_Reverse_Union _02;
_01_Reverse_Union _03;
_01_Reverse_Union _04;
_01_Reverse_Union _05;
} T_F4_Value_2;
#endif /* BASE_INC_MSP_MSP_T_F4_H_ */