@staticmethod
def _build_instruct(rw, bytes2send, reg_addr, reg_value=0):
    """Builds an instruction.
        Take arguments to form adequat instruction.
        Return an array containing the serie of instruction bits
        (i.e. each case of array contains '0' or '1').
        Details:   Prototype of transmission on AD9912 serial bus:
             16 bits header    | (up to) 4 bytes data
        R/W | W1:W0 |  A12:A0  |     ............
        ex: read FTW0_0 register
         1  |  0:0  |  0x0000  |
         => 0x8000
        ex: read Part ID (2 bytes)
         1  |  0:1  |  0x0002  |
         => 0xA002
        :param rw: 1 = read, 0 = Write (int).
        :param bytes2Send: 0=1Byte, 1=2Bytes, 2=3Bytes, 3=4Bytes or more (int).
        :param regAddr: enter the register address to write to (int).
        :param regValue: only if register writing is requested (int).
        :returns: instruction (int)
        """
    if rw == 1:
        rw = 1 << 15
        bytes2send = bytes2send << 13
        instruct = rw + bytes2send + reg_addr
    else:
        bytes2send = bytes2send << 21
        reg_addr = reg_addr << 8
        instruct = rw + bytes2send + reg_addr + reg_value
    return instruct
