UART_FRAME_LENGTH = 5 # velkost ramca
UART_ACK_LENGTH = 1
UART_INDEX_ID = 0
UART_ACK = 0x55

IRQ_KOMPENZACNE_3V3 = (6.43 / 60.0)
IRQ_KOMPENZACNE_5V0 = 10/60.0

# uin kompenzacia strat pasivneho filtra
UIN_KOMPENZACNE = 1.04545

#Ipeak
#DEF_IPEAK = 0.0998
DEF_IPEAK = 0.249

#QLSB
IP_250_QLSB = 7.031
IP_100_QLSB = 2.812


# pre Ipeak = 100mA
#UCINNOST_KOMP_1V8 = 0.7887
#UCINNOST_KOMP_2V5 = 0.8250
#UCINNOST_KOMP_2V8 = 0.8321
#UCINNOST_KOMP_3V0 = 0.8390
#UCINNOST_KOMP_3V3 = 0.8406
#UCINNOST_KOMP_3V6 = 0.855
#UCINNOST_KOMP_4V5 = 0.8425
#UCINNOST_KOMP_5V0 = 0.8580

# pre Ipeak = 250mA
UCINNOST_KOMP_1V8 = 0.6719
UCINNOST_KOMP_2V5 = 0.7530
UCINNOST_KOMP_2V8 = 0.7594
UCINNOST_KOMP_3V0 = 0.7587
UCINNOST_KOMP_3V3 = 0.7875
UCINNOST_KOMP_3V6 = 0.7768
UCINNOST_KOMP_4V5 = 0.7979
UCINNOST_KOMP_5V0 = 0.7969

# Vlastna spotreba pre Ipeak = 250mA
IIN_NAPRAZDNO_1V8 = 0.000001122
IIN_NAPRAZDNO_2V5 = 0.000001493
IIN_NAPRAZDNO_2V8 = 0.000001724
IIN_NAPRAZDNO_3V0 = 0.000001753
IIN_NAPRAZDNO_3V3 = 0.000001933
IIN_NAPRAZDNO_3V6 = 0.000002084
IIN_NAPRAZDNO_4V5 = 0.000002572
IIN_NAPRAZDNO_5V0 = 0.000002860

COMM_PORT_TIMEOUT = 1.0

CMD_irqCountRead = 1
CMD_ltc3335SetOutVoltage = 3
CMD_ltc3335SetPrescaler = 4
CMD_ltc3335SetAccumCharge = 5
CMD_pwmStart = 14
CMD_pwmStop = 15
CMD_saveDataEnable = 20
CMD_saveDataDisable = 21
CMD_saveMeasurementNote = 22
CMD_ltc3335TurnOn = 23
CMD_rLoadOnOff = 24

#frekvencia v Hz
PWM_FREK_MAX = 2000
PWM_FREK_MIN = 10

#Vzrokovacia perioda
TVZ_MIN_VAL = 1
TVZ_MAX_VAL = 60
TVZ_DEF_VAL = TVZ_MAX_VAL

#Velkost poznamky a pretecenie
NOTE_VELKOST = 2000


#ako keby enum
ucinnost_enum = {1.8 : UCINNOST_KOMP_1V8, 2.5 : UCINNOST_KOMP_2V5, 2.8 : UCINNOST_KOMP_2V8, 3.0 : UCINNOST_KOMP_3V0, 3.3 : UCINNOST_KOMP_3V3, 3.6 : UCINNOST_KOMP_3V6, 4.5 : UCINNOST_KOMP_4V5, 5.0 : UCINNOST_KOMP_5V0}
napatie_enum = {1.8 : 0x80, 2.5 : 0x90, 2.8 : 0xA0, 3.0 : 0xB0, 3.3 : 0xC0, 3.6 : 0xD0, 4.5 : 0xE0, 5.0 : 0xF0}
prud_naprazdno_enum = {1.8 : IIN_NAPRAZDNO_1V8, 2.5 : IIN_NAPRAZDNO_2V5, 2.8 : IIN_NAPRAZDNO_2V8, 3.0 : IIN_NAPRAZDNO_3V0, 3.3 : IIN_NAPRAZDNO_3V3, 3.6 : IIN_NAPRAZDNO_3V6, 4.5 : IIN_NAPRAZDNO_4V5, 5.0 : IIN_NAPRAZDNO_5V0}

preddelickaList = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
jednotkyList = ['u','m', ' ','k','M']
jedntky_enum = {'u' : 1000000.0, 'm' : 1000.0, ' ' : 1.0, 'k':0.001, 'M' : 0.000001}