/* param base VBAT peripheral base address. param timeoutPeriod Bandgap timer timeout value, please refer to vbat_bandgap_timer0_timeout_period_t.  */
void VBAT_SetBandgapTimer0TimeoutValue(VBAT_Type *base, vbat_bandgap_timer0_timeout_period_t timeoutPeriod)
/* param base VBAT peripheral base address. param timeoutPeriod Bandgap timer timeout value, please refer to vbat_bandgap_timer0_timeout_period_t.  */
void VBAT_SetBandgapTimer0TimeoutValue(VBAT_Type *base, vbat_bandgap_timer0_timeout_period_t timeoutPeriod)
{
    bool timerEnabled = false;
    timerEnabled = ((base->LDOTIMER0 & VBAT_LDOTIMER0_TIMEN_MASK) != 0UL) ? true : false;
    if (timerEnabled)
    {
        base->LDOTIMER0 &= ~VBAT_LDOTIMER0_TIMEN_MASK;
    }
    base->LDOTIMER0 = ((base->LDOTIMER0 & (~VBAT_LDOTIMER0_TIMCFG_MASK)) | VBAT_LDOTIMER0_TIMCFG(timeoutPeriod));
    if (timerEnabled)
    {
        base->LDOTIMER0 |= VBAT_LDOTIMER0_TIMEN_MASK;
    }
}