#include "inc/hw_types.h"
#include "driverlib/5xx_6xx/mpu_a.h"
#include "deprecated/CCS/msp430xgeneric.h"
#include "driverlib/5xx_6xx/debug.h"
Functions | |
void | MPUA_createTwoSegments (unsigned int baseAddress, unsigned int seg1boundary, unsigned char seg1accmask, unsigned char seg2accmask) |
void | MPUA_createThreeSegments (unsigned int baseAddress, unsigned int seg1boundary, unsigned int seg2boundary, unsigned char seg1accmask, unsigned char seg2accmask, unsigned char seg3accmask) |
void | MPUA_enableNMIevent (unsigned int baseAddress) |
void | MPUA_start (unsigned int baseAddress) |
void | MPUA_enablePUCOnViolation (unsigned int baseAddress, unsigned int segment) |
void | MPUA_disablePUCOnViolation (unsigned int baseAddress, unsigned int segment) |
unsigned short | MPUA_getInterruptStatus (unsigned int baseAddress, unsigned int memAccFlag) |
unsigned short | MPUA_clearInterruptFlag (unsigned int baseAddress, unsigned int memAccFlag) |
unsigned short | MPUA_clearAllInterruptFlags (unsigned int baseAddress) |
void MPUA_createTwoSegments | ( | unsigned int | baseAddress, |
unsigned int | seg1boundary, | ||
unsigned char | seg1accmask, | ||
unsigned char | seg2accmask | ||
) |
This function creates two memory segmentations in FRAM allowing the user to set access right to each segment. To set the correct value for seg1boundary, the user must consult the Device Family User's Guide and provide the MPUSBx value corresponding to the memory address where the user wants to create the partition. For FR57xx device consult Table 6-1 in Section 6.2.2 of the User's Guide to find the options available for MPUSBx. For FR58xx/Fr59xx devices consult the "Segment Border Setting" section in the User's Guide to find the options available for MPUSBx
baseAddress | is the base address of the MPU module. |
seg1boundary | - Valid values can be found on the deviceFamily User's Guide Valid values Value in the following range 0x0400-0x13C0 |
seg1accmask | is the bit mask of access right for memory segment 1. the following bit masks are available: MPUA_EXEC|MPUA_READ|MPUA_WRITE.- For execution,read and write access rights [Default] MPUA_EXEC|MPUA_READ.- For execution and read access rights. READ|MPUA_WRITE.- For read and write access rights READ.- For read only access rights |
seg2accmask | is the bit mask of access right for memory segment 2. the following bit masks are available: MPUA_EXEC|MPUA_READ|MPUA_WRITE.- For execution,read and write access rights [Default] MPUA_EXEC|MPUA_READ.- For execution and read access rights. READ|MPUA_WRITE.- For read and write access rights READ.- For read only access rights |
Modified registers are MPUCTL0, MPUSEG, MPUSAM
References ASSERT, HWREG, MPUA_EXEC, MPUA_MAX_SEG_VALUE, MPUA_READ, and MPUA_WRITE.
void MPUA_createThreeSegments | ( | unsigned int | baseAddress, |
unsigned int | seg1boundary, | ||
unsigned int | seg2boundary, | ||
unsigned char | seg1accmask, | ||
unsigned char | seg2accmask, | ||
unsigned char | seg3accmask | ||
) |
This function creates three memory segmentations in FRAM allowing the user to set access right to each segment. To set the correct value for seg1boundary, the user must consult the Device Family User's Guide and provide the MPUSBx value corresponding to the memory address where the user wants to create the partition. Consult the "Segment Border Setting" section in the User's Guide to find the options available for MPUSBx
baseAddress | is the base address of the MPU module. |
seg1boundary | - Valid values can be found on the deviceFamily User's Guide Valid values Value in the following range 0x0400-0x13C0 |
seg2boundary | - Valid values can be found on the deviceFamily User's Guide Valid values Value in the following range 0x0400-0x13C0 |
seg1accmask | is the bit mask of access right for memory segment 1. the following bit masks are available: MPUA_EXEC|MPUA_READ|MPUA_WRITE.- For execution,read and write access rights [Default] MPUA_EXEC|MPUA_READ.- For execution and read access rights. READ|MPUA_WRITE.- For read and write access rights READ.- For read only access rights |
seg2accmask | is the bit mask of access right for memory segment 2. the following bit masks are available: MPUA_EXEC|MPUA_READ|MPUA_WRITE.- For execution,read and write access rights [Default] MPUA_EXEC|MPUA_READ.- For execution and read access rights. READ|MPUA_WRITE.- For read and write access rights READ.- For read only access rights |
seg3accmask | is the bit mask of access right for memory segment 1. the following bit masks are available: MPUA_EXEC|MPUA_READ|MPUA_WRITE.- For execution,read and write access rights [Default] MPUA_EXEC|MPUA_READ.- For execution and read access rights. READ|MPUA_WRITE.- For read and write access rights READ.- For read only access rights |
Modified registers are MPUCTL0, MPUSEG, MPUSAM
References ASSERT, HWREG, MPUA_EXEC, MPUA_MAX_SEG_VALUE, MPUA_READ, and MPUA_WRITE.
void MPUA_enableNMIevent | ( | unsigned int | baseAddress | ) |
The following function enables the NMI Event if a Segment violation has occurred.
baseAddress | is the base address of the MPU module. |
Modified register is MPUCTL0
References HWREG.
void MPUA_start | ( | unsigned int | baseAddress | ) |
The following function enables the MPU module in the device.
This function needs to be called once all memory segmentation has been done. If this function is not called the MPU module will not be activated.
baseAddress | is the base address of the MPU module. |
Modified register is MPUCTL0
References HWREG.
void MPUA_enablePUCOnViolation | ( | unsigned int | baseAddress, |
unsigned int | segment | ||
) |
The following function enables PUC generation when an access violation has Occurred on the memory segment selected by the user.
baseAddress | is the base address of the MPU module. |
segment | is the bit mask of memory segment that will generate a PUC when an access violation occurs. Valid values is the bit mask of any of the following values: MPUA_FIRST_SEG.- enables PUC generation on first memory segment. MPUA_SECOND_SEG.- enables PUC generation on second memory segment. MPUA_THIRD_SEG.- enables PUC generation on third memory segment. |
Modified registers are MPUCTL0, MPUSAM
References ASSERT, HWREG, MPUA_SECOND_SEG, and MPUA_THIRD_SEG.
void MPUA_disablePUCOnViolation | ( | unsigned int | baseAddress, |
unsigned int | segment | ||
) |
The following function isables PUC generation when an access violation has Occurred on the memory segment selected by the user.
baseAddress | is the base address of the MPU module. |
segment | is the bit mask of memory segment that will NOT generate a PUC when an access violation occurs. Valid values is the bit mask of any of the following values: MPUA_FIRST_SEG.- enables PUC generation on first memory segment. MPUA_SECOND_SEG.- enables PUC generation on second memory segment. MPUA_THIRD_SEG.- enables PUC generation on third memory segment. |
Modified registers are MPUCTL0, MPUSAM
References ASSERT, HWREG, MPU_SECOND_SEG, and MPU_THIRD_SEG.
unsigned short MPUA_getInterruptStatus | ( | unsigned int | baseAddress, |
unsigned int | memAccFlag | ||
) |
Returns the memory segment violation flag status requested by the user.
baseAddress | is the base address of the MPU module. |
memAccFlag | is the is the memory access violation flag. Valid value is the bit mask of any of the following value: MPUA_SEG_1_ACCESS_VIOLATION.- is set if an access violation in Main Memory Segment 1 is detected. MPUA_SEG_2_ACCESS_VIOLATION.- is set if an access violation in Main Memory Segment 2 is detected. MPUA_SEG_3_ACCESS_VIOLATION.- is set if an access violation in Main Memory Segment 3 is detected. |
References HWREG.
unsigned short MPUA_clearInterruptFlag | ( | unsigned int | baseAddress, |
unsigned int | memAccFlag | ||
) |
Returns the memory segment violation flag status requested by the user or if user is providing a bit mask value, the function will return a value indicating if all flags were cleared
baseAddress | is the base address of the MPU module. |
memAccFlag | is the is the memory access violation flag. Valid values for this function are: MPUSEG1IFG is set if an access violation in Main Memory Segment 1 is detected. MPUSEG2IFG is set if an access violation in Main Memory Segment 2 is detected. MPUSEG3IFG is set if an access violation in Main Memory Segment 3 is detected. |
References HWREG.
unsigned short MPUA_clearAllInterruptFlags | ( | unsigned int | baseAddress | ) |
Clears all Memory Segment Access Violation Interrupt Flags.
baseAddress | is the base address of the MPU module. |
Modified registers are MPUCTL1
References HWREG.