#ifndef QD_U1OA_XSB_H_
#define QD_U1OA_XSB_H_
#include "c.h"
#include "interface_595.h"


#define dg1 0x08
#define dg2 0x10
#define dg3 0x04
#define dg4 0x20
#define l_red   0x40
#define l_green 0x80
#define l_com   0x02
#define s1      0x01
#define s2      0x80
#define s3      0x40
#define noe     0xff

#define b_i 30  //按钮滤波次数

struct device_panel
{
	//数码管显示，因为只能显示整数，so用uint8就够
	int set_temp;
	int now_temp;
	//按钮滤波
	uint8_t i_s1;
	uint8_t i_s2;
	uint8_t i_s3;
	//按钮实际状态
	uint8_t flag_s1:1;
	uint8_t flag_s2:1;
	uint8_t flag_s3:1;
	uint8_t flag_s1_:1;
	uint8_t flag_s2_:1;
	uint8_t flag_s3_:1;
	uint8_t flag_s1_t:1;
	uint8_t flag_s2_t:1;
	uint8_t flag_s3_t:1;
	//led状态
	uint8_t led_red:1;
	uint8_t led_green:1;
	
};

extern struct device_panel panel;//全局声明，只有这1个面板所以写到全局。

void Sand_Byte_to_595(uint8_t h,uint8_t l);
void panel_scan_server();

#endif