mpu.h
Go to the documentation of this file.
00001 #ifndef __MSP430WARE_MPU_H__
00002 #define __MSP430WARE_MPU_H__
00003 
00004 //*****************************************************************************
00005 //
00006 //The following are the defines to include the required modules for this
00007 //peripheral in msp430xgeneric.h file
00008 //
00009 //*****************************************************************************
00010 #define __MSP430_HAS_MPU__
00011 
00012 //*****************************************************************************
00013 //
00014 //The following are values that can be passed to the MPU_createTwoSegments()
00015 //and MPU_createThreeSegments  function as the seg1accmask, seg2accmask and
00016 //seg3accmask parameter.
00017 //
00018 //*****************************************************************************
00019 
00020 #define MPU_READ                MPUSEG1RE
00021 #define MPU_WRITE               MPUSEG1WE
00022 #define MPU_EXEC                MPUSEG1XE
00023 
00024 //*****************************************************************************
00025 //
00026 //The following are values that can be passed to the MPU_createPUConViolation()
00027 //function as the segment parameter.
00028 //
00029 //*****************************************************************************
00030 #define MPU_FIRST_SEG           MPUSEG1VS
00031 #define MPU_SECOND_SEG          MPUSEG2VS
00032 #define MPU_THIRD_SEG           MPUSEG3VS
00033 
00034 
00035 //*****************************************************************************
00036 //
00037 //The following values are used to by createTwoSegments, createThreeSegments
00038 //to check the user has passed a valid segmentation value. This value was
00039 //obtained from the User's Guide
00040 //
00041 //*****************************************************************************
00042 #define MPU_MAX_SEG_VALUE                       0x20
00043 
00044 #define MPU_SEG_1_ACCESS_VIOLATION              MPUSEG1IFG
00045 #define MPU_SEG_2_ACCESS_VIOLATION              MPUSEG2IFG
00046 #define MPU_SEG_3_ACCESS_VIOLATION              MPUSEG3IFG
00047 
00048 //*****************************************************************************
00049 //
00050 //Prototypes for the APIs.
00051 //
00052 //*****************************************************************************
00053 extern void
00054 MPU_createTwoSegments
00055 (       unsigned int baseAddress,
00056         unsigned int seg2boundary,
00057         unsigned char seg1accmask,
00058         unsigned char seg2accmask
00059         );
00060 
00061 extern void
00062 MPU_createThreeSegments
00063 (       unsigned int baseAddress,
00064         unsigned int seg1boundary,
00065         unsigned int seg2boundary,
00066         unsigned char seg1accmask,
00067         unsigned char seg2accmask,
00068         unsigned char seg3accmask
00069         );
00070 
00071 extern void
00072 MPU_start
00073 (       unsigned int baseAddress
00074         );
00075 
00076 extern void
00077 MPU_enablePUCOnViolation
00078 (       unsigned int baseAddress,
00079         unsigned int segment
00080         );
00081 
00082 extern
00083 void
00084 MPU_disablePUCOnViolation(unsigned int baseAddress,
00085                 unsigned int segment
00086                 );
00087 
00088 extern unsigned short
00089 MPU_getInterruptStatus
00090 (       unsigned int baseAddress,
00091         unsigned int memAccFlag
00092         );
00093 
00094 extern unsigned short
00095 MPU_clearInterruptFlag
00096 (       unsigned int baseAddress,
00097         unsigned int memAccFlag
00098         );
00099 
00100 unsigned short
00101 MPU_clearAllInterruptFlags
00102 (       unsigned int baseAddress
00103         );
00104 
00105 #endif

Copyright 2012, Texas Instruments Incorporated