FuSa 8-Bit Libraries Safety Framework
Loading...
Searching...
No Matches
driver_bodctrl.c
Go to the documentation of this file.
1
22
23// Framework Includes
24#include <driver_bodctrl.h>
25
26// Device-specific Includes
27#include <xc.h>
28
29void BODCTRL_WriteVlmControlA(uint8_t value)
30{
31 BOD.VLMCTRLA = value;
32}
33
34void BODCTRL_SetIntControl(uint8_t bitmask)
35{
36 BOD.INTCTRL |= bitmask;
37}
38
39void BODCTRL_ModifyIntControl(uint8_t groupMask, uint8_t groupConfig)
40{
41 const uint8_t currentValue = BOD.INTCTRL;
42 const uint8_t clearedConfig = currentValue & (uint8_t)(~groupMask);
43 const uint8_t newConfig = groupConfig & groupMask;
44 const uint8_t updatedValue = clearedConfig | newConfig;
45
46 BOD.INTCTRL = updatedValue;
47}
48
50{
51 return BOD.INTFLAGS;
52}
53
54void BODCTRL_WriteIntFlags(uint8_t value)
55{
56 BOD.INTFLAGS = value;
57}
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.