/* param handle i2c master handle. param deviceAddress codec device address. param subAddress register address. param subaddressSize register address width. param rxBuff rx buffer pointer. param rxBuffSize rx buffer size. return kStatus_HAL_I2cSuccess is success, else receive failed.  */
status_t CODEC_I2C_Receive(void *handle, uint8_t deviceAddress, uint32_t subAddress, uint8_t subaddressSize, uint8_t *rxBuff, uint8_t rxBuffSize)
/* param handle i2c master handle. param deviceAddress codec device address. param subAddress register address. param subaddressSize register address width. param rxBuff rx buffer pointer. param rxBuffSize rx buffer size. return kStatus_HAL_I2cSuccess is success, else receive failed.  */
status_t CODEC_I2C_Receive(void *handle, uint8_t deviceAddress, uint32_t subAddress, uint8_t subaddressSize, uint8_t *rxBuff, uint8_t rxBuffSize)
{
    hal_i2c_master_transfer_t masterXfer;
    masterXfer.slaveAddress   = deviceAddress;
    masterXfer.direction      = kHAL_I2cRead;
    masterXfer.subaddress     = (uint32_t)subAddress;
    masterXfer.subaddressSize = subaddressSize;
    masterXfer.data           = rxBuff;
    masterXfer.dataSize       = rxBuffSize;
    masterXfer.flags          = kHAL_I2cTransferDefaultFlag;
    return HAL_I2cMasterTransferBlocking((hal_i2c_master_handle_t *)handle, &masterXfer);
}