FuSa 8-Bit Libraries Safety Framework
Loading...
Searching...
No Matches
midware_power_manager.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <define_error_flags.h>
#include <xc.h>

Go to the source code of this file.

Enumerations

enum  sleepMode_t { SLP_MODE_IDLE = SLPCTRL_SMODE_IDLE_gc >> SLPCTRL_SMODE_gp , SLP_MODE_STANDBY = SLPCTRL_SMODE_STDBY_gc >> SLPCTRL_SMODE_gp , SLP_MODE_POWER_DOWN = SLPCTRL_SMODE_PDOWN_gc >> SLPCTRL_SMODE_gp , SLP_MODE_MAX }
 Type defines for available sleep modes. More...
enum  vlmThreshold_t {
  VLM_THRESHOLD_OFF = BOD_VLMLVL_OFF_gc >> BOD_VLMLVL_gp , VLM_THRESHOLD_PCT_5 = BOD_VLMLVL_5ABOVE_gc >> BOD_VLMLVL_gp , VLM_THRESHOLD_PCT_15 = BOD_VLMLVL_15ABOVE_gc >> BOD_VLMLVL_gp , VLM_THRESHOLD_PCT_25 = BOD_VLMLVL_25ABOVE_gc >> BOD_VLMLVL_gp ,
  VLM_THRESHOLD_MAX
}
 Type defines for available Voltage Level Monitor (VLM) threshold levels. More...
enum  vlmTrigger_t { VLM_TRIGGER_FALLING = BOD_VLMCFG_FALLING_gc >> BOD_VLMCFG_gp , VLM_TRIGGER_RISING = BOD_VLMCFG_RISING_gc >> BOD_VLMCFG_gp , VLM_TRIGGER_BOTH = BOD_VLMCFG_BOTH_gc >> BOD_VLMCFG_gp , VLM_TRIGGER_MAX }
 Type defines for available Voltage Level Monitor (VLM) trigger configurations. More...

Functions

errFlag_t MW_GetClearVlmError (void)
 Reads and clears the flag indicating a supply voltage trigger error detected by the Voltage Level Monitor in the Brown-out Detector (BOD).
errFlag_t MW_GetClearVmonOverError (void)
 Reads and clears the flag indicating an overvoltage error detected by the Voltage Monitor.
errFlag_t MW_GetClearVmonUnderError (void)
 Reads and clears the flag indicating an undervoltage error detected by the Voltage Monitor.
errFlag_t MW_GetClearVmonDiagEntryError (void)
 Reads and clears the flag indicating a Diagnostic Mode entry error in the Voltage Monitor.
errFlag_t MW_GetClearVmonDiagExitError (void)
 Reads and clears the flag indicating an Diagnostic Mode exit error in the Voltage Monitor.
errFlag_t MW_GetClearVmonInternalError (void)
 Reads and clears the flag indicating internal error in the Voltage Monitor.
errFlag_t MW_GetClearVmonSleepEntryError (void)
 Reads and clears the flag indicating a sleep mode entry error in the Voltage Monitor.
errFlag_t MW_GetClearVmonDisabledError (void)
 Reads and clears the flag indicating a disabled Voltage Monitor error.
errFlag_t MW_GetClearSleepError (void)
 Reads and clears the flag indicating a Sleep Aborted error in the Sleep Controller.
void MW_EnablePowerInterrupts (void)
 Enables power related interrupts, including VMON, VLM and sleep error related interrupts.
errFlag_t MW_ConfigVlm (vlmThreshold_t threshold, vlmTrigger_t trigger)
 Configures the Voltage Level Monitor (VLM) with the provided voltage threshold and trigger condition.
errFlag_t MW_SetSleepMode (sleepMode_t sleepMode)
 Sets the sleep mode to be used when entering Sleep.
void MW_SetVmonSleep (bool enableInSleep, bool useFullPowerMode)
 Configures Voltage Monitor (VMON) operation during Standby or Power-Down sleep.