#ifndef _BLV_NOR_DEV_LVOUTPUTFUN_
#define _BLV_NOR_DEV_LVOUTPUTFUN_

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

#define  LVoutputNumMAX  32         //强电继电器个数限制
#define  C1_LVOUTPUTNUMMAX         0x14    //C1为20路 

typedef struct{
	uint64_t LVoutputCH01:1;							//1
	uint64_t LVoutputCH02:1;              //2
	uint64_t LVoutputCH03:1;            //3
	uint64_t LVoutputCH04:1  ;           //4
	uint64_t LVoutputCH05:1   ;          //5
	uint64_t LVoutputCH06:1;         //6
	uint64_t LVoutputCH07:1     ;        //7
	uint64_t LVoutputCH08:1       ;       //8
	uint64_t LVoutputCH09:1      ;      //9
	uint64_t LVoutputCH10:1  ;     //10        
	uint64_t LVoutputCH11:1       ;   //11
	uint64_t LVoutputCH12:1        ;   //12
	uint64_t LVoutputCH13:1          ;   //13      
	uint64_t LVoutputCH14:1            ;   //14      
	uint64_t LVoutputCH15:1            ;   //15   
	
	uint64_t LVoutputCH16:1            ;   //16      
	uint64_t LVoutputCH17:1            ;   //17      	
	uint64_t LVoutputCH18:1            ;   //18      
	uint64_t LVoutputCH19:1            ;   //19      	
	uint64_t LVoutputCH20:1            ;   //20      
	uint64_t LVoutputCH21:1            ;   //21      
	uint64_t LVoutputCH22:1            ;   //22      
	uint64_t LVoutputCH23:1            ;   //23      	
	uint64_t LVoutputCH24:1            ;   //24      
	uint64_t LVoutputCH25:1            ;   //25      	
	uint64_t LVoutputCH26:1            ;   //26      
	uint64_t LVoutputCH27:1            ;   //27      	
	uint64_t LVoutputCH28:1            ;   //28      
	uint64_t LVoutputCH29:1            ;   //29      	
	uint64_t LVoutputCH30:1            ;   //30      
	uint64_t LVoutputCH31:1            ;   //31      	
	uint64_t LVoutputCH32:1            ;   //32      
	uint64_t LVoutputCH33:1            ;   //33      	
	uint64_t LVoutputCH34:1            ;   //34      
	uint64_t LVoutputCH35:1            ;   //35      	
	uint64_t LVoutputCH36:1            ;   //36      
	uint64_t LVoutputCH37:1            ;   //37      	
	uint64_t LVoutputCH38:1            ;   //38      
	uint64_t LVoutputCH39:1            ;   //39      	
	uint64_t LVoutputCH40:1            ;   //40      
	uint64_t LVoutputCH41:1            ;   //41      	
	uint64_t LVoutputCH42:1            ;   //42      
	uint64_t LVoutputCH43:1            ;   //43      	
	uint64_t LVoutputCH44:1            ;   //44      
	uint64_t LVoutputCH45:1            ;   //45      	
	uint64_t LVoutputCH46:1            ;   //46      
	uint64_t LVoutputCH47:1            ;   //47      	
	uint64_t LVoutputCH48:1            ;   //48      
	uint64_t LVoutputCH49:1            ;   //49      	
	uint64_t LVoutputCH50:1            ;   //50      
	uint64_t LVoutputCH51:1            ;   //51      
	uint64_t LVoutputCH52:1            ;   //52      	
	uint64_t LVoutputCH53:1            ;   //53      
	uint64_t LVoutputCH54:1            ;   //54      	
	uint64_t LVoutputCH55:1            ;   //55      
	uint64_t LVoutputCH56:1            ;   //56      	
	uint64_t LVoutputCH57:1            ;   //57      
	uint64_t LVoutputCH58:1            ;   //58      	
	uint64_t LVoutputCH59:1            ;   //59      
	uint64_t LVoutputCH60:1            ;   //60      	
	uint64_t LVoutputCH61:1            ;   //61      
	uint64_t LVoutputCH62:1            ;   //62      	
	uint64_t LVoutputCH63:1            ;   //63      
	uint64_t LVoutputCH64:1            ;   //64      	
}__attribute__ ((__packed__))DEV_LVOUTPUTDATA_TYPE;  //强电继电器数据类型

typedef struct 
{
//	DEV_LVOUTPUTDATA_TYPE DevChangeFlag;   //设备变化标志  为1表示有输入 读完标志后，需要清空
	
	uint8_t DevLVoutputState[LVoutputNumMAX];  //当前强电继电器的状态   结合设备状态变化标志，可以判断当前强电继电器是打开还是关闭
	uint8_t DevLVoutputStateLast[LVoutputNumMAX];  //当前强电继电器的上一个状态	
	
	uint8_t LVoutputLoopValidNum;    //强电继电器有效回路数

	uint32_t DevC5IOAddr;        //C5IO的地址
	
	uint8_t init_flag;			//初始化标志位
	
//	Dev_Name_Struct Devname[DEVNAMENUMMAX]; //如果该类设备同时具备输入与输出，那么输入输出别名共用    

	//弱电输出别名 每个回路16个字节别名     //仅支持30个回路别名

}__attribute__ ((__packed__))NOR_LVOUTPUT_INFO;						//强电继电器的结构体参数


void BLV_Nor_Dev_LVoutput_Init(uint8_t devaddr);




#endif



