"""
TODO Power up 
1)write to BANK 2 add 0x080 until 0x0DF (sequential register write sequence)
2)write to BANK 1 add 0x000 until 0x007
    - at this time add 0x001 must remain set to default value of 0x0000
add 0x000 = 0x82B2
add 0x001 = 0x000
add 0x002 = 0x3230 (depends ...)
add 0x003 = 0x419
add 0x004 = 832
add 0x005 = depends
add 0x006 = depends
add 0x007 = depends
3) write to BANK 1 add 0x001 = 0x0FFF (depends...)
4) Read back interrupt status register at add 0x008,0x009,0x00A (determined bz the int. output conf.)
5) Repeat step 4) every time /INT is asserted
"""

'''
Matúš Kočka, 230269
Bakalárska Práca
Elektronické šahcy
'''
from machine import I2C, Pin
from utime import sleep_ms


class AD7147:
    
    def __init__(self):
        pass
    
    i2c = I2C(0, scl = Pin(22), sda = Pin(21))
    
    DEVID_ADD = 0x17
    DEVID = 0x147
    
    '''SLAVE ADDRESSES'''
    Slave1_ADD_AD7147 = 0x2C #0b101100 slave add je zlozena z START bit||6-bit add||r/w\\ tato(0x58 read a 0x59 write)
    Slave2_ADD_AD7147 = 0x2D
    Slave3_ADD_AD7147 = 0x2E
    Slave4_ADD_AD7147 = 0x2F #must first be approved bz MUX
    Slave5_ADD_AD7147 = 0x2F #must first be approved bz MUX
    
    
    PWR_CONTROL_REG = 0x00
    STAGE_CAL_EN_REG = 0x01
    AMB_COMP_CTRL0_REG = 0x02
    AMB_COMP_CTRL1_REG = 0x03
    AMB_COMP_CTRL2_REG = 0x04
    STAGE_LOW_INT_ENABLE = 0x05
    STAGE_HIGH_INT_ENABLE = 0x06
    STAGE_COMPLETE_INT_ENABLE = 0x07
    
    # READ ONLY 
    STAGE_LOW_INT_STATUS = 0x08
    STAGE_HIGH_INT_STATUS = 0x09
    STAGE_COMPLETE_INT_STATUS = 0x0A
    CDC_RESULT_S0 = 0x0B
    CDC_RESULT_S1 = 0x0C
    CDC_RESULT_S2 = 0x0D
    CDC_RESULT_S3 = 0x0E
    CDC_RESULT_S4 = 0x0F
    CDC_RESULT_S5 = 0x10
    CDC_RESULT_S6 = 0x11
    CDC_RESULT_S7 = 0x12
    CDC_RESULT_S8 = 0x13
    CDC_RESULT_S9 = 0x14
    CDC_RESULT_S10 = 0x15
    CDC_RESULT_S11 = 0x16
    
    #transform square coordinates from array[x][y] created by RegToArray() function
    #to coordinates readable by sunfish chess engine
    #INPUTS: x - first index of array;
    #		 y - as second index
    def parseSensorToEngine(self, x, y):
        return (100 - 10*y + x)
    
    
    #first need to call this function before writing or reading from Slave4 (i2C mux)
    def EnableSlave4(self):
        self.i2c.writeto(0x70, b'\x01')
    #first need to call this function before writing or reading from Slave5 (i2C mux)
    def EnableSlave5(self):
        self.i2c.writeto(0x70, b'\x02')
    
    '''------------- READ number of words from register -------------'''
    def reg_read(self,slave, reg, nWords=1):
        nbytes = 2 * nWords
        reg_array = bytearray(1)
        reg_array.append(reg)
        self.i2c.writeto(slave, reg_array)
        return self.i2c.readfrom(slave, nbytes)


    '''------------- WRITE a buffer of data starting at register -------------'''
    def write_reg(self,slave, reg, data):
        self.i2c.writeto_mem(slave, reg, data, addrsize = 16)


    '''------------- CHECKS THE SLAVE ID -------------'''
    def check_ID(self,slave):
        data = self.reg_read(slave, self.DEVID_ADD)
        tmp = data[0] << 8 | data[1]
        tmp = tmp >> 4
        '''print add of devices on the BUS'''
        devices = self.i2c.scan()
        if devices:
            for d in devices:
                print(hex(d))
        if tmp == self.DEVID:
            print("Device:",hex(slave), "is communicating !!:D")
        else:
            print("Could not get the device: ",hex(slave)," ID")
            
    '''Calls check_ID() for every slave'''
    def CheckID(self):
        self.check_ID(self.Slave1_ADD_AD7147) 
        self.check_ID(self.Slave2_ADD_AD7147)
        self.check_ID(self.Slave3_ADD_AD7147)
        self.EnableSlave4()
        self.check_ID(self.Slave4_ADD_AD7147)
        self.EnableSlave5()
        self.check_ID(self.Slave5_ADD_AD7147)
    
    
    
    '''WRITES TO BANK2,1 REGISTERS'''
    def writeBank1_2(self):
        '''WRITE SLAVE 1'''
        self.write_reg(self.Slave1_ADD_AD7147, self.STAGE0_CONNECTION_6_0, self.slave1_bank2) 			#write bank2 SLAVE 1
        sleep_ms(5)
        self.write_reg(self.Slave1_ADD_AD7147, self.PWR_CONTROL_REG, self.slave1_bank1)					#write bank1 SLAVE 1
        sleep_ms(5)
        self.write_reg(self.Slave1_ADD_AD7147, self.STAGE_CAL_EN_REG, self.STAGE_CAL_EN_REG_DATA)	#finally initialize reg. STAGE_CAL_EN_REG
        
        '''WRITE SLAVE 2'''
        sleep_ms(5)
        self.write_reg(self.Slave2_ADD_AD7147, self.STAGE0_CONNECTION_6_0, self.slave2_bank2) 			#write bank2 SLAVE 2
        sleep_ms(5)
        self.write_reg(self.Slave2_ADD_AD7147, self.PWR_CONTROL_REG, self.slave2_bank1)					#write bank1 SLAVE 2
        sleep_ms(5)
        self.write_reg(self.Slave2_ADD_AD7147, self.STAGE_CAL_EN_REG, self.STAGE_CAL_EN_REG_DATA)	#finally initialize reg. STAGE_CAL_EN_REG
        
        '''WRITE SLAVE 3'''
        sleep_ms(5)
        self.write_reg(self.Slave3_ADD_AD7147, self.STAGE0_CONNECTION_6_0, self.slave3_bank2) 			#write bank2 SLAVE 3
        sleep_ms(5)
        self.write_reg(self.Slave3_ADD_AD7147, self.PWR_CONTROL_REG, self.slave3_bank1)					#write bank1 SLAVE 3
        sleep_ms(5)
        self.write_reg(self.Slave3_ADD_AD7147, self.STAGE_CAL_EN_REG, self.STAGE_CAL_EN_REG_DATA)	#finally initialize reg. STAGE_CAL_EN_REG
        
        '''WRITE SLAVE 4'''
        sleep_ms(5)
        self.EnableSlave4()
        self.write_reg(self.Slave4_ADD_AD7147, self.STAGE0_CONNECTION_6_0, self.slave4_bank2) 			#write bank2 SLAVE4
        sleep_ms(5)
        self.write_reg(self.Slave4_ADD_AD7147, self.PWR_CONTROL_REG, self.slave4_bank1)					#write bank1 SLAVE 4
        sleep_ms(5)
        self.write_reg(self.Slave4_ADD_AD7147, self.STAGE_CAL_EN_REG, self.STAGE_CAL_EN_REG_DATA)	#finally initialize reg. STAGE_CAL_EN_REG
        
        '''WRITE SLAVE 5'''
        sleep_ms(5)
        self.EnableSlave5()
        self.write_reg(self.Slave5_ADD_AD7147, self.STAGE0_CONNECTION_6_0, self.slave5_bank2) 			#write bank2 SLAVE 5
        sleep_ms(5)
        self.write_reg(self.Slave5_ADD_AD7147, self.PWR_CONTROL_REG, self.slave5_bank1)					#write bank1 SLAVE 5
        sleep_ms(5)
        self.write_reg(self.Slave5_ADD_AD7147, self.STAGE_CAL_EN_REG, self.STAGE_CAL_EN_REG_DATA)	#finally initialize reg. STAGE_CAL_EN_REG        
    
    
    
    '''GET SPECIFIC BIT VALUE FROM NUMBER'''    
    def GetBit(self, ArrayOfBits, bitNumber):
        return (ArrayOfBits & (1 << bitNumber)) != 0
    
    '''TRANSFER INTERRUPT DATA FROM REGISTERS TO ARRAY'''
    # Interrupt bits will be saved in array in the same position-
    # -as they are on the chess board where first indexes will portray-
    # -the number of collumn and second number of row array[column][row]
    # for examp. array[5][4] will be E4 position on the board
    def RegToArray(self, array):
        #For Slave1
        INT_data1H = self.reg_read(self.Slave1_ADD_AD7147, self.STAGE_HIGH_INT_STATUS,1)
        INT_data1L = self.reg_read(self.Slave1_ADD_AD7147, self.STAGE_LOW_INT_STATUS,1)
        Hstatus1 = INT_data1H[0] << 8 | INT_data1H[1] # zkombinuj dva byty
        Lstatus1 = INT_data1L[0] << 8 | INT_data1L[1]
        array[1][8] = self.GetBit(Hstatus1, 0)
        array[2][8] = self.GetBit(Hstatus1, 1)
        array[5][6] = self.GetBit(Lstatus1, 1) # CIN12 Prepnut na LOW treshold ne Hstatus ale Lstatus
        array[3][8] = self.GetBit(Hstatus1, 2)
        array[4][8] = self.GetBit(Hstatus1, 3)
        array[5][8] = self.GetBit(Hstatus1, 4)
        array[6][8] = self.GetBit(Hstatus1, 5)
        array[7][8] = self.GetBit(Hstatus1, 6)
        array[8][8] = self.GetBit(Hstatus1, 7)
        array[8][7] = self.GetBit(Hstatus1, 8)
        array[7][7] = self.GetBit(Hstatus1, 9)
        array[6][7] = self.GetBit(Hstatus1, 10)
        array[5][7] = self.GetBit(Hstatus1, 11)
        
        
        #For Slave2
        INT_data2H = self.reg_read(self.Slave2_ADD_AD7147, self.STAGE_HIGH_INT_STATUS,1)
        INT_data2L = self.reg_read(self.Slave2_ADD_AD7147, self.STAGE_LOW_INT_STATUS,1)
        Hstatus2 = INT_data2H[0] << 8 | INT_data2H[1] # zkombinuj dva byty
        Lstatus2 = INT_data2L[0] << 8 | INT_data2L[1]
        array[5][5] = self.GetBit(Hstatus2, 0)
        array[4][5] = self.GetBit(Hstatus2, 1)
        array[3][5] = self.GetBit(Hstatus2, 2)
        array[2][5] = self.GetBit(Hstatus2, 3)
        array[1][5] = self.GetBit(Hstatus2, 4)
        array[1][7] = self.GetBit(Lstatus2, 4) # CIN11 Prepnut na LOW treshold ne Hstatus ale Lstatus
        array[1][6] = self.GetBit(Hstatus2, 5)
        array[2][6] = self.GetBit(Hstatus2, 6)
        array[3][6] = self.GetBit(Hstatus2, 7)
        array[4][7] = self.GetBit(Hstatus2, 8)
        array[3][7] = self.GetBit(Hstatus2, 9)
        array[2][7] = self.GetBit(Hstatus2, 10)
        array[4][6] = self.GetBit(Hstatus2, 11) #CIN12
    
        #For Slave3
        INT_data3H = self.reg_read(self.Slave3_ADD_AD7147, self.STAGE_HIGH_INT_STATUS,1)
        INT_data3L = self.reg_read(self.Slave3_ADD_AD7147, self.STAGE_LOW_INT_STATUS,1)
        Hstatus3 = INT_data3H[0] << 8 | INT_data3H[1] # zkombinuj dva byty
        Lstatus3 = INT_data3L[0] << 8 | INT_data3L[1]
        array[6][6] = self.GetBit(Hstatus3, 0)
        array[7][6] = self.GetBit(Hstatus3, 1)
        array[8][6] = self.GetBit(Hstatus3, 2)
        array[8][5] = self.GetBit(Hstatus3, 3)
        array[8][4] = self.GetBit(Lstatus3, 3) #CIN8 Prepnut na LOW treshold ne Hstatus ale Lstatus
        array[7][5] = self.GetBit(Hstatus3, 4)
        array[6][5] = self.GetBit(Hstatus3, 5)
        array[6][4] = self.GetBit(Hstatus3, 6)
        array[7][4] = self.GetBit(Hstatus3, 7)
        array[6][3] = self.GetBit(Hstatus3, 8) #CIN11
        array[8][3] = self.GetBit(Hstatus3, 9)
        array[7][3] = self.GetBit(Hstatus3, 10)
        array[5][4] = self.GetBit(Hstatus3, 11) #CIN12
        
        #For Slave4
        self.EnableSlave4()
        INT_data4H = self.reg_read(self.Slave4_ADD_AD7147, self.STAGE_HIGH_INT_STATUS,1)
        Hstatus4 = INT_data4H[0] << 8 | INT_data4H[1] # zkombinuj dva byty
        array[1][3] = self.GetBit(Hstatus4, 0)
        array[1][4] = self.GetBit(Hstatus4, 1)
        array[2][4] = self.GetBit(Hstatus4, 2)
        array[3][4] = self.GetBit(Hstatus4, 3)
        array[4][4] = self.GetBit(Hstatus4, 4)
        array[4][3] = self.GetBit(Hstatus4, 5)
        array[3][3] = self.GetBit(Hstatus4, 6)
        array[2][3] = self.GetBit(Hstatus4, 7)
        array[2][2] = self.GetBit(Hstatus4, 8)
        array[3][2] = self.GetBit(Hstatus4, 9)
        array[1][1] = self.GetBit(Hstatus4, 10)
        array[1][2] = self.GetBit(Hstatus4, 11) #CIN12 ONE PIN IS CONNECTED TO BIAS (NOT USED)
        
        #For Slave5
        self.EnableSlave5()
        INT_data5H = self.reg_read(self.Slave5_ADD_AD7147, self.STAGE_HIGH_INT_STATUS,1)
        INT_data5L = self.reg_read(self.Slave5_ADD_AD7147, self.STAGE_LOW_INT_STATUS,1)
        Hstatus5 = INT_data5H[0] << 8 | INT_data5H[1] # zkombinuj dva byty
        Lstatus5 = INT_data5L[0] << 8 | INT_data5L[1]
        array[5][1] = self.GetBit(Hstatus5, 0)
        array[4][1] = self.GetBit(Hstatus5, 1)
        array[3][1] = self.GetBit(Hstatus5, 2)
        array[6][1] = self.GetBit(Hstatus5, 3)#CIN12
        array[4][2] = self.GetBit(Hstatus5, 4)
        array[5][2] = self.GetBit(Hstatus5, 5)
        array[5][3] = self.GetBit(Hstatus5, 6)
        array[2][1] = self.GetBit(Lstatus5, 6)#CIN3 Prepnut na LOW treshold ne Hstatus ale Lstatus
        array[6][2] = self.GetBit(Hstatus5, 7)
        array[7][2] = self.GetBit(Hstatus5, 8)
        array[8][2] = self.GetBit(Hstatus5, 9)
        array[8][1] = self.GetBit(Hstatus5, 10)
        array[7][1] = self.GetBit(Hstatus5, 11)
        
    
    
    
    
    
    
    
    
    
    
    
    
    '''_________________________________________DATA FOR BANK 2_________________________________________'''
    
    
    '''PO NAPISANI TYCHTO DAT PRE BANKU 1 MUSIME ESTE RAZ INICIALIZOVAT STAGE_CAL_EN_REG REGISTER NA HODNOTU 0xE00F'''
    STAGE_CAL_EN_REG_DATA = bytearray([0xEF,0xFF])
    
    '''VALUES FOR BANK 2'''
    AFE_OFFSET_15_8 	= 0x2F
    AFE_OFFSET_7_0  	= 0x2F
    SENSITIVITY_15_8 	= 0b00000000
    SENSITIVITY_7_0  	= 0b00000000
   
    HIGH_CLAMP_15_8 	= 0x40
    HIGH_CLAMP_7_0		= 0x00
    LOW_CLAMP_15_8 		= 0x40
    LOW_CLAMP_7_0		= 0x00
    
    offLow = int(((LOW_CLAMP_15_8 << 8) | LOW_CLAMP_7_0) * 0.8)
    offHigh = int(((HIGH_CLAMP_15_8 << 8) | HIGH_CLAMP_7_0) * 0.8)
    
    #set to 80% of the H/L_CLAMP register
    OFFSET_LOW_15_8 	= (offLow >> 8)
    OFFSET_LOW_7_0  	= 0xFF & offLow 
    OFFSET_HIGH_15_8 	= (offHigh >> 8)
    OFFSET_HIGH_7_0  	= 0xFF & offHigh
    
    
    
    # Pouzijeme sekvence zapisovani tj. na zacatku zapisovani dame adresu a potom uz iba data (add sa auto inkrementuje)
    #194
    
    STAGE0_CONNECTION_6_0 = 0x80 #prva adresa 2.banky
    #choose this address and write bank2 bytearray (the reg. addresses will increment after each word of data)
    
    '''BANK2 FOR SLAVE1'''
    slave1_bank2 = bytearray([
            0b00000000,0b00000010, #STAGE0_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE0_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE0_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE0_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE0_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE0_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE0_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE0_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00001000, #STAGE1_CONNECTION_6_0
            0b00110100,0b00000000, #STAGE1_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE1_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE1_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE1_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE1_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE1_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE1_OFFSET_LOW_CLAMP                        

            0b00000000,0b00100000, #STAGE2_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE2_CONNECTION_12_7 
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE2_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE2_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE2_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE2_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE2_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE2_OFFSET_LOW_CLAMP  

            0b00000000,0b10000000, #STAGE3_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE3_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE3_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE3_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE3_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE3_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE3_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE3_OFFSET_LOW_CLAMP
 
            0b00000010,0b00000000, #STAGE4_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE4_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE4_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE4_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE4_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE4_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE4_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE4_OFFSET_LOW_CLAMP

            0b00001000,0b00000000, #STAGE5_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE5_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE5_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE5_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE5_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE5_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE5_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE5_OFFSET_LOW_CLAMP
                        
            0b00100000,0b00000000, #STAGE6_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE6_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE6_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE6_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE6_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE6_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE6_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE6_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE7_CONNECTION_6_0
            0b01010000,0b00000010, #STAGE7_CONNECTION_12_7
             AFE_OFFSET_15_8,  AFE_OFFSET_7_0, #STAGE7_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE7_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE7_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE7_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE7_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE7_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE8_CONNECTION_6_0
            0b01010000,0b00001000, #STAGE8_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE8_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE8_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE8_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE8_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE8_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE8_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE9_CONNECTION_6_0
            0b01010000,0b00100000, #STAGE9_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE9_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE9_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE9_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE9_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE9_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE9_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE10_CONNECTION_6_0
            0b01010000,0b10000000, #STAGE10_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE10_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE10_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE10_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE10_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE10_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE10_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE11_CONNECTION_6_0
            0b01010010,0b00000000, #STAGE11_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE11_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE11_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE11_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE11_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE11_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE11_OFFSET_LOW_CLAMP
                        ])


    '''_________________________________________DATA FOR BANK 1 SLAVE 1_________________________________________'''
    slave1_bank1 = bytearray([
                        0x82,0xB2,	#Reg 0x00 PWR_CONTROL_REG
                        0x00,0x00,	#Reg 0x01 (temporary inicialization) STAGE_CAL_EN_REG
                        0x32,0x30,	#Reg 0x02 AMB_COMP_CTRL0_REG
                        0x04,0x19,	#Reg 0x03 AMB_COMP_CTRL1_REG
                        0x03,0x40,	#Reg 0x04 AMB_COMP_CTRL2_REG
                        0x00,0x02,	#Reg 0x05 STAGE_LOW_INT_ENABLE
                        0x0F,0xFF,	#Reg 0x06 STAGE_HIGH_INT_ENABLE
                        0x00,0x00,	#Reg 0x07 STAGE_COMPLETE_INT_ENABLE
                      ])
    
    
    '''BANK2 FOR SLAVE2'''
    slave2_bank2 = bytearray([
            0b00000000,0b00000010, #STAGE0_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE0_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE0_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE0_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE0_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE0_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE0_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE0_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00001000, #STAGE1_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE1_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE1_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE1_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE1_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE1_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE1_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE1_OFFSET_LOW_CLAMP                        

            0b00000000,0b00100000, #STAGE2_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE2_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE2_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE2_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE2_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE2_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE2_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE2_OFFSET_LOW_CLAMP 

            0b00000000,0b10000000, #STAGE3_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE3_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE3_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE3_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE3_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE3_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE3_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE3_OFFSET_LOW_CLAMP
 
            0b00000010,0b00000000, #STAGE4_CONNECTION_6_0
            0b00110001,0b00000000, #STAGE4_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE4_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE4_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE4_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE4_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE4_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE4_OFFSET_LOW_CLAMP

            0b00001000,0b00000000, #STAGE5_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE5_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE5_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE5_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE5_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE5_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE5_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE5_OFFSET_LOW_CLAMP
                        
            0b00100000,0b00000000, #STAGE6_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE6_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE6_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE6_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE6_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE6_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE6_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE6_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE7_CONNECTION_6_0
            0b01010000,0b00000010, #STAGE7_CONNECTION_12_7
             AFE_OFFSET_15_8,  AFE_OFFSET_7_0, #STAGE7_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE7_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE7_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE7_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE7_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE7_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE8_CONNECTION_6_0
            0b01010000,0b00001000, #STAGE8_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE8_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE8_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE8_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE8_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE8_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE8_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE9_CONNECTION_6_0
            0b01010000,0b00100000, #STAGE9_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE9_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE9_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE9_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE9_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE9_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE9_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE10_CONNECTION_6_0
            0b01010000,0b10000000, #STAGE10_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE10_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE10_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE10_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE10_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE10_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE10_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE11_CONNECTION_6_0
            0b01011000,0b00000000, #STAGE11_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE11_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE11_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE11_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE11_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE11_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE11_OFFSET_LOW_CLAMP
                        ])


    '''_________________________________________DATA FOR BANK 1 SLAVE 2_________________________________________'''
    slave2_bank1 = bytearray([
                        0x82,0xB2,	#Reg 0x00 PWR_CONTROL_REG
                        0x00,0x00,	#Reg 0x01 (temporary inicialization) STAGE_CAL_EN_REG
                        0x32,0x30,	#Reg 0x02 AMB_COMP_CTRL0_REG
                        0x04,0x19,	#Reg 0x03 AMB_COMP_CTRL1_REG
                        0x03,0x40,	#Reg 0x04 AMB_COMP_CTRL2_REG
                        0x00,0x10,	#Reg 0x05 STAGE_LOW_INT_ENABLE
                        0x0F,0xFF,	#Reg 0x06 STAGE_HIGH_INT_ENABLE
                        0x00,0x00,	#Reg 0x07 STAGE_COMPLETE_INT_ENABLE
                      ])
    
    
    '''BANK2 FOR SLAVE3'''
    slave3_bank2 = bytearray([
            0b00000000,0b00000010, #STAGE0_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE0_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE0_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE0_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE0_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE0_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE0_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE0_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00001000, #STAGE1_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE1_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE1_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE1_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE1_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE1_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE1_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE1_OFFSET_LOW_CLAMP                        

            0b00000000,0b00100000, #STAGE2_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE2_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE2_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE2_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE2_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE2_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE2_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE2_OFFSET_LOW_CLAMP 

            0b00000000,0b10000000, #STAGE3_CONNECTION_6_0
            0b00110000,0b00000100, #STAGE3_CONNECTION_12_7 
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE3_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE3_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE3_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE3_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE3_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE3_OFFSET_LOW_CLAMP
 
            0b00000010,0b00000000, #STAGE4_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE4_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE4_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE4_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE4_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE4_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE4_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE4_OFFSET_LOW_CLAMP

            0b00001000,0b00000000, #STAGE5_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE5_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE5_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE5_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE5_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE5_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE5_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE5_OFFSET_LOW_CLAMP
                        
            0b00100000,0b00000000, #STAGE6_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE6_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE6_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE6_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE6_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE6_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE6_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE6_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE7_CONNECTION_6_0
            0b01010000,0b00000010, #STAGE7_CONNECTION_12_7
             AFE_OFFSET_15_8,  AFE_OFFSET_7_0, #STAGE7_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE7_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE7_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE7_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE7_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE7_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE8_CONNECTION_6_0
            0b01010010,0b00000000, #STAGE8_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE8_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE8_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE8_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE8_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE8_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE8_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE9_CONNECTION_6_0
            0b01010000,0b00100000, #STAGE9_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE9_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE9_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE9_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE9_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE9_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE9_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE10_CONNECTION_6_0
            0b01010000,0b10000000, #STAGE10_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE10_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE10_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE10_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE10_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE10_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE10_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE11_CONNECTION_6_0
            0b01011000,0b00000000, #STAGE11_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE11_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE11_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE11_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE11_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE11_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE11_OFFSET_LOW_CLAMP
                        ])


    '''_________________________________________DATA FOR BANK 1 SLAVE 3_________________________________________'''
    slave3_bank1 = bytearray([
                        0x82,0xB2,	#Reg 0x00 PWR_CONTROL_REG
                        0x00,0x00,	#Reg 0x01 (temporary inicialization) STAGE_CAL_EN_REG
                        0x32,0x30,	#Reg 0x02 AMB_COMP_CTRL0_REG
                        0x04,0x19,	#Reg 0x03 AMB_COMP_CTRL1_REG
                        0x03,0x40,	#Reg 0x04 AMB_COMP_CTRL2_REG
                        0x01,0x00,	#Reg 0x05 STAGE_LOW_INT_ENABLE
                        0x0F,0xFF,	#Reg 0x06 STAGE_HIGH_INT_ENABLE
                        0x00,0x00,	#Reg 0x07 STAGE_COMPLETE_INT_ENABLE
                      ])
    
    
    
    '''BANK2 FOR SLAVE4'''
    slave4_bank2 = bytearray([
            0b00000000,0b00000010, #STAGE0_CONNECTION_6_0
            0b01010011,0b00000000, #STAGE0_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE0_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE0_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE0_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE0_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE0_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE0_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00001000, #STAGE1_CONNECTION_6_0
            0b01010011,0b00000000, #STAGE1_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE1_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE1_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE1_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE1_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE1_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE1_OFFSET_LOW_CLAMP                        

            0b00000000,0b00100000, #STAGE2_CONNECTION_6_0
            0b01010011,0b00000000, #STAGE2_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE2_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE2_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE2_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE2_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE2_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE2_OFFSET_LOW_CLAMP 

            0b00000000,0b10000000, #STAGE3_CONNECTION_6_0
            0b01010011,0b00000000, #STAGE3_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE3_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE3_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE3_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE3_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE3_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE3_OFFSET_LOW_CLAMP
 
            0b00000010,0b00000000, #STAGE4_CONNECTION_6_0
            0b01010011,0b00000000, #STAGE4_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE4_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE4_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE4_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE4_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE4_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE4_OFFSET_LOW_CLAMP

            0b00001000,0b00000000, #STAGE5_CONNECTION_6_0
            0b01010011,0b00000000, #STAGE5_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE5_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE5_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE5_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE5_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE5_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE5_OFFSET_LOW_CLAMP
                        
            0b00100000,0b00000000, #STAGE6_CONNECTION_6_0
            0b01010011,0b00000000, #STAGE6_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE6_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE6_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE6_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE6_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE6_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE6_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE7_CONNECTION_6_0
            0b01010011,0b00000010, #STAGE7_CONNECTION_12_7
             AFE_OFFSET_15_8,  AFE_OFFSET_7_0, #STAGE7_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE7_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE7_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE7_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE7_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE7_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE8_CONNECTION_6_0
            0b01010011,0b00001000, #STAGE8_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE8_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE8_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE8_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE8_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE8_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE8_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE9_CONNECTION_6_0
            0b01010011,0b00100000, #STAGE9_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE9_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE9_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE9_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE9_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE9_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE9_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE10_CONNECTION_6_0
            0b01010011,0b10000000, #STAGE10_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE10_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE10_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE10_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE10_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE10_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE10_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE11_CONNECTION_6_0
            0b01011011,0b00000000, #STAGE11_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE11_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE11_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE11_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE11_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE11_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE11_OFFSET_LOW_CLAMP
                        ])


    '''_________________________________________DATA FOR BANK 1 SLAVE 4_________________________________________'''
    slave4_bank1 = bytearray([
                        0x82,0xB2,	#Reg 0x00 PWR_CONTROL_REG
                        0x00,0x00,	#Reg 0x01 (temporary inicialization) STAGE_CAL_EN_REG
                        0x32,0x30,	#Reg 0x02 AMB_COMP_CTRL0_REG
                        0x04,0x19,	#Reg 0x03 AMB_COMP_CTRL1_REG
                        0x03,0x40,	#Reg 0x04 AMB_COMP_CTRL2_REG
                        0x00,0x00,	#Reg 0x05 STAGE_LOW_INT_ENABLE
                        0x0F,0xFF,	#Reg 0x06 STAGE_HIGH_INT_ENABLE
                        0x00,0x00,	#Reg 0x07 STAGE_COMPLETE_INT_ENABLE
                      ])
    
    
    '''BANK2 FOR SLAVE 5'''
    slave5_bank2 = bytearray([
            0b00000000,0b00000010, #STAGE0_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE0_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE0_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE0_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE0_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE0_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE0_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE0_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00001000, #STAGE1_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE1_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE1_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE1_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE1_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE1_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE1_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE1_OFFSET_LOW_CLAMP                        

            0b00000000,0b00100000, #STAGE2_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE2_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE2_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE2_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE2_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE2_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE2_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE2_OFFSET_LOW_CLAMP 

            0b00000000,0b00000000, #STAGE3_CONNECTION_6_0
            0b01011000,0b00000000, #STAGE3_CONNECTION_12_7 
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE3_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE3_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE3_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE3_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE3_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE3_OFFSET_LOW_CLAMP
 
            0b00000010,0b00000000, #STAGE4_CONNECTION_6_0
            0b00110001,0b00000000, #STAGE4_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE4_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE4_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE4_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE4_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE4_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE4_OFFSET_LOW_CLAMP

            0b00001000,0b00000000, #STAGE5_CONNECTION_6_0
            0b01010000,0b00000000, #STAGE5_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE5_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE5_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE5_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE5_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE5_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE5_OFFSET_LOW_CLAMP
                        
            0b00100000,0b01000000, #STAGE6_CONNECTION_6_0
            0b00110000,0b00000000, #STAGE6_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE6_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE6_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE6_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE6_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE6_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE6_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE7_CONNECTION_6_0
            0b01010000,0b00000010, #STAGE7_CONNECTION_12_7
             AFE_OFFSET_15_8,  AFE_OFFSET_7_0, #STAGE7_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE7_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE7_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE7_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE7_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE7_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE8_CONNECTION_6_0
            0b01010000,0b00001000, #STAGE8_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE8_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE8_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE8_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE8_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE8_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE8_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE9_CONNECTION_6_0
            0b01010000,0b00100000, #STAGE9_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE9_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE9_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE9_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE9_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE9_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE9_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE10_CONNECTION_6_0
            0b01010000,0b10000000, #STAGE10_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE10_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE10_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE10_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE10_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE10_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE10_OFFSET_LOW_CLAMP
                        
            0b00000000,0b00000000, #STAGE11_CONNECTION_6_0
            0b01010010,0b00000000, #STAGE11_CONNECTION_12_7
            AFE_OFFSET_15_8,  AFE_OFFSET_7_0,  #STAGE11_AFE_OFFSET
            SENSITIVITY_15_8, SENSITIVITY_7_0, #STAGE11_SENSITIVITY
            OFFSET_LOW_15_8,  OFFSET_LOW_7_0,  #STAGE11_OFFSET_LOW
            OFFSET_HIGH_15_8, OFFSET_HIGH_7_0, #STAGE11_OFFSET_HIGH
            HIGH_CLAMP_15_8,  HIGH_CLAMP_7_0,  #STAGE11_OFFSET_HIGH_CLAMP
            LOW_CLAMP_15_8,    LOW_CLAMP_7_0,  #STAGE11_OFFSET_LOW_CLAMP
                        ])


    '''_________________________________________DATA FOR BANK 1 SLAVE 5_________________________________________'''
    slave5_bank1 = bytearray([
                        0x82,0xB2,	#Reg 0x00 PWR_CONTROL_REG
                        0x00,0x00,	#Reg 0x01 (temporary inicialization) STAGE_CAL_EN_REG
                        0x32,0x30,	#Reg 0x02 AMB_COMP_CTRL0_REG
                        0x04,0x19,	#Reg 0x03 AMB_COMP_CTRL1_REG
                        0x03,0x40,	#Reg 0x04 AMB_COMP_CTRL2_REG
                        0x00,0x40,	#Reg 0x05 STAGE_LOW_INT_ENABLE
                        0x0F,0xFF,	#Reg 0x06 STAGE_HIGH_INT_ENABLE
                        0x00,0x00,	#Reg 0x07 STAGE_COMPLETE_INT_ENABLE
                      ])
 

    
    
    
        
    
    
    
    
    
    
    
    
    
 
