/* Read the state of the voltage comparator. 
This function extracts the comparator state from the status register. */
bool am_hal_vcomp_read(void)
/* Read the state of the voltage comparator. 
This function extracts the comparator state from the status register. */
bool am_hal_vcomp_read(void)
{
    return (AM_BFR(VCOMP,  STAT, CMPOUT) == 1);
}