#ifndef PACKAGE
#define PACKAGE

#define BALSAM

#define DIODES
#define NEWPULT


#define NEWBKSS
#define ONBOARDCALIBER

#define TERMOPAIR	14
#define CURRENTOS	(TERMOPAIR*2)
#define DATASTART	24

//-----------------------------------------------
#ifdef	BALSAM
#define adr_TRN1	1
#define adr_TRN2	2
#define adr_POW1	3
#define adr_POW2	4
#define adr_LOA1	5
#define adr_LOA2	6
#define adr_ENG1	7
#define adr_PLT3	8
#define adr_SHKF	9
//-------------------
#define adr_REC1	0xff
#define adr_REC2	0xff
#define adr_INV1	0xff
#define adr_INV2	0xff
#define adr_BRK1	0xff
#define adr_BRK2	0xff
#define adr_ENG2	0xff
#define adr_PLT1	0xff
#define adr_PLT2	0xff
#define adr_DSTR	0xff
#endif
//-----------------------------------------------
#define dsk_COMM	1
#define dsk_BKSD	2
#define dsk_BKST	3
#define dsk_PULT	4
#define dsk_EPLT	5
#define dsk_SHKF	6
#define dsk_LOAD	7
#define dsk_DSTR	8
//-----------------------------------------------


//-----------------------------------------------
#define	TPL_TRN 10
#define	TPL_POW 8
#define	TPL_BRK 12
#define	TPL_ENG 8
//-----------------------------------------------

#define start_sens_error	0
#define start_sens_hi_edge	48
#define start_sens_lo_edge	72

#define InputRep0	Modbus[0].bit.bitA
#define InputRep1	Modbus[0].bit.bitB
#define InputRep2	Modbus[0].bit.bitC

#define Inputs	Modbus[0x10]

#define bTestLamp	KeyPressed.bit.bit00
#define bSecretBt	KeyPressed.bit.bit01
#define bTermoCal	KeyPressed.bit.bit02
#define bDoor_One	KeyPressed.bit.bit03
#define bDoor_Two	KeyPressed.bit.bit04

#define	Cancount	(modbus+0x60)	//	пауза между I посылками CAN
#define	Bright		(modbus+0x62)	//	аркость сигнальных лампочек
#define	Brightness	 modbus[0x62]	//	аркость сигнальных лампочек

#define m_FAST 0
#define m_SLOW 1

#define Zero_lev	(modbus+0x70)

#define DAC_max()	modbus[0x78]	//	751//0x0000  804
#define DAC_min()	modbus[0x79]	//	2162//0x0FFF 2373
#define DAC_cal()	modbus[0x7A]

#define	Caliber	(modbus+0x78)	//	пауза между I посылками CAN

#define K300_1	Caliber[0]
#define K300_2	Caliber[1]
#define K400_1	Caliber[2]
#define K400_2	Caliber[3]

#define K100_D	Caliber[0]
#define K150_D	Caliber[1]

#define K100_1	Caliber[0]
#define K100_2	Caliber[1]
#define K150_1	Caliber[2]
#define K150_2	Caliber[3]

#define K380_1	Caliber[4]
#define K380_2	Caliber[5]

#define LastMode	Modbus[126].all

#define Commands	Modbus[127].all
#define cTestLamp	Modbus[127].bit.bit0
#define cDefParam	Modbus[127].bit.bit1
#define cSaveParam	Modbus[127].bit.bit2
#define cLoadParam	Modbus[127].bit.bit3

#define cTermoCal	Modbus[127].bit.bit4
#define cKoefCalc	Modbus[127].bit.bit5

#define cUMPreset	Modbus[127].bit.bit6
#define cUMPstart	Modbus[127].bit.bit7
#define cInitDac	Modbus[127].bit.bit8
#define cCalibrDac	Modbus[127].bit.bit9

#define cSecretBt	Modbus[127].bit.bitA

/*
#define cUMPstart	Modbus[127].bit.bit8
#define cUMPreset	Modbus[127].bit.bit9
#define cInitDac	Modbus[127].bit.bitA
#define cCalibrDac	Modbus[127].bit.bitB
*/
#define cReset		Modbus[127].bit.bitF

#endif	//PACKAGE

