#ifndef __PTZ_ROATE_SERVO_H_
#define __PTZ_ROATE_SERVO_H_

#include "ptz_header_file.h"
#include "ptz_type_select.h"

#ifdef PTZ_MEDIUM_WORM_SERVO_MOTOR_24V

    ///云台水平右转
    #define PTZ_HORI_DIR_RIGHT     3//0
    ///云台水平左转
    #define PTZ_HORI_DIR_LEFT      1
    ///云台处于停止状态
    #define PTZ_HORI_DIR_STOP      2

    ///云台垂直向上
    #define PTZ_VERT_DIR_UP        3//0
    ///云台垂直向下
    #define PTZ_VERT_DIR_DOWN      1
    ///云台处于停止状态
    #define PTZ_VERT_DIR_STOP      2

    ///距离最近刹车点以最小转速运行的距离
    #define PTZ_HORI_BREAK_SPEED_ANGLE  ptz_hori_break_angle()
    #define PTZ_VERT_BREAK_SPEED_ANGLE  ptz_vert_break_angle()

    ///刹车最近距离
    #define PTZ_HORI_STOP_NEAR_DISTANCE    0.01
    ///刹车最远距离
    #define PTZ_HORI_STOP_FAR_DISTANCE     4.0

    ///刹车最近距离
    #define PTZ_VERT_STOP_NEAR_DISTANCE    0.01
    ///刹车最远距离
    #define PTZ_VERT_STOP_FAR_DISTANCE     4.0

    ///云台定位精度，也可用于判断是不是同一个位置
    #define PTZ_HORI_ANGLE_ACCURACY  0.05
    ///云台定位精度，也可用于判断是不是同一个位置
    #define PTZ_VERT_ANGLE_ACCURACY  0.05

float ptz_vert_break_angle();
float ptz_hori_break_angle();

void ptz_sem_post_stop_mutex();
void ptz_hori_start(char direction, float speed);
void ptz_hori_stop(unsigned short int time);
void ptz_vert_start(char direction, float speed);
void ptz_vert_stop(unsigned short int time);

void set_speed_to_servoMotor(uint8_t motorType, float speed);

void init_rotate_monitor_module(void);

#endif

#endif