!! Add below code in app_drv_i2c1.h !!
---------------------------------------------------------------------
    APP_DRV_I2C1_STATE_WRITE_READ_24AA,
    APP_DRV_I2C1_STATE_WAIT_COMPLETE_24AA,

---------------------------------------------------------------------


!! Modify below code in state STATE_WAIT_COMPLETE_9800 of app_drv_i2c1.c !!
---------------------------------------------------------------------
            app_drv_i2c1Data.state = APP_DRV_I2C1_STATE_WRITE_READ_24AA; // Modify this Line


!! Add below code in state STATE_WAIT_COMPLETE_9800 of app_drv_i2c1.c !!
---------------------------------------------------------------------
    case APP_DRV_I2C1_STATE_WRITE_READ_24AA:
        app_drv_i2c1Data.state = APP_DRV_I2C1_STATE_WAIT_COMPLETE_24AA;
        break;

    case APP_DRV_I2C1_STATE_WAIT_COMPLETE_24AA:
        app_drv_i2c1Data.state = APP_DRV_I2C1_STATE_WRITE_READ_9800;
        break;

---------------------------------------------------------------------
#include "system/time/sys_time.h"

---------------------------------------------------------------------
#define MCP24AA_ADDRESS 0x50

---------------------------------------------------------------------
DRV_HANDLE I2C1Handle_24AA;
DRV_I2C_TRANSFER_HANDLE I2C1WriteReadHandle_24AA;
volatile int I2C1Complete_24AA = false;
char I2C1WriteBuf_24AA[20];
char I2C1ReadBuf_24AA[20];

---------------------------------------------------------------------
void I2C1TransferHandler_24AA( DRV_I2C_TRANSFER_EVENT event,
                               DRV_I2C_TRANSFER_HANDLE transferHandle,
                               uintptr_t context )
{
    switch( event )
    {
    case DRV_I2C_TRANSFER_EVENT_PENDING:        break;
    case DRV_I2C_TRANSFER_EVENT_COMPLETE:
        I2C1Complete_24AA = true;
        break;
    case DRV_I2C_TRANSFER_EVENT_HANDLE_EXPIRED:
    case DRV_I2C_TRANSFER_EVENT_ERROR:
    case DRV_I2C_TRANSFER_EVENT_HANDLE_INVALID:
        app_drv_i2c1Data.state = APP_DRV_I2C1_STATE_ERROR;
        break;
    }
}

---------------------------------------------------------------------
        I2C1Handle_24AA = DRV_I2C_Open(DRV_I2C_INDEX_0, DRV_IO_INTENT_READWRITE);
        if(I2C1Handle_24AA == DRV_HANDLE_INVALID)
        {
            app_drv_i2c1Data.state = APP_DRV_I2C1_STATE_ERROR;
            break;
        }

---------------------------------------------------------------------
        I2C1WriteBuf_24AA[0] = 0;
        I2C1WriteBuf_24AA[1] = 0x24;
        DRV_I2C_WriteTransferAdd( I2C1Handle_24AA, MCP24AA_ADDRESS,
                                         I2C1WriteBuf_24AA, 2, &I2C1WriteReadHandle_24AA );
        while( DRV_I2C_TransferStatusGet(I2C1WriteReadHandle_24AA) != 
                                                       DRV_I2C_TRANSFER_EVENT_COMPLETE) {}
        SYS_TIME_HANDLE TimeHandle;
        SYS_TIME_DelayMS(10, &TimeHandle );
        while(!SYS_TIME_DelayIsComplete(TimeHandle)) {}

        USART1printf("Wrote 0x24 to EEPROM 24AA\r\n");

        DRV_I2C_TransferEventHandlerSet(I2C1Handle_24AA, I2C1TransferHandler_24AA, 0);

---------------------------------------------------------------------
        I2C1WriteBuf_24AA[0] = 0;
        DRV_I2C_WriteReadTransferAdd( I2C1Handle_24AA, MCP24AA_ADDRESS,
                    I2C1WriteBuf_24AA, 1, I2C1ReadBuf_24AA, 1, &I2C1WriteReadHandle_24AA );
        if(I2C1WriteReadHandle_24AA == DRV_I2C_TRANSFER_HANDLE_INVALID)
        {
            app_drv_i2c1Data.state = APP_DRV_I2C1_STATE_ERROR;
            break;
        }

---------------------------------------------------------------------
        if(I2C1Complete_24AA == true)
        {
            I2C1Complete_24AA = false;
            USART1printf("\t\tEEPROM = 0x%X\r", I2C1ReadBuf_24AA[0]);
			
            app_drv_i2c1Data.state = APP_DRV_I2C1_STATE_WRITE_READ_9800;
        }

---------------------------------------------------------------------
