/* retval kStatus_Success SEMA4 gate is reset successfully. retval kStatus_Fail Some other reset process is ongoing.  */
status_t SEMA4_ResetGate(SEMA4_Type *base, uint8_t gateNum)
/* retval kStatus_Success SEMA4 gate is reset successfully. retval kStatus_Fail Some other reset process is ongoing.  */
status_t SEMA4_ResetGate(SEMA4_Type *base, uint8_t gateNum)
{
    status_t status;
    assert(!((gateNum < SEMA4_GATE_NUM_RESET_ALL) && (gateNum >= (uint8_t)FSL_FEATURE_SEMA4_GATE_COUNT)));
    if (0U != (base->RSTGT & SEMA4_RSTGT_RSTNSM_MASK))
    {
        status = kStatus_Fail;
    }
    else
    {
        base->RSTGT = SEMA4_RSTGT_RSTGSM_RSTGMS_RSTGDP(SEMA4_GATE_RESET_PATTERN_1);
        base->RSTGT = SEMA4_RSTGT_RSTGSM_RSTGMS_RSTGDP(SEMA4_GATE_RESET_PATTERN_2) | SEMA4_RSTGT_RSTGTN(gateNum);
        status = kStatus_Success;
    }
    return status;
}