/* param base DCP peripheral base address. param handle Specifies DCP channel. return kStatus_Success When data processing completes without error. return kStatus_Fail When error occurs.  */
status_t DCP_WaitForChannelComplete(DCP_Type *base, dcp_handle_t *handle)
/* param base DCP peripheral base address. param handle Specifies DCP channel. return kStatus_Success When data processing completes without error. return kStatus_Fail When error occurs.  */
status_t DCP_WaitForChannelComplete(DCP_Type *base, dcp_handle_t *handle)
{
    while ((base->STAT & (uint32_t)handle->channel) == handle->channel)
    {
    }
    if (dcp_get_channel_status(base, handle->channel) != kStatus_Success)
    {
        dcp_clear_status(base);
        dcp_clear_channel_status(base, handle->channel);
        return kStatus_Fail;
    }
    return kStatus_Success;
}