Synergy Software Package User's Manual

Functions

void R_BSP_RegisterProtectEnable (bsp_reg_protect_t regs_to_protect)
 Enable register protection. Registers that are protected cannot be written to. Register protection is enabled by using the Protect Register (PRCR) and the MPC's Write-Protect Register (PWPR). More...
 
void R_BSP_RegisterProtectDisable (bsp_reg_protect_t regs_to_unprotect)
 Disable register protection. Registers that are protected cannot be written to. Register protection is disabled by using the Protect Register (PRCR) and the MPC's Write-Protect Register (PWPR). More...
 
void bsp_register_protect_open (void)
 Initializes variables needed for register protection functionality. More...
 

Detailed Description

Important registers are write protected. This module provides APIs for configuring the protection of these registers. Reference counters are used to ensure proper operation.

Function Documentation

◆ bsp_register_protect_open()

void bsp_register_protect_open ( void  )

Initializes variables needed for register protection functionality.

Initialize reference counters to 0.

◆ R_BSP_RegisterProtectDisable()

void R_BSP_RegisterProtectDisable ( bsp_reg_protect_t  regs_to_unprotect)

Disable register protection. Registers that are protected cannot be written to. Register protection is disabled by using the Protect Register (PRCR) and the MPC's Write-Protect Register (PWPR).

Parameters
[in]regs_to_unprotectRegisters which have write protection disabled.

Get/save the current state of interrupts

Disable protection using PRCR register.

When writing to the PRCR register the upper 8-bits must be the correct key. Set lower bits to 0 to disable writes.

Increment the protect counter

Restore the interrupt state

◆ R_BSP_RegisterProtectEnable()

void R_BSP_RegisterProtectEnable ( bsp_reg_protect_t  regs_to_protect)

Enable register protection. Registers that are protected cannot be written to. Register protection is enabled by using the Protect Register (PRCR) and the MPC's Write-Protect Register (PWPR).

Parameters
[in]regs_to_protectRegisters which have write protection enabled.

Get/save the current state of interrupts

Enable protection using PRCR register.

When writing to the PRCR register the upper 8-bits must be the correct key. Set lower bits to 0 to disable writes.

Restore the interrupt state