FuSa 8-Bit Libraries Safety Framework
Loading...
Searching...
No Matches
driver_cpuint.c
Go to the documentation of this file.
1
22
23// Framework Includes
24#include <driver_ccp_asm.h>
25#include <driver_cpuint.h>
26
27// Device-specific Includes
28#include <xc.h>
29
30void CPUINT_SetControlA(uint8_t bitmask)
31{
32 const uint8_t currentValue = CPUINT.CTRLA;
33 const uint8_t updatedValue = currentValue | bitmask;
34 ASM_WriteCcp8(&CPUINT.CTRLA, updatedValue);
35}
36
37void CPUINT_ClearControlA(uint8_t bitmask)
38{
39 const uint8_t currentValue = CPUINT.CTRLA;
40 const uint8_t updatedValue = currentValue & (uint8_t)(~bitmask);
41 ASM_WriteCcp8(&CPUINT.CTRLA, updatedValue);
42}
43
44void CPUINT_WriteIntPriority0(uint8_t value)
45{
46 CPUINT.LVL0PRI = value;
47}
48
49void CPUINT_WriteIntPriority1(uint8_t value)
50{
51 CPUINT.LVL1VEC = value;
52}
void ASM_WriteCcp8(register8_t *regAddr, uint8_t value)
Writes value to a Configuration Change Protected (CCP) 8-bit register.
void CPUINT_ClearControlA(uint8_t bitmask)
Clears specific bits in the CTRLA register.
void CPUINT_SetControlA(uint8_t bitmask)
Sets specific bits in the CTRLA register.
void CPUINT_WriteIntPriority0(uint8_t value)
Overwrites the LVL0PRI register value.
void CPUINT_WriteIntPriority1(uint8_t value)
Overwrites the LVL1VEC register value.