#ifndef PTZ_DRIVER_H__
#define PTZ_DRIVER_H__

#include "common.h"

typedef struct {
    int device_id;
    /* 普通：速度（pan 一行、tilt 一行） */
    float pan_max_speed;
    float pan_accel;
    float tilt_max_speed;
    float tilt_accel;
    /* 轮盘：速度（pan 一行、tilt 一行） */
    float joy_pan_max_speed;
    float joy_pan_accel;
    float joy_tilt_max_speed;
    float joy_tilt_accel;
    /* pan / tilt：初始角与行程（各一行） */
    float pan_initial;
    float pan_min;
    float pan_max;
    float tilt_initial;
    float tilt_min;
    float tilt_max;
} ptz_config_t;

void ptz_driver_pwm_hz(void);
void ptz_driver_init(void);
void ptz_driver_stop(void);
void ptz_driver_change(int *buf);
void ptz_driver_set_joystick(float x, float y, float r);
void ptz_driver_set_joystick_json(cJSON *joystick_ctrl);
void ptz_driver_task_function(void *arg);

#endif
