/* Writes more than one byte to the M24Cxx with a single WRITE cycle.  */
void M24CxxPageWrite(unsigned char *pucBuffer, unsigned short usWriteAddr, unsigned char ucNumByteToWrite)
/* Writes more than one byte to the M24Cxx with a single WRITE cycle.  */
void M24CxxPageWrite(unsigned char *pucBuffer, unsigned short usWriteAddr, unsigned char ucNumByteToWrite)
{
    xI2CMasterWriteS1(M24Cxx_PIN_I2C_PORT, M24Cxx_ADDRESS, 
                     (unsigned char)((usWriteAddr & 0xFF00) >> 8), 
                     xfalse);
    xI2CMasterWriteS2(M24Cxx_PIN_I2C_PORT, 
                      (unsigned char)(usWriteAddr & 0x00FF),
                      xfalse);
    while(ucNumByteToWrite--)  
    {     
      if(ucNumByteToWrite == 0)
      {
        xI2CMasterWriteS2(M24Cxx_PIN_I2C_PORT, *pucBuffer, xtrue);
      }      else
      {
    	xI2CMasterWriteS2(M24Cxx_PIN_I2C_PORT, *pucBuffer, xfalse);
        pucBuffer++;
      } 
    }
}