/* This function writes the given structure to the TDET Control Register. param base TDET peripheral base address param config Pointer to structure with TDET peripheral configuration parameters return kStatus_Fail when writing to TDET Control Register is not allowed return kStatus_Success when operation completes successfully  */
status_t TDET_SetConfig(DIGTMP_Type *base, const tdet_config_t *config)
/* This function writes the given structure to the TDET Control Register. param base TDET peripheral base address param config Pointer to structure with TDET peripheral configuration parameters return kStatus_Fail when writing to TDET Control Register is not allowed return kStatus_Success when operation completes successfully  */
status_t TDET_SetConfig(DIGTMP_Type *base, const tdet_config_t *config)
{
    uint32_t tmpCR;
    status_t retval = kStatus_Fail;
    if ((tdet_IsRegisterWriteAllowed(base, DIGTMP_LR_CRL_MASK)) && (config != NULL))
    {
        tmpCR = 0;
        tmpCR |= DIGTMP_CR_TFSR(config->tamperForceSystemResetEnable);
        tmpCR |= DIGTMP_CR_UM(config->updateMode);
        tmpCR |= DIGTMP_CR_ATCS0(config->clockSourceActiveTamper0);
        tmpCR |= DIGTMP_CR_ATCS1(config->clockSourceActiveTamper1);
        tmpCR |= DIGTMP_CR_DPR(config->prescaler);
        base->CR = tmpCR;
        if (config->innerClockAndPrescalerEnable)
        {
            base->CR = tmpCR | DIGTMP_CR_DEN_MASK;
        }
        retval = kStatus_Success;
    }
    else
    {
        retval = kStatus_Fail;
    }
    return retval;
}