
Called from main.c file

MAX_NUMBYTE_TX[0] = 0; //Transmit 1 bytes of DATA ONLY on I2C  
i2c_init(0x20, 0); //Set to master with address of 0x20, no general call
i2c_transmit(0x3B, 0x03);  // enable mux channels 0-1
while (i2c_getstatus() & I2C_BUSY);	// wait until complete
MAX_NUMBYTE_TX[0] = 1;
i2c_init(0x20, 0); //Set to master with address of 0x20, no general call
i2c_transmit(0x3B, 0x03, 0x04);  // enable mux channels 0-1
while (i2c_getstatus() & I2C_BUSY);	// wait until complete
MAX_NUMBYTE_TX[0] = 2;
i2c_init(0x20, 0); //Set to master with address of 0x20, no general call
i2c_transmit(0x3B, 0x03, 0x04, 0x05);  // enable mux channels 0-1
while (i2c_getstatus() & I2C_BUSY);	// wait until complete

=========================================================================
used in IO.c file

uchar MAX_NUMBYTE_TX[] = {7};

uchar i2c_transmit(uchar address,
		uchar byte0,
		uchar byte1,
		uchar byte2,
		uchar byte3,
		uchar byte4,
		uchar byte5,
		uchar byte6)
{
  transmit_bytes[BYTE_0] = byte0;  //defined in header file
  transmit_bytes[BYTE_1] = byte1;  //defined in header file
  transmit_bytes[BYTE_2] = byte2;  //defined in header file
  transmit_bytes[BYTE_3] = byte3;  //defined in header file
  transmit_bytes[BYTE_4] = byte4;  //defined in header file
  transmit_bytes[BYTE_5] = byte5;  //defined in header file
  transmit_bytes[BYTE_6] = byte6;  //defined in header file
  // if already busy then return current status
  if (i2cstatus & I2C_BUSY) return i2cstatus;

  // now we are busy performing a transfer
  i2cstatus = I2C_BUSYTX;

  // store slave address + W for use in ISR
  slaveaddress = address << 1;

  // transmit start condition
  STA = 1;

  // transmission started
  return I2C_OK;
}

=========================================================================
Defined in i2c.h file

//Data array definitions for I2C send
#define BYTE_0			0
#define BYTE_1			1
#define BYTE_2			2
#define BYTE_3			3
#define BYTE_4			4
#define BYTE_5			5
#define BYTE_6			6

extern unsigned char i2c_transmit(unsigned char address, unsigned char byte0, unsigned char byte1,unsigned char byte2,unsigned char byte3,
unsigned char byte4,unsigned char byte5,unsigned char byte6);
															  	
=========================================================================



