/* retval kStatus_Success Success to enable/disable the bandgap. retval kStatus_VBAT_Fro16kNotEnabled Fail to enable the bandgap due to FRO16k is not enabled previously.  */
status_t VBAT_EnableBandgap(VBAT_Type *base, bool enable)
/* retval kStatus_Success Success to enable/disable the bandgap. retval kStatus_VBAT_Fro16kNotEnabled Fail to enable the bandgap due to FRO16k is not enabled previously.  */
status_t VBAT_EnableBandgap(VBAT_Type *base, bool enable)
{
    status_t status = kStatus_Success;
    if (enable)
    {
        if (VBAT_CheckFRO16kEnabled(base))
        {
            base->LDOCTLA |= VBAT_LDOCTLA_BG_EN_MASK;
            base->LDOCTLB &= ~VBAT_LDOCTLA_BG_EN_MASK;
        }
        else
        {
            status = kStatus_VBAT_Fro16kNotEnabled;
        }
    }
    else
    {
        base->LDOCTLA &= ~VBAT_LDOCTLA_BG_EN_MASK;
        base->LDOCTLB |= VBAT_LDOCTLA_BG_EN_MASK;
    }
    return status;
}