/* param base XRDC2 peripheral base address. param periph The peripheral to operate. retval kStatus_Fail Failed to lock. retval kStatus_Success Locked succussfully.  */
status_t XRDC2_TryLockPeriphExclAccess(XRDC2_Type *base, xrdc2_periph_t periph)
/* param base XRDC2 peripheral base address. param periph The peripheral to operate. retval kStatus_Fail Failed to lock. retval kStatus_Success Locked succussfully.  */
status_t XRDC2_TryLockPeriphExclAccess(XRDC2_Type *base, xrdc2_periph_t periph)
{
    status_t status;
    uint8_t curDomainID;
    uint32_t pac  = XRDC2_GET_PAC((uint32_t)periph);
    uint32_t pdac = XRDC2_GET_PDAC((uint32_t)periph);
    volatile uint32_t *lockReg = &(base->PACI_PDACJ[pac][pdac].PAC_PDAC_W1);
    curDomainID = XRDC2_GetCurrentMasterDomainId(base);
    *lockReg = XRDC2_EAL_LOCKED;
    if (curDomainID != XRDC2_GetPeriphExclAccessLockDomainOwner(base, periph))
    {
        status = kStatus_Fail;
    }
    else
    {
        status = kStatus_Success;
    }
    return status;
}