39 const uint8_t vlmMask = (uint8_t)BOD_VLMIF_bm;
40 const bool isVlmError = ((regVal & vlmMask) == vlmMask);
55 const uint8_t vovMask = (uint8_t)SLPCTRL_VOV_bm;
56 const bool isVovError = ((regVal & vovMask) == vovMask);
71 const uint8_t vuvMask = (uint8_t)SLPCTRL_VUV_bm;
72 const bool isVuvError = ((regVal & vuvMask) == vuvMask);
87 const uint8_t vdenterMask = (uint8_t)SLPCTRL_VDENTER_bm;
88 const bool isVdenterError = ((regVal & vdenterMask) == vdenterMask);
103 const uint8_t vdexitMask = (uint8_t)SLPCTRL_VDEXIT_bm;
104 const bool isVdexitError = ((regVal & vdexitMask) == vdexitMask);
119 const uint8_t verrMask = (uint8_t)SLPCTRL_VERR_bm;
120 const bool isVerrError = ((regVal & verrMask) == verrMask);
135 const uint8_t vslpMask = (uint8_t)SLPCTRL_VSLP_bm;
136 const bool isVslpError = ((regVal & vslpMask) == vslpMask);
151 const uint8_t vdisMask = (uint8_t)SLPCTRL_VDIS_bm;
152 const bool isVdisError = ((regVal & vdisMask) == vdisMask);
167 const uint8_t serrMask = (uint8_t)SLPCTRL_SERR_bm;
168 const bool isSerrError = ((regVal & serrMask) == serrMask);
182 const uint8_t bodctrlIntMask = (uint8_t)BOD_VLMIE_bm;
183 const uint8_t slpctrlIntConfig = (uint8_t)SLPCTRL_VOV_bm | (uint8_t)SLPCTRL_VUV_bm
184 | (uint8_t)SLPCTRL_VDENTER_bm | (uint8_t)SLPCTRL_VDEXIT_bm
185 | (uint8_t)SLPCTRL_VERR_bm | (uint8_t)SLPCTRL_VSLP_bm
186 | (uint8_t)SLPCTRL_VDIS_bm | (uint8_t)SLPCTRL_SERR_bm;
202 const uint8_t regVal = (uint8_t)threshold << BOD_VLMLVL_gp;
205 const uint8_t groupConfig = (uint8_t)trigger << BOD_VLMCFG_gp;
219 const uint8_t groupConfig = (uint8_t)sleepMode << SLPCTRL_SMODE_gp;
227 uint8_t registerConfig = (uint8_t)SLPCTRL_PMODE_AUTO_gc;
229 if (useFullPowerMode)
231 registerConfig = (uint8_t)SLPCTRL_PMODE_FULL_gc;
236 registerConfig |= (uint8_t)SLPCTRL_VMONSEN_bm;
Defines error flag type for indicating detected errors in Middleware services.
errFlag_t
Defines the error flag used by Middleware services to indicate error detection.
void BODCTRL_WriteVlmControlA(uint8_t value)
Overwrites the VLMCTRLA register value.
void BODCTRL_SetIntControl(uint8_t bitmask)
Sets specific bits in the INTCTRL register.
void BODCTRL_WriteIntFlags(uint8_t value)
Overwrites the INTFLAGS register value.
uint8_t BODCTRL_ReadIntFlags(void)
Reads the INTFLAGS register value.
void BODCTRL_ModifyIntControl(uint8_t groupMask, uint8_t groupConfig)
Modifies specific bit field(s) in the INTCTRL register.
errFlag_t MW_GetClearVmonOverError(void)
Reads and clears the flag indicating an overvoltage error detected by the Voltage Monitor.
vlmTrigger_t
Type defines for available Voltage Level Monitor (VLM) trigger configurations.
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_GetClearVmonUnderError(void)
Reads and clears the flag indicating an undervoltage error detected by the Voltage Monitor.
vlmThreshold_t
Type defines for available Voltage Level Monitor (VLM) threshold levels.
errFlag_t MW_GetClearVlmError(void)
Reads and clears the flag indicating a supply voltage trigger error detected by the Voltage Level Mon...
errFlag_t MW_GetClearSleepError(void)
Reads and clears the flag indicating a Sleep Aborted error in the Sleep Controller.
void MW_SetVmonSleep(bool enableInSleep, bool useFullPowerMode)
Configures Voltage Monitor (VMON) operation during Standby or Power-Down sleep.
errFlag_t MW_GetClearVmonSleepEntryError(void)
Reads and clears the flag indicating a sleep mode entry 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_ConfigVlm(vlmThreshold_t threshold, vlmTrigger_t trigger)
Configures the Voltage Level Monitor (VLM) with the provided voltage threshold and trigger condition.
sleepMode_t
Type defines for available sleep modes.
errFlag_t MW_SetSleepMode(sleepMode_t sleepMode)
Sets the sleep mode to be used when entering Sleep.
void MW_EnablePowerInterrupts(void)
Enables power related interrupts, including VMON, VLM and sleep error related interrupts.
errFlag_t MW_GetClearVmonDisabledError(void)
Reads and clears the flag indicating a disabled Voltage Monitor error.
void SLPCTRL_ModifyControlA(uint8_t groupMask, uint8_t groupConfig)
Modifies specific bit field(s) in the CTRLA register.
void SLPCTRL_WriteVregControl(uint8_t value)
Overwrites the VREGCTRL register value.
void SLPCTRL_WriteIntFlags(uint8_t value)
Overwrites the INTFLAGS register value.
void SLPCTRL_WriteIntControl(uint8_t value)
Overwrites the INTCTRL register value.
uint8_t SLPCTRL_ReadIntFlags(void)
Reads the INTFLAGS register value.