Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

This section describes the programming interface of the LMEM Cache HAL driver.

Files

file  fsl_lmem_cache_hal.h
 

Macros

#define LMEM_CACHE_LINE_SIZE   0x10
 LMEM CACHE Line Size in bytes. More...
 

Enumerations

enum  lmem_cache_status_t { ,
  kStatus_LMEM_CACHE_Busy,
  kStatus_LMEM_CACHE_DemoteError,
  kStatus_LMEM_CACHE_Error
}
 Error codes for the LMEM CACHE driver. More...
 
enum  lmem_cache_mode_t {
  kCacheNonCacheable = 0x0U,
  kCacheWriteThrough = 0x2U,
  kCacheWriteBack = 0x3U
}
 LMEM CACHE mode options. More...
 
enum  lmem_cache_region_t {
  kCacheRegion0 = 0U,
  kCacheRegion1 = 1U,
  kCacheRegion2 = 2U,
  kCacheRegion3 = 3U,
  kCacheRegion4 = 4U,
  kCacheRegion5 = 5U,
  kCacheRegion6 = 6U,
  kCacheRegion7 = 7U,
  kCacheRegion8 = 8U,
  kCacheRegion9 = 9U,
  kCacheRegion10 = 10U,
  kCacheRegion11 = 11U,
  kCacheRegion12 = 12U,
  kCacheRegion13 = 13U,
  kCacheRegion14 = 14U,
  kCacheRegion15 = 15U
}
 LMEM CACHE Regions. More...
 
enum  lmem_cache_line_command_t {
  kCacheLineSearchReadOrWrite = 0U,
  kCacheLineInvalidate = 1U,
  kCacheLinePush = 2U,
  kCacheLineClear = 3U
}
 LMEM CACHE line command. More...
 

Processor Code Bus Cache Control

static void LMEM_HAL_SetCodeCacheEnableCmd (LMEM_Type *base, bool enable)
 Enables or disables the Processor Code bus cache and write buffer. More...
 
void LMEM_HAL_SetCodeCacheInvalidateAllCmd (LMEM_Type *base, bool enable)
 Enable or disable the Processor Code bus option to invalidate all lines. More...
 
void LMEM_HAL_SetCodeCachePushAllCmd (LMEM_Type *base, bool enable)
 Enable or disable the Processor Code bus option to push all modified lines. More...
 
void LMEM_HAL_SetCodeCacheClearAllCmd (LMEM_Type *base, bool enable)
 Enable or disable the Processor Code bus option to push and invalidate all modified lines. More...
 
static void LMEM_HAL_InitiateCodeCacheCommand (LMEM_Type *base)
 Initiate the Processor Code bus cache command. More...
 
static bool LMEM_HAL_IsCodeCacheCommandActive (LMEM_Type *base)
 Returns whether or not the Processor Code bus cache command is in progress. More...
 
static void LMEM_HAL_InitiateCodeCacheLineCommand (LMEM_Type *base)
 Initiate the Processor Code bus cache line command. More...
 
static bool LMEM_HAL_IsCodeCacheLineCommandActive (LMEM_Type *base)
 Returns whether or not the Processor Code bus cache line command is in progress. More...
 
static void LMEM_HAL_SetCodeCacheLineCommand (LMEM_Type *base, lmem_cache_line_command_t command)
 Sets the cache line command for the Processor Code bus. More...
 
static void LMEM_HAL_SetCodeCachePhysicalAddr (LMEM_Type *base, uint32_t addr)
 Sets the physical address for cache line commands for the Processor Code bus. More...
 
void LMEM_HAL_SetCodeCacheRegionMode (LMEM_Type *base, lmem_cache_region_t region, lmem_cache_mode_t cacheMode)
 Sets the cache mode for a specific region for the Processor Code bus. More...
 
uint32_t LMEM_HAL_GetCodeCacheRegionMode (LMEM_Type *base, lmem_cache_region_t region)
 Gets the current cache mode for a specific region for the Processor Code bus. More...
 

Macro Definition Documentation

#define LMEM_CACHE_LINE_SIZE   0x10

Cache line is 32 bytes (or 4-words)

Enumeration Type Documentation

Enumerator
kStatus_LMEM_CACHE_Busy 

CACHE busy performing an operation.

kStatus_LMEM_CACHE_DemoteError 

CACHE region demotion error.

kStatus_LMEM_CACHE_Error 

CACHE driver error.

Enumerator
kCacheNonCacheable 

CACHE mode: non-cacheable.

kCacheWriteThrough 

CACHE mode: write-through.

kCacheWriteBack 

CACHE mode: write-back.

Enumerator
kCacheRegion0 

Cache Region 0.

kCacheRegion1 

Cache Region 1.

kCacheRegion2 

Cache Region 2.

kCacheRegion3 

Cache Region 3.

kCacheRegion4 

Cache Region 4.

kCacheRegion5 

