Atmel Software Framework

mpu.h File Reference
#include <avr32/io.h>
#include "compiler.h"

Data Structures

struct  mpu_entry_t
 

Macros

#define CAST(to, from)
 
#define MPU_APRA_ID   0
 MPU Access Permission Register A & B identifiers. More...
 
#define MPU_APRB_ID   1
 
#define MPU_PRIVR_UNPRIVNONE   AVR32_MPUAPRA_AP0_PRIV_R_UNPRIV_NONE
 MPU Access Permissions. More...
 
#define MPU_PRIVRX_UNPRIVNONE   AVR32_MPUAPRA_AP0_PRIV_RX_UNPRIV_NONE
 
#define MPU_PRIVRW_UNPRIVNONE   AVR32_MPUAPRA_AP0_PRIV_RW_UNPRIV_NONE
 
#define MPU_PRIVRWX_UNPRIVNONE   AVR32_MPUAPRA_AP0_PRIV_RWX_UNPRIV_NONE
 
#define MPU_PRIVR_UNPRIVR   AVR32_MPUAPRA_AP0_PRIV_R_UNPRIV_R
 
#define MPU_PRIVRX_UNPRIVRX   AVR32_MPUAPRA_AP0_PRIV_RX_UNPRIV_RX
 
#define MPU_PRIVRW_UNPRIVRW   AVR32_MPUAPRA_AP0_PRIV_RW_UNPRIV_RW
 
#define MPU_PRIVRWX_UNPRIVRWX   AVR32_MPUAPRA_AP0_PRIV_RWX_UNPRIV_RWX
 
#define MPU_PRIVRW_UNPRIVR   AVR32_MPUAPRA_AP0_PRIV_RW_UNPRIV_R
 
#define MPU_PRIVRW_UNPRIVRX   AVR32_MPUAPRA_AP0_PRIV_RW_UNPRIV_RX
 
#define MPU_PRIVNONE_UNPRIVNONE   AVR32_MPUAPRA_AP0_PRIV_NONE_UNPRIV_NONE
 
#define MPU_SETUP_ENTRY_OK   0
 MPU entry set up function (set_mpu_entry) return codes. More...
 
#define MPU_SETUP_ENTRY_INVALIDBASEADDR   1
 
#define MPU_SETUP_ENTRY_INVALIDSIZE   2
 

Enumerations

enum  eRegionSize {
  MPU_REGION_SIZE_LOWLIMIT_FORBIDDEN = 10,
  MPU_REGION_SIZE_4KB,
  MPU_REGION_SIZE_8KB,
  MPU_REGION_SIZE_16KB,
  MPU_REGION_SIZE_32KB,
  MPU_REGION_SIZE_64KB,
  MPU_REGION_SIZE_128KB,
  MPU_REGION_SIZE_256KB,
  MPU_REGION_SIZE_512KB,
  MPU_REGION_SIZE_1MB,
  MPU_REGION_SIZE_2MB,
  MPU_REGION_SIZE_4MB,
  MPU_REGION_SIZE_8MB,
  MPU_REGION_SIZE_16MB,
  MPU_REGION_SIZE_32MB,
  MPU_REGION_SIZE_64MB,
  MPU_REGION_SIZE_128MB,
  MPU_REGION_SIZE_256MB,
  MPU_REGION_SIZE_512MB,
  MPU_REGION_SIZE_1GB,
  MPU_REGION_SIZE_2GB,
  MPU_REGION_SIZE_4GB,
  MPU_REGION_SIZE_HIGHLIMIT_FORBIDDEN
}
 

Functions

void disable_mpu (void)
 Disable the memory protection unit. MPU address checking is disabled, no exceptions will be generated by the MPU. More...
 
void disable_mpu_entry (unsigned int region_number, unsigned int register_select)
 
void enable_mpu (void)
 Enable the memory protection unit. MPU address checking is enabled. More...
 
bool mpu_convert_kbsize_to_eregionsize (eRegionSize *peRegionSizeValue, U32 kBSizeValue)
 Converts an input region size expressed in kBytes to the corresponding eRegionSize type value. More...
 
void select_subregion (unsigned int region_number, unsigned int pattern_select)
 
void set_access_permissions (unsigned int region_number, unsigned int register_select, unsigned int right_access)
 
char set_mpu_entry (const mpu_entry_t *mpu_entry, unsigned int region_number)