40 lines
946 B
C
40 lines
946 B
C
|
#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(GPIOB, GPIO_PIN_0)
|
|||
|
#define PS_VERT_SW2_READ gpio_input_bit_get(GPIOB, GPIO_PIN_1)
|
|||
|
#define PS_HORI_SW3_READ gpio_input_bit_get(GPIOB, GPIO_PIN_2)
|
|||
|
|
|||
|
///<2F><><EFBFBD>翪<EFBFBD><E7BFAA>
|
|||
|
///<2F><><EFBFBD>翪<EFBFBD>ص<EFBFBD>ƽ<EFBFBD><C6BD>
|
|||
|
#define PS_HIGH 1
|
|||
|
///<2F><><EFBFBD>翪<EFBFBD>ص<EFBFBD>ƽ<EFBFBD><C6BD>
|
|||
|
#define PS_LOW 0
|
|||
|
|
|||
|
#define PS_COVER 0//<2F><><EFBFBD>翪<EFBFBD>ر<EFBFBD><D8B1>ڱ<EFBFBD>
|
|||
|
#define PS_NO_COVER 1//<2F><><EFBFBD>翪<EFBFBD><E7BFAA>δ<EFBFBD><CEB4><EFBFBD>ڱ<EFBFBD>
|
|||
|
|
|||
|
|
|||
|
///<2F><><EFBFBD>翪<EFBFBD><E7BFAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD><EFBFBD>Ч
|
|||
|
#define PS_FALL_ON 1
|
|||
|
///<2F><><EFBFBD>翪<EFBFBD><E7BFAA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>عر<D8B9><D8B1><EFBFBD>Ч
|
|||
|
#define PS_FALL_OFF 0
|
|||
|
|
|||
|
|
|||
|
///<2F><><EFBFBD>翪<EFBFBD>ر<EFBFBD><D8B1><EFBFBD>
|
|||
|
///<2F><><EFBFBD>翪<EFBFBD><E7BFAA>1
|
|||
|
#define PS_VERT_SW1 1
|
|||
|
///<2F><><EFBFBD>翪<EFBFBD><E7BFAA>2
|
|||
|
#define PS_VERT_SW2 2
|
|||
|
///<2F><><EFBFBD>翪<EFBFBD><E7BFAA>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
|