Cache Region 5.

kCacheRegion6 

Cache Region 6.

kCacheRegion7 

Cache Region 7.

kCacheRegion8 

Cache Region 8.

kCacheRegion9 

Cache Region 9.

kCacheRegion10 

Cache Region 10.

kCacheRegion11 

Cache Region 11.

kCacheRegion12 

Cache Region 12.

kCacheRegion13 

Cache Region 13.

kCacheRegion14 

Cache Region 14.

kCacheRegion15 

Cache Region 15.

Enumerator
kCacheLineSearchReadOrWrite 

Cache line search and read or write.

kCacheLineInvalidate 

Cache line invalidate.

kCacheLinePush 

Cache line push.

kCacheLineClear 

Cache line clear.

Function Documentation

static void LMEM_HAL_SetCodeCacheEnableCmd ( LMEM_Type *  base,
bool  enable 
)
inlinestatic

This function enables or disables the Processor Code bus cache and write buffer.

Parameters
baseModule base pointer of type LMEM_Type.
enableEnable (true) or disable (false) the Processor Code bus cache and write buffer
void LMEM_HAL_SetCodeCacheInvalidateAllCmd ( LMEM_Type *  base,
bool  enable 
)

This function enables or disables the Processor Code bus option to invalidate all lines in both WAYs.

Parameters
baseModule base pointer of type LMEM_Type.
enableEnable (true) or disable (false) the Processor Code bus option to invalidate all lines
void LMEM_HAL_SetCodeCachePushAllCmd ( LMEM_Type *  base,
bool  enable 
)

This function enables or disables the Processor Code bus option to push all modified lines to both WAYs.

Parameters
baseModule base pointer of type LMEM_Type.
enableEnable (true) or disable (false) the Processor Code bus option to push all modified lines
void LMEM_HAL_SetCodeCacheClearAllCmd ( LMEM_Type *  base,
bool  enable 
)

This function enables or disables the Processor Code bus option to push and invalidate all modified lines.

Parameters
baseModule base pointer of type LMEM_Type.
enableEnable (true) or disable (false) the Processor Code bus option to push all modified lines
static void LMEM_HAL_InitiateCodeCacheCommand ( LMEM_Type *  base)
inlinestatic

This function initiates the Processor Code bus cache command to execute an invalidate command and/or push command.

Parameters
baseModule base pointer of type LMEM_Type.
static bool LMEM_HAL_IsCodeCacheCommandActive ( LMEM_Type *  base)
inlinestatic

This function returns the state of the Processor Code bus cache command. The command is either active (in progress) or idle.

Parameters
baseModule base pointer of type LMEM_Type.
Returns
True if the cache command is in progress or false if the command is idle
static void LMEM_HAL_InitiateCodeCacheLineCommand ( LMEM_Type *  base)
inlinestatic

This function initiates the Processor Code bus cache line command to execute a search and read or write command, an invalidate command, a push command, or a clear command.

Parameters
baseModule base pointer of type LMEM_Type.
static bool LMEM_HAL_IsCodeCacheLineCommandActive ( LMEM_Type *  base)
inlinestatic

This function returns the state of the Processor Code bus cache line command. The command is either active (in progress) or idle.

Parameters
baseModule base pointer of type LMEM_Type.
Returns
True if the cache line command is in progress or false if the command is idle
static void LMEM_HAL_SetCodeCacheLineCommand ( LMEM_Type *  base,
lmem_cache_line_command_t  command 
)
inlinestatic

This function sets the cache line command for the Processor Code bus. The command can be search and read or write, invalidate, push, or clear.

Parameters
baseModule base pointer of type LMEM_Type.
commandThe cache line command of type lmem_cache_line_command_t
static void LMEM_HAL_SetCodeCachePhysicalAddr ( LMEM_Type *  base,
uint32_t  addr 
)
inlinestatic

This function sets the physical address for cache line commands for the Processor Code bus. The commands are specified in the CLCR[LADSEL] bits.

Parameters
baseModule base pointer of type LMEM_Type.
addrThe physical address for cache line commands
void LMEM_HAL_SetCodeCacheRegionMode ( LMEM_Type *  base,
lmem_cache_region_t  region,
lmem_cache_mode_t  cacheMode 
)

This function sets the cache mode for a specific region for the Processor Code bus. Note that you can only demote the cache mode.

Parameters
baseModule base pointer of type LMEM_Type.
regionThe region to demote the cache mode of type lmem_cache_region_t
cacheModeThe specified demoted cache mode of type lmem_cache_mode_t
uint32_t LMEM_HAL_GetCodeCacheRegionMode ( LMEM_Type *  base,
lmem_cache_region_t  region 
)

This function gets the current cache mode for a specific region for the Processor Code bus.

Parameters
baseModule base pointer of type LMEM_Type.
regionThe region to obtain the cache mode of type lmem_cache_region_t
Returns
The current cache mode for the specified region