![]() |
FuSa 8-Bit Libraries Safety Framework
|
Contains API prototypes for the Power Manager. More...
Files | |
| file | midware_power_manager.c |
| Implements APIs for the Power Manager. | |
| file | midware_power_manager_diag.h |
| Implements APIs for the Power Manager Diagnostics. | |
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. | |
| errFlag_t | MW_DiagVmonOverBegin (void) |
| Starts error injection diagnostic to detect faults in the VMON overvoltage detector. | |
| bool | MW_IsDiagVmonOverDone (void) |
| Checks if the VMON overvoltage error injection has been completed. | |
| errFlag_t | MW_DiagVmonOverEnd (void) |
| Completes error injection diagnostic to detect faults in the VMON overvoltage detector. | |
| errFlag_t | MW_DiagVmonUnderBegin (void) |
| Starts error injection diagnostic to detect faults in the VMON undervoltage detector. | |
| bool | MW_IsDiagVmonUnderDone (void) |
| Checks if the VMON undervoltage error injection has been completed. | |
| errFlag_t | MW_DiagVmonUnderEnd (void) |
| Completes error injection diagnostic to detect faults in the VMON undervoltage detector. | |
Contains API prototypes for the Power Manager.
The Power Manager provides services to Tasks to ensure correct interaction with features of the SLPCTRL and BODCTRL peripherals.
| enum sleepMode_t |
Type defines for available sleep modes.
| Enumerator | |
|---|---|
| SLP_MODE_IDLE | IDLE sleep mode |
| SLP_MODE_STANDBY | STANDBY sleep mode |
| SLP_MODE_POWER_DOWN | Power-Down sleep mode |
| SLP_MODE_MAX | Reserved value, indicates highest sleep mode value |
Definition at line 46 of file midware_power_manager.h.
| enum vlmThreshold_t |
Type defines for available Voltage Level Monitor (VLM) threshold levels.
Definition at line 60 of file midware_power_manager.h.
| enum vlmTrigger_t |
Type defines for available Voltage Level Monitor (VLM) trigger configurations.
Definition at line 75 of file midware_power_manager.h.
| errFlag_t MW_ConfigVlm | ( | vlmThreshold_t | threshold, |
| vlmTrigger_t | trigger ) |
Configures the Voltage Level Monitor (VLM) with the provided voltage threshold and trigger condition.
| threshold | VLM threshold level value. |
| trigger | Triggering value of VLM. |
| ERROR | Invalid threshold or trigger value. |
| NO_ERROR | Valid threshold or trigger value. |
Definition at line 192 of file midware_power_manager.c.
| errFlag_t MW_DiagVmonOverBegin | ( | void | ) |
Starts error injection diagnostic to detect faults in the VMON overvoltage detector.
This function starts a VMON overvoltage error injection diagnostic. The diagnostic must be completed by calling MW_DiagVmonOverEnd after MW_IsDiagVmonOverDone returns true. Because the error injection mechanism operates at a relatively slow speed (typically tens of microseconds or more), and its execution time can vary between devices and operating conditions, the diagnostic is designed to run asynchronously, independent of the CPU until completion.
| ERROR | Diagnostic failed to start due to illegal conditions or the diagnostic mode transition failed. |
| NO_ERROR | Diagnostic successfully started. |
Definition at line 66 of file midware_power_manager_diag.c.
| errFlag_t MW_DiagVmonOverEnd | ( | void | ) |
Completes error injection diagnostic to detect faults in the VMON overvoltage detector.
This function completes the diagnostic by checking the result of the error injection started by MW_DiagVmonOverBegin. It evaluates the results of the diagnostic and restores the original configurations of the VREGFAIL and VREGWARN error channels. It should be called after MW_IsDiagVmonOverDone returns true, indicating that the diagnostic has completed.
| ERROR | Fault detected in the VMON overvoltage detector or inappropriate function call. |
| NO_ERROR | No fault detected in the VMON overvoltage detector. |
Definition at line 80 of file midware_power_manager_diag.c.
| errFlag_t MW_DiagVmonUnderBegin | ( | void | ) |
Starts error injection diagnostic to detect faults in the VMON undervoltage detector.
This function starts a VMON undervoltage error injection diagnostic. The diagnostic must be completed by calling MW_DiagVmonUnderEnd after MW_IsDiagVmonUnderDone returns true. Because the error injection mechanism operates at a relatively slow speed (typically tens of microseconds or more), and its execution time can vary between devices and operating conditions, the diagnostic is designed to run asynchronously, independent of the CPU until completion.
| ERROR | Diagnostic failed to start due to illegal conditions or the diagnostic mode transition failed. |
| NO_ERROR | Diagnostic successfully started. |
Definition at line 87 of file midware_power_manager_diag.c.
| errFlag_t MW_DiagVmonUnderEnd | ( | void | ) |
Completes error injection diagnostic to detect faults in the VMON undervoltage detector.
This function completes the diagnostic by checking the result of the error injection started by MW_DiagVmonUnderBegin. It evaluates the results of the diagnostic and restores the original configurations of the VREGFAIL and VREGWARN error channels. It should be called after MW_IsDiagVmonUnderDone returns true, indicating that the diagnostic has completed.
| ERROR | Fault detected in the VMON undervoltage detector or inappropriate function call. |
| NO_ERROR | No fault detected in the VMON undervoltage detector. |
Definition at line 101 of file midware_power_manager_diag.c.
| errFlag_t MW_GetClearSleepError | ( | void | ) |
Reads and clears the flag indicating a Sleep Aborted error in the Sleep Controller.
This function checks whether the Sleep Aborted entry error interrupt flag has been set or not, and if set, it clears the flag and returns ERROR.
| ERROR | Sleep Aborted error flag set. |
| NO_ERROR | Sleep Aborted error flag not set. |
Definition at line 164 of file midware_power_manager.c.
| 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).
This function checks whether the VLM trigger interrupt flag has been set or not. And if set, clears the flag and returns ERROR.
| ERROR | VLM trigger error flag set. |
| NO_ERROR | VLM trigger error flag not set. |
Definition at line 36 of file midware_power_manager.c.
| errFlag_t MW_GetClearVmonDiagEntryError | ( | void | ) |
Reads and clears the flag indicating a Diagnostic Mode entry error in the Voltage Monitor.
This function checks whether the Diagnostic Mode entry error interrupt flag has been set or not, and if set, it clears the flag and returns ERROR.
| ERROR | Diagnostic mode entry error flag set. |
| NO_ERROR | Diagnostic mode entry error flag not set. |
Definition at line 84 of file midware_power_manager.c.
| errFlag_t MW_GetClearVmonDiagExitError | ( | void | ) |
Reads and clears the flag indicating an Diagnostic Mode exit error in the Voltage Monitor.
This function checks whether the Diagnostic Mode exit error interrupt flag has been set or not, and if set, it clears the flag and returns ERROR.
| ERROR | Diagnostic mode exit error flag set. |
| NO_ERROR | Diagnostic mode exit error flag not set. |
Definition at line 100 of file midware_power_manager.c.
| errFlag_t MW_GetClearVmonDisabledError | ( | void | ) |
Reads and clears the flag indicating a disabled Voltage Monitor error.
This function checks whether the VMON Disabled interrupt flag has been set or not, and if set, it clears the flag and returns ERROR.
| ERROR | Disabled Voltage Monitor error flag set. |
| NO_ERROR | Disabled Voltage Monitor error flag not set. |
Definition at line 148 of file midware_power_manager.c.
| errFlag_t MW_GetClearVmonInternalError | ( | void | ) |
Reads and clears the flag indicating internal error in the Voltage Monitor.
This function checks whether the VMON internal error interrupt flag has been set or not, and if set, it clears the flag and returns ERROR.
| ERROR | Internal error flag set. |
| NO_ERROR | Internal error flag not set. |
Definition at line 116 of file midware_power_manager.c.
| errFlag_t MW_GetClearVmonOverError | ( | void | ) |
Reads and clears the flag indicating an overvoltage error detected by the Voltage Monitor.
This function checks whether the overvoltage error interrupt flag has been set or not, and if set, it clears the flag and returns ERROR.
| ERROR | Overvoltage error flag set. |
| NO_ERROR | Overvoltage error flag not set. |
Definition at line 52 of file midware_power_manager.c.
| errFlag_t MW_GetClearVmonSleepEntryError | ( | void | ) |
Reads and clears the flag indicating a sleep mode entry error in the Voltage Monitor.
This function checks whether the Sleep Mode entry error interrupt flag has been set or not, and if set, it clears the flag and returns ERROR.
| ERROR | Enter Sleep Mode error flag set. |
| NO_ERROR | Enter Sleep Mode error flag not set. |
Definition at line 132 of file midware_power_manager.c.
| errFlag_t MW_GetClearVmonUnderError | ( | void | ) |
Reads and clears the flag indicating an undervoltage error detected by the Voltage Monitor.
This function checks whether the undervoltage error interrupt flag has been set or not, and if set, it clears the flag and returns ERROR.
| ERROR | Undervoltage error flag set. |
| NO_ERROR | Undervoltage error flag not set. |
Definition at line 68 of file midware_power_manager.c.
| bool MW_IsDiagVmonOverDone | ( | void | ) |
Checks if the VMON overvoltage error injection has been completed.
This function checks the status of the VMON overvoltage error injection to determine whether the diagnostic can be completed. This is done by checking if the error injection was started in the first place, and then if the result is ready for evaluation by MW_DiagVmonOverEnd, indicating that the injected error has been detected by the VMON.
| true | The VMON overvoltage error injection is finished and ready for evaluation. |
| false | The error injection is not finished or was never started. |
Definition at line 73 of file midware_power_manager_diag.c.
| bool MW_IsDiagVmonUnderDone | ( | void | ) |
Checks if the VMON undervoltage error injection has been completed.
This function checks the status of the VMON undervoltage error injection to determine whether the diagnostic can be completed. This is done by checking if the error injection was started in the first place, and then if the result is ready for evaluation by MW_DiagVmonUnderEnd, indicating that the injected error has been detected by the VMON.
| true | The VMON undervoltage error injection is finished and ready for evaluation. |
| false | The error injection is not finished or was never started. |
Definition at line 94 of file midware_power_manager_diag.c.
| errFlag_t MW_SetSleepMode | ( | sleepMode_t | sleepMode | ) |
Sets the sleep mode to be used when entering Sleep.
| sleepMode | The sleep mode that will be used when the device enters sleep. |
| ERROR | Invalid sleepMode value. |
| NO_ERROR | Valid sleepMode value. |
Definition at line 211 of file midware_power_manager.c.
| void MW_SetVmonSleep | ( | bool | enableInSleep, |
| bool | useFullPowerMode ) |
Configures Voltage Monitor (VMON) operation during Standby or Power-Down sleep.
| enableInSleep | Configures whether or not the VMON is enabled in Standby or Power-Down sleep. |
| useFullPowerMode | Configures whether the VMON uses Full Power Mode or Auto Mode. |
Definition at line 225 of file midware_power_manager.c.