feat:修改设备类型
feat:修改为红外转发设备,将中弘网关协议转换为主机红外协议
This commit is contained in:
42
Source/SYSTEM/inc/dip_switch.h
Normal file
42
Source/SYSTEM/inc/dip_switch.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef _DIP_SWITCH_H_
|
||||
#define _DIP_SWITCH_H_
|
||||
|
||||
#include "apt32f102.h"
|
||||
#include "apt32f102_gpio.h"
|
||||
|
||||
#define DIP_PRESS 0x00 //按键按下为低
|
||||
#define DIP_LOOSEN 0x01 //按键松开为高
|
||||
#define DIP_DELAY_COUNT 5 //扫描次数
|
||||
#define DIP_SCAN_Time 20 //每次扫描时间
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DIP_CH1,
|
||||
DIP_CH2,
|
||||
DIP_CH3,
|
||||
DIP_CHN_MAX,
|
||||
}DIP_CHN_e;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DIP_VAL_OFF, //松开
|
||||
DIP_VAL_ON, //按下
|
||||
}DIP_VAL_e;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
U8_T delayCnt_ON[DIP_CHN_MAX];
|
||||
U8_T delayCnt_OFF[DIP_CHN_MAX];
|
||||
U8_T DIP_addr; //设备地址
|
||||
|
||||
U32_T DIP_val;
|
||||
U32_T DIP_last_val;
|
||||
}DIP_t;
|
||||
|
||||
extern DIP_t g_Dip;
|
||||
|
||||
void DIP_Switch_Init(void);
|
||||
uint8_t DIP_GetSwitchState(uint8_t i);
|
||||
void DIP_ScanTask(void);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user