#ifndef __DEVICE_PHOTOELECTRICSWITCH_H_
#define __DEVICE_PHOTOELECTRICSWITCH_H_
#include "gd32f4xx.h" 
#include "ptz_type_select.h"

    #define PS_VERT_SW1_READ  gpio_input_bit_get(GPIOE, GPIO_PIN_7)
    #define PS_VERT_SW2_READ  gpio_input_bit_get(GPIOE, GPIO_PIN_8)
    #define PS_HORI_SW3_READ  gpio_input_bit_get(GPIOE, GPIO_PIN_9)

    ///光电开关
    ///光电开关电平高
    #define PS_HIGH 1
    ///光电开关电平低
    #define PS_LOW  0

    #define PS_COVER      0//光电开关被遮蔽
    #define PS_NO_COVER   1//光电开关未被遮蔽


    ///光电开关上升沿打开有效
    #define PS_FALL_ON     1
    ///光电开关上升沿关闭无效
    #define PS_FALL_OFF    0


    ///光电开关编号
    ///光电开关1
    #define PS_VERT_SW1 1
    ///光电开关2
    #define PS_VERT_SW2 2 
    ///光电开关3
    #define PS_HORI_SW3 3


    void ps_init();
    char ps_read(char flag);
    void task_ps_read_init(void);
    
    void init_photoelectric_switch_module();
#endif