/* retval kStatus_Success RDC_SEMA42 gate is reset successfully. retval kStatus_Failed Some other reset process is ongoing.  */
status_t RDC_SEMA42_ResetGate(RDC_SEMAPHORE_Type *base, uint8_t gateNum)
/* retval kStatus_Success RDC_SEMA42 gate is reset successfully. retval kStatus_Failed Some other reset process is ongoing.  */
status_t RDC_SEMA42_ResetGate(RDC_SEMAPHORE_Type *base, uint8_t gateNum)
{
    status_t status;
    if (0U != (base->RSTGT_R & RDC_SEMAPHORE_RSTGT_R_RSTGSM_MASK))
    {
        status = kStatus_Fail;
    }
    else
    {
        base->RSTGT_W = RDC_SEMAPHORE_RSTGT_W_RSTGDP(RDC_SEMA42_GATE_RESET_PATTERN_1);
        base->RSTGT_W =
            RDC_SEMAPHORE_RSTGT_W_RSTGDP(RDC_SEMA42_GATE_RESET_PATTERN_2) | RDC_SEMAPHORE_RSTGT_W_RSTGTN(gateNum);
        status = kStatus_Success;
    }
    return status;
}