#ifndef BASE_H #define BASE_H #ifdef __cplusplus extern "C" { #endif // 定义刹车状态机状态 typedef enum { BASE_STOP, BASE_UP, BASE_DOWN, } baseState; typedef struct BaseSystem { uint32_t start_time; Timer base_timer; // 定时器结构体 uint8_t base_command; // 输出基站命令变量:0停止,1上升,2下降 uint8_t base_state; // 基站状态:1表示上升中,2表示下降中,3已上升到固定位置,4已下降固定位置 uint8_t mode; // 遥控模式:0,2手动,1自动 uint8_t Left_switch; // 左侧限位开关 uint8_t right_switch; // 右侧限位开关 uint8_t emergency_stop_switch; // 急停开关,按下急停,上升和下降都急停。 uint8_t remote_emergency_stop; // 远程急停开关,按下急停,上升和下降都急停。 int16_t input_data; // 输入遥感数据,正数,上升,负数下降 } BaseSystem; #define REMOTE_ZERO 1022 #define REMOTE_DEADBAND 50 void baseAppInit(void); #ifdef __cplusplus } #endif #endif // BASE_H