/* param handle i2c master handle. param deviceAddress codec device address. param subAddress register address. param subaddressSize register address width. param txBuff tx buffer pointer. param txBuffSize tx buffer size. return kStatus_HAL_I2cSuccess is success, else send failed.  */
status_t CODEC_I2C_Send(void *handle, uint8_t deviceAddress, uint32_t subAddress, uint8_t subaddressSize, uint8_t *txBuff, uint8_t txBuffSize)
/* param handle i2c master handle. param deviceAddress codec device address. param subAddress register address. param subaddressSize register address width. param txBuff tx buffer pointer. param txBuffSize tx buffer size. return kStatus_HAL_I2cSuccess is success, else send failed.  */
status_t CODEC_I2C_Send(void *handle, uint8_t deviceAddress, uint32_t subAddress, uint8_t subaddressSize, uint8_t *txBuff, uint8_t txBuffSize)
{
    hal_i2c_master_transfer_t masterXfer;
    masterXfer.slaveAddress   = deviceAddress;
    masterXfer.direction      = kHAL_I2cWrite;
    masterXfer.subaddress     = (uint32_t)subAddress;
    masterXfer.subaddressSize = subaddressSize;
    masterXfer.data           = txBuff;
    masterXfer.dataSize       = txBuffSize;
    masterXfer.flags          = kHAL_I2cTransferDefaultFlag;
    return HAL_I2cMasterTransferBlocking((hal_i2c_master_handle_t *)handle, &masterXfer);
}