The Power-fail comparator provides the MCU with an early warning of impending power failure. A flag wil be raised when the system supply voltage is below a configurable threshold voltage.
Enumeration Type Documentation
An enum used for different POF thresholds.
- Enumerator:
HAL_POF_THRESHOLD_2_1V |
|
HAL_POF_THRESHOLD_2_3V |
|
HAL_POF_THRESHOLD_2_5V |
|
HAL_POF_THRESHOLD_2_7V |
|
Definition at line 34 of file hal_pof.h.
Function Documentation
void hal_pof_enable |
( |
_Bool |
enable ) |
|
Function to enable or disable the Power-fail comparator
- Parameters:
-
enable | Boolean value. True = enable, false = disable. |
Definition at line 21 of file hal_pof.c.
Function setting the threshold voltage for the Power-fail comparator
- Parameters:
-
threshold | selects the threshold for the Power-fail comparator
- HAL_POF_THRESHOLD_2_1V
- HAL_POF_THRESHOLD_2_3V
- HAL_POF_THRESHOLD_2_5V
- HAL_POF_THRESHOLD_2_7V
|
Definition at line 29 of file hal_pof.c.
_Bool hal_pof_warning |
( |
void |
) |
|
Checks for low voltage warning from the Power-fail comparator
Definition at line 35 of file hal_pof.c.
{
if(POFCON & 0x10)
return true;
else
return false;
}