#ifndef DEVCONTROL_COMMON_H
#define DEVCONTROL_COMMON_H

#include "device_init.h"
#include "car0101_control.h"
#include "car0102_control.h"
#include "car0103_control.h"
#include "car0104_control.h"
#include "ptz0401_control.h"
#include "tank02002_control.h"
#include "common.h"

typedef struct {
    int device_id;              // 设备ID (101, 102等)
    void (*device_abnormal_stop)(void);    // 车停止
    void (*gpio_pin_pulled)(void);
    void (*gpio_pwm_pulled)(void);
    void (*device_close)(void);// 关闭线程池等
} device_abnormal_close_t;

typedef struct {
    int device_id;              // 设备ID (101, 102等)
    void (*device_didrive_control)(unsigned char *valt);    // PWM初始化函数指针
} device_didrive;

#define DEVICE_CAR0101 101
#define DEVICE_CAR0102 102
#define DEVICE_CAR0103 103
#define DEVICE_CAR0104 104
#define DEVICE_TANK0201 201
#define DEVICE_TANK0202 202
#define DEVICE_PAO_PTZ0401 401 

void device_stop(int device_id);

void device_end_close(int device_id);

void device_walk_control(int device_id,unsigned char *valt);

#endif 