RTEMS  5.1
Macros | Functions
efc.c File Reference
#include "chip.h"
#include <assert.h>

Macros

#define EEFC_FCR_FCMD(value)   ((EEFC_FCR_FCMD_Msk & ((value) << EEFC_FCR_FCMD_Pos)))
 

Functions

void EFC_WriteFMR (Efc *efc, uint32_t dwFmr)
 
 __attribute__ ((section(".ramfunc")))
 
void EFC_EnableFrdyIt (Efc *efc)
 Enables the flash ready interrupt source on the EEFC peripheral. More...
 
void EFC_DisableFrdyIt (Efc *efc)
 Disables the flash ready interrupt source on the EEFC peripheral. More...
 
void EFC_SetWaitState (Efc *efc, uint8_t ucCycles)
 Set read/write wait state on the EEFC peripheral. More...
 
uint32_t EFC_GetStatus (Efc *efc)
 Returns the current status of the EEFC. More...
 
uint32_t EFC_GetResult (Efc *efc)
 Returns the result of the last executed command. More...
 
void EFC_TranslateAddress (Efc **ppEfc, uint32_t dwAddress, uint16_t *pwPage, uint16_t *pwOffset)
 Translates the given address page and offset values. More...
 
void EFC_ComputeAddress (Efc *efc, uint16_t wPage, uint16_t wOffset, uint32_t *pdwAddress)
 Computes the address of a flash access given the page and offset. More...
 
uint32_t EFC_PerformCommand (Efc *efc, uint32_t dwCommand, uint32_t dwArgument, uint32_t dwUseIAP)
 Performs the given command and wait until its completion (or an error). More...
 
void EFC_SetFlashAccessMode (Efc *efc, uint32_t dwMode)
 Set flash access mode. More...
 

Detailed Description

Implementation of Enhanced Embedded Flash Controller (EEFC).

Function Documentation

◆ EFC_ComputeAddress()

void EFC_ComputeAddress ( Efc efc,
uint16_t  wPage,
uint16_t  wOffset,
uint32_t *  pdwAddress 
)

Computes the address of a flash access given the page and offset.

Parameters
efcPointer to a Efc instance
pagePage number.
offsetByte offset inside page.
pAddressComputed address (optional).

◆ EFC_DisableFrdyIt()

void EFC_DisableFrdyIt ( Efc efc)

Disables the flash ready interrupt source on the EEFC peripheral.

Parameters
efcPointer to a Efc instance

◆ EFC_EnableFrdyIt()

void EFC_EnableFrdyIt ( Efc efc)

Enables the flash ready interrupt source on the EEFC peripheral.

Parameters
efcPointer to a Efc instance

◆ EFC_GetResult()

uint32_t EFC_GetResult ( Efc efc)

Returns the result of the last executed command.

Parameters
efcPointer to a Efc instance

◆ EFC_GetStatus()

uint32_t EFC_GetStatus ( Efc efc)

Returns the current status of the EEFC.

Note
Keep in mind that this function clears the value of some status bits (LOCKE, PROGE).
Parameters
efcPointer to a Efc instance

◆ EFC_PerformCommand()

uint32_t EFC_PerformCommand ( Efc efc,
uint32_t  dwCommand,
uint32_t  dwArgument,
uint32_t  dwUseIAP 
)

Performs the given command and wait until its completion (or an error).

Parameters
efcPointer to a Efc instance
commandCommand to perform.
argumentOptional command argument.
Returns
0 if successful, otherwise returns an error code.

◆ EFC_SetFlashAccessMode()

void EFC_SetFlashAccessMode ( Efc efc,
uint32_t  dwMode 
)

Set flash access mode.

Parameters
dwMode- 0:128-bit, (1<<24):64-bit

◆ EFC_SetWaitState()

void EFC_SetWaitState ( Efc efc,
uint8_t  ucCycles 
)

Set read/write wait state on the EEFC peripheral.

Parameters
efcPointer to a Efc instance
cyclesthe number of wait states in cycle.

◆ EFC_TranslateAddress()

void EFC_TranslateAddress ( Efc **  ppEfc,
uint32_t  dwAddress,
uint16_t *  pwPage,
uint16_t *  pwOffset 
)

Translates the given address page and offset values.

Note
The resulting values are stored in the provided variables if they are not null.
Parameters
efcPointer to a Efc instance
addressAddress to translate.
pPageFirst page accessed.
pOffsetByte offset in first page.