#ifndef _BLV_NOR_DEV_CARBONFUN_
#define _BLV_NOR_DEV_CARBONFUN_


#include "stdint.h"
#include "BLV_All_Dev_Init.h"




#define TEMP_LIST_MAX       15

typedef struct
{
	uint8_t Addr:4;
	uint8_t Temp:4;
	uint8_t SetTemp;
	
}__attribute__ ((__packed__))TEMPDEV_INF;


typedef struct 
{
	uint8_t CarbonLoopValidNum;
	
	uint8_t EnergySaved;
	uint8_t EnergySaved_Last;
	
	uint8_t DimValue;
	uint8_t Percentage;
	uint8_t PercentageLast;
	uint8_t DimValue_Flag;
	
	TEMPDEV_INF TempInf[TEMP_LIST_MAX];
	TEMPDEV_INF TempInfLast[TEMP_LIST_MAX];
	uint8_t TempInfFlag[TEMP_LIST_MAX];

	uint8_t DevAction;
	uint8_t CloseSource;      //碳达人退出来源标记 

}__attribute__ ((__packed__))NOR_CARBON_INFO;					


void BLV_Nor_Dev_Carbon_Init(uint8_t devaddr);
void BLV_Nor_Dev_Carbon_For_Logic_Init(LOGICFILE_DEVICE_INFO *dev_info,uint8_t *data,uint16_t data_len);

uint16_t Carbon_Loop_State(uint32_t devaddr, uint16_t DevOutputLoop);

#endif



