|
| void | SUPC_EnableInterrupt (uint32_t interrupt_mask) |
| | Enable selected SUPC interrupts.
|
| |
| void | SUPC_DisableInterrupt (uint32_t interrupt_mask) |
| | Disable selected SUPC interrupts.
|
| |
| void | SUPC_BODVDD_Enable (void) |
| | Enable the Brown-Out Detector on VDD (BODVDD).
|
| |
| void | SUPC_BODVDD_Disable (void) |
| | Disable the Brown-Out Detector on VDD (BODVDD).
|
| |
| void | SUPC_BODVDD_SetLevel (uint32_t bod_level) |
| | Set BODVDD threshold level (must be called when BODVDD is disabled).
|
| |
| void | SUPC_BODVDD_SetAction (uint32_t bod_action) |
| | Set BODVDD action (must be called when BODVDD is disabled).
|
| |
| void | SUPC_BODVDD_EnableHysteresis (uint32_t enable) |
| | Enable or disable BODVDD hysteresis (must be called when BODVDD is disabled).
|
| |
| void | SUPC_BODVDD_SetMode (uint32_t act_cfg, uint32_t stdby_cfg) |
| | Set BODVDD mode (active and standby) (must be called when BODVDD is disabled). If both actcfg and stdbycfg are disabled, BODVDD operates in continuous mode. If both actcfg and stdbycfg are enabled, BODVDD operates in sample mode.
|
| |
| void | SUPC_BODVDD_EnableRunInStandby (uint32_t enable) |
| | Enable or disable BODVDD run in standby (must be called when BODVDD is disabled).
|
| |
| void | SUPC_BODVDD_SetPrescaler (uint32_t prescaler) |
| | Set BODVDD prescaler (must be called when BODVDD is disabled).
|
| |
| void | SUPC_VREG_Configure (uint32_t enable, uint32_t run_stdby) |
| | Configure the main voltage regulator (VREG).
|
| |
| void | SUPC_VREF_Configure (uint32_t sel, uint32_t vref_oe, uint32_t run_stdby, uint32_t on_demand) |
| | Configure the reference voltage (VREF) for ADC/DAC.
|
| |
| void | SUPC_SetCallbackHandler (SUPC_CALLBACK_HANDLER callback) |
| | Register a callback handler for SUPC interrupts.
|
| |
| bool | SUPC_BODVDD_IsReady (void) |
| | Check if BODVDD is ready for use/configuration.
|
| |
| bool | SUPC_BODVDD_IsDetected (void) |
| | Check if a brown-out is currently detected (VDD below threshold).
|
| |
| bool | SUPC_BODVDD_IsSyncReady (void) |
| | Check if BODVDD enable/disable/configuration is synchronized.
|
| |
#include <stdint.h>
#include <stdbool.h>
void SUPC_Callback(uint32_t int_cause)
{
if ((int_cause & SUPC_INTENSET_BODVDDDET_Msk) != 0U)
{
}
}
int configure_supc(void)
{
SUPC_VREF_SEL_1V024_Val,
);
return 0;
}
#define SUPC_BODVDD_STDBYCFG_DISABLE
Definition plib_supc.h:62
void SUPC_BODVDD_Enable(void)
Enable the Brown-Out Detector on VDD (BODVDD).
#define SUPC_VREG_RUNSTDBY_DISABLE
Definition plib_supc.h:72
void SUPC_BODVDD_SetMode(uint32_t act_cfg, uint32_t stdby_cfg)
Set BODVDD mode (active and standby) (must be called when BODVDD is disabled). If both actcfg and std...
void SUPC_BODVDD_SetAction(uint32_t bod_action)
Set BODVDD action (must be called when BODVDD is disabled).
void SUPC_VREF_Configure(uint32_t sel, uint32_t vref_oe, uint32_t run_stdby, uint32_t on_demand)
Configure the reference voltage (VREF) for ADC/DAC.
#define SUPC_VREG_ENABLE_VAL
Definition plib_supc.h:69
void SUPC_BODVDD_SetLevel(uint32_t bod_level)
Set BODVDD threshold level (must be called when BODVDD is disabled).
void SUPC_VREG_Configure(uint32_t enable, uint32_t run_stdby)
Configure the main voltage regulator (VREG).
void SUPC_BODVDD_EnableRunInStandby(uint32_t enable)
Enable or disable BODVDD run in standby (must be called when BODVDD is disabled).
void SUPC_BODVDD_Disable(void)
Disable the Brown-Out Detector on VDD (BODVDD).
#define SUPC_VREF_VREFOE_DISABLE
Definition plib_supc.h:76
void SUPC_BODVDD_SetPrescaler(uint32_t prescaler)
Set BODVDD prescaler (must be called when BODVDD is disabled).
#define SUPC_VREF_ONDEMAND_DISABLE
Definition plib_supc.h:78
#define SUPC_BODVDD_ACTCFG_DISABLE
Definition plib_supc.h:60
#define SUPC_BODVDD_RUNSTDBY_DISABLE
Definition plib_supc.h:64
void SUPC_BODVDD_EnableHysteresis(uint32_t enable)
Enable or disable BODVDD hysteresis (must be called when BODVDD is disabled).
void SUPC_SetCallbackHandler(SUPC_CALLBACK_HANDLER callback)
Register a callback handler for SUPC interrupts.
#define SUPC_VREF_RUNSTDBY_DISABLE
Definition plib_supc.h:80
#define SUPC_BODVDD_HYST_ENABLE
Definition plib_supc.h:65
| void SUPC_BODVDD_SetLevel |
( |
uint32_t | bod_level | ) |
|
Set BODVDD threshold level (must be called when BODVDD is disabled).
- Parameters
-
| bod_level | Threshold value (use macro SUPC_BODVDD_LEVEL(value)). |
The BODVDD LEVEL field [5:0] and HYST field determine the typical voltage threshold. See the table below for example values:
| LEVEL (hex) | HYST | Typical Threshold (V) |
| 0x00 | 0 | 2.37 |
| 0x08 | 0 | 2.74 |
| 0x08 | 1 | 2.94 |
| 0x3F | 0 | 5.48 |
| 0x3F | 1 | 5.57 |
@usage Set BODVDD threshold to 2.74V (LEVEL=0x08, HYST=0) SUPC_BODVDD_SetLevel(SUPC_BODVDD_LEVEL(0x08)); SUPC_BODVDD_EnableHysteresis(SUPC_BODVDD_HYST_DISABLE);
Set BODVDD threshold to 2.94V (LEVEL=0x08, HYST=1) SUPC_BODVDD_SetLevel(SUPC_BODVDD_LEVEL(0x08)); SUPC_BODVDD_EnableHysteresis(SUPC_BODVDD_HYST_ENABLE);