!! Add below code in app_drv_i2c1.h !!
---------------------------------------------------------------------
    // APP_DRV_I2C1_STATE_SERVICE_TASKS,
    APP_DRV_I2C1_STATE_WRITE_READ_9800,
    APP_DRV_I2C1_STATE_WAIT_COMPLETE_9800,
    APP_DRV_I2C1_STATE_ERROR,
    APP_DRV_I2C1_STATE_IDLE,

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


!! Add below code in app_drv_i2c1.c !!
---------------------------------------------------------------------
    switch ( app_drv_i2c1Data.state )
    {
    case APP_DRV_I2C1_STATE_INIT:
        app_drv_i2c1Data.state = APP_DRV_I2C1_STATE_WRITE_READ_9800;
        break;

    case APP_DRV_I2C1_STATE_WRITE_READ_9800:
        app_drv_i2c1Data.state = APP_DRV_I2C1_STATE_WAIT_COMPLETE_9800;
        break;

    case APP_DRV_I2C1_STATE_WAIT_COMPLETE_9800:
        app_drv_i2c1Data.state = APP_DRV_I2C1_STATE_WRITE_READ_9800;
        break;

    case APP_DRV_I2C1_STATE_ERROR:
        app_drv_i2c1Data.state = APP_DRV_I2C1_STATE_IDLE;
        break;

    case APP_DRV_I2C1_STATE_IDLE:
        break;
    }

---------------------------------------------------------------------
#include "app_drv_usart1.h"
#include "driver/i2c/drv_i2c.h"
#include <stdio.h>
#include <string.h>

---------------------------------------------------------------------
#define MCP9800_ADDRESS 0x4D
#define MCP9800_REG_TA  0x0

DRV_HANDLE I2C1Handle_9800;
DRV_I2C_TRANSFER_HANDLE I2C1WriteReadHandle_9800;
volatile int I2C1Complete_9800 = false;
char I2C1WriteBuf_9800[20];
char I2C1ReadBuf_9800[20];

---------------------------------------------------------------------
void I2C1TransferHandler_9800( 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_9800 = 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_9800 = DRV_I2C_Open(DRV_I2C_INDEX_0, DRV_IO_INTENT_READWRITE);
        if(I2C1Handle_9800 == DRV_HANDLE_INVALID)
        {
            app_drv_i2c1Data.state = APP_DRV_I2C1_STATE_ERROR;
            break;
        }
        DRV_I2C_TransferEventHandlerSet(I2C1Handle_9800, I2C1TransferHandler_9800, 0);

---------------------------------------------------------------------
        USART1printf("DRV_I2C1 error!\r\n");

---------------------------------------------------------------------
        I2C1WriteBuf_9800[0] = MCP9800_REG_TA;
        DRV_I2C_WriteReadTransferAdd( I2C1Handle_9800, MCP9800_ADDRESS,
                    I2C1WriteBuf_9800, 1, I2C1ReadBuf_9800, 2, &I2C1WriteReadHandle_9800 );
        if(I2C1WriteReadHandle_9800 == DRV_I2C_TRANSFER_HANDLE_INVALID)
        {
            app_drv_i2c1Data.state = APP_DRV_I2C1_STATE_ERROR;
            break;
        }

---------------------------------------------------------------------
        if(I2C1Complete_9800 == true)
        {
            I2C1Complete_9800 = false;
            USART1printf("Temp = %2.1f\r",
                         (float)((I2C1ReadBuf_9800[0]<<4)|(I2C1ReadBuf_9800[1]>>4))/16.0f);

            app_drv_i2c1Data.state = APP_DRV_I2C1_STATE_WRITE_READ_9800;
        }

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