feat:提交0_10V温控继电器固件
feat:提交0_10V温控继电器固件
This commit is contained in:
44
Source/SYSTEM/inc/dip_switch.h
Normal file
44
Source/SYSTEM/inc/dip_switch.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#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 addr; //2025-06-23
|
||||
|
||||
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