sl_mpu.c File Reference
MPU API implementation.
- Version
- 1.0.0
License
(C) Copyright 2018 Silicon Labs, www.silabs.com
This file is licensed under the Silabs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.
       Definition in file
       
        sl_mpu.c
       
       .
      
       #include "em_device.h"
      
      
       #include "
       
        em_common.h
       
       "
      
      
       #include "
       
        em_core.h
       
       "
      
      
       #include "
       
        sl_mpu.h
       
       "
      
      
       #include <stdlib.h>
      
      
       #include <math.h>
      
      
| Functions | |
| static void | mpu_compute_region_data (uint32_t section_begin, uint32_t section_end, uint32_t section_size, uint32_t *mpu_region_begin, uint32_t *mpu_region_end, uint32_t *mpu_region_size) | 
| static uint8_t | mpu_region_size_encode (uint32_t region_size) | 
| static uint32_t | mpu_round_up_next_pwr2 (uint32_t nbr) | 
| void | sl_mpu_disable_execute (uint32_t address_begin, uint32_t address_end, uint32_t size) | 
| void | sl_mpu_disable_execute_from_ram (void) | 
| Variables | |
| uint32_t | __ram_func_section_end | 
| uint32_t | __ram_func_section_start | 
| static uint32_t | region_nbr = 0 | 
Function Documentation
| 
 | static | 
Compute region size.
- Parameters
- 
         section_beginSection begin address. section_endSection end address. section_sizeSize of section. mpu_region_beginPointer to a region begin variable. mpu_region_endPointer to a region end variable. mpu_region_sizePointer to a region size variable. 
        Definition at line
        
         299
        
        of file
        
         sl_mpu.c
        
        .
       
References mpu_round_up_next_pwr2() .
Referenced by sl_mpu_disable_execute() , and sl_mpu_disable_execute_from_ram() .
| 
 | static | 
Encode region size in RASR register REGION size field format.
- Parameters
- 
         region_sizeSize of region. 
        Definition at line
        
         277
        
        of file
        
         sl_mpu.c
        
        .
       
Referenced by sl_mpu_disable_execute() , and sl_mpu_disable_execute_from_ram() .
| 
 | static | 
Rounds up given number to next power of 2.
- Parameters
- 
         nbrNumber to round-up to next power of 2. 
        Definition at line
        
         257
        
        of file
        
         sl_mpu.c
        
        .
       
Referenced by mpu_compute_region_data() .