/* param base VBAT peripheral base address. param timeoutPeriod The bandgap timerout 1 period, in number of seconds, ranging from 0 to 65535s.  */
void VBAT_SetBandgapTimer1TimeoutValue(VBAT_Type *base, uint32_t timeoutPeriod)
/* param base VBAT peripheral base address. param timeoutPeriod The bandgap timerout 1 period, in number of seconds, ranging from 0 to 65535s.  */
void VBAT_SetBandgapTimer1TimeoutValue(VBAT_Type *base, uint32_t timeoutPeriod)
{
    bool timerEnabled = false;
    timerEnabled = ((base->LDOTIMER1 & VBAT_LDOTIMER1_TIMEN_MASK) != 0UL) ? true : false;
    if (timerEnabled)
    {
        base->LDOTIMER1 &= ~VBAT_LDOTIMER1_TIMEN_MASK;
    }
    base->LDOTIMER1 = ((base->LDOTIMER1 & (~VBAT_LDOTIMER1_TIMCFG_MASK)) | VBAT_LDOTIMER1_TIMCFG(timeoutPeriod));
    if (timerEnabled)
    {
        base->LDOTIMER1 |= VBAT_LDOTIMER1_TIMEN_MASK;
    }
}