📄 mif.h
字号:
// NAME : MIF_MifSetPowerDown
//
// DESCRIPTION : Switch on or off the internal EMIF clock
//
// SYNOPSYS : void MIF_MifSetPowerDown(BOOL GlobalPde, BOOL ImifPde)
//
// PARAMETERS : GlobalPde POWER_DOWN or NOT_POWER_DOWN
//
// ImifPde idem
//
// RETURN VALUE: None
//
// LIMITATIONS : None
//
//---------------------------------------------------------------------
void MIF_MifSetPowerDown(BOOL GlobalPde, BOOL ImifPde);
//---------------------------------------------------------------------
// NAME : MIF_MifGetPowerDown
// DESCRIPTION : get back the state of power down mode Switch on or off
// SYNOPSYS : BOOL MIF_MifSetPowerDown(void)
// PARAMETERS : None
// RETURN VALUE: State SWITCH_ON or SWITCH_OFF
// LIMITATIONS : None
//---------------------------------------------------------------------
BOOL MIF_MifGetPowerDown(void);
//---------------------------------------------------------------------
// NAME : MIF_MifSetWriteProtect
// DESCRIPTION : Set the write protect mode
// SYNOPSYS : void MIF_MifSetWriteProtect(BOOL State)
// PARAMETERS : State WRITE_FORBIDEN or WRITE_AUTHORIZED
// RETURN VALUE: None
// LIMITATIONS : None
//---------------------------------------------------------------------
void MIF_MifSetWriteProtect(BOOL State);
//---------------------------------------------------------------------
// NAME : MIF_MifGetWriteProtect
// DESCRIPTION : Get the write protect mode
// SYNOPSYS : BOOL MIF_MifGetWriteProtect(void)
// PARAMETERS : None
// RETURN VALUE: WRITE_FORBIDEN or WRITE_AUTHORIZED
// LIMITATIONS : None
//---------------------------------------------------------------------
BOOL MIF_MifGetWriteProtect(void);
//---------------------------------------------------------------------
// NAME : MIF_MifTestBootMode
// DESCRIPTION : Test if the flash is on CS0 or CS3
// SYNOPSYS : BOOL MIF_MifTestBootMode(void)
// PARAMETERS : None
// RETURN VALUE: FLASH_ON_CS0 or FLASH_ON_CS3
// LIMITATIONS : None
//---------------------------------------------------------------------
BOOL MIF_MifTestBootMode(void);
//---------------------------------------------------------------------
// NAME : MIF_MifSetBootMode
// DESCRIPTION : Test if the flash is on CS0 or CS3
// SYNOPSYS : void MIF_MifSetBootMode(BOOL)
// PARAMETERS : FLASH_ON_CS0 or FLASH_ON_CS3
// RETURN VALUE: None
// LIMITATIONS : None
//---------------------------------------------------------------------
void MIF_MifSetBootMode(BOOL State);
//---------------------------------------------------------------------
// NAME : MIF_MifTestFlashReady
// DESCRIPTION : Test if the flash package is ready
// SYNOPSYS : BOOL MIF_MifTestFlashReady(void)
// PARAMETERS : None
// RETURN VALUE: FLASH_READY or FLASH_NOT_READY
// LIMITATIONS : None
//---------------------------------------------------------------------
BOOL MIF_MifTestFlashReady(void);
//---------------------------------------------------------------------
// NAME : MIF_MifGetConfigReg
// DESCRIPTION : Get the value of the register
// SYNOPSYS : UWORD32 MIF_MifGetConfigReg(MIF_Slow_CS_Enum_t SlowChipSelect)
// PARAMETERS : SlowChipSelect MIF_Slow_nCS0
// MIF_Slow_nCS1
// MIF_Slow_nCS2
// MIF_Slow_nCS3
//
// RETURN VALUE: value of the register
// LIMITATIONS : None
//---------------------------------------------------------------------
UWORD32 MIF_MifGetConfigReg(MIF_Slow_CS_Enum_t SlowChipSelect);
/* When Enable the SDRAM is considered as IDLE and the SDRAM clock is not generated */
/* to prevent from wasting the limited battery energy power */
typedef enum { MIF_SELF_REFRESH_DISABLE = 0,
MIF_SELF_REFRESH_ENABLE = 1 } MIF_SelfRefreshToggle_t;
typedef enum { MIF_SDRAM_RETIMING_DISABLE = 0,
MIF_SDRAM_RETIMING_ENABLE = 1 } MIF_ReTiming_t;
typedef enum { MIF_AUTO_REFRESH_DISABLE = 0,
MIF_AUTO_REFRESH_ENABLE = 1,
MIF_AUTO_REFRESH_BURST_4 = 2,
MIF_AUTO_REFRESH_BURST_8 = 3 } MIF_AutoRefreshMode_t;
typedef enum { MIF_SDRAM_FREQ_0 = 0,
MIF_SDRAM_FREQ_1 = 1,
MIF_SDRAM_FREQ_2 = 2,
MIF_SDRAM_FREQ_3 = 3
} MIF_Sdram_Frequency_t;
typedef enum { MIF_POWER_DOWN_DISABLE = 0,
MIF_POWER_DOWN_ENABLE = 1 } MIF_PowerDownToggle_t;
typedef enum { MIF_SDRAM_CLOCK_ENABLE = 0,
MIF_SDRAM_CLOCK_DISABLE = 1 } MIF_ClockToggle_t;
/*
-----------------------------------------------------------------------------
NAME : MIF_InitFastInterfaceSDRAMConfigReg
DESCRIPTION : Initialize the register with the input arguments
PARAMETERS : ..........
retimed_disable => True when Not Retimed otherwise False
RETURN VALUE: None.
LIMITATIONS : None.
-----------------------------------------------------------------------------
*/
void MIF_InitFastInterfaceSdramConfigReg
(MIF_SelfRefreshToggle_t SelfRefreshToggle,
MIF_ReTiming_t ReTiming,
MIF_AutoRefreshMode_t AutoRefreshMode_t,
UWORD8 SdramType,
UWORD16 AutoRefreshCounter,
MIF_Sdram_Frequency_t Sdram_Frequency,
MIF_PowerDownToggle_t PowerDownToggle,
MIF_ClockToggle_t ClockToggle);
//------------------------------------------------------------------
// NAME : MIF_CheckFastInterfaceSdramConfigReg
// DESCRIPTION : check if Fast Interface Sdram Config Register is agree
// with expected parameters
// PARAMETERS :
// RETURN VALUE: True if ok else False
// LIMITATIONS : None.
//-----------------------------------------------------------------------------
BOOL MIF_CheckFastInterfaceSdramConfigReg
(MIF_SelfRefreshToggle_t SelfRefreshToggle,
MIF_ReTiming_t ReTiming,
MIF_AutoRefreshMode_t AutoRefreshMode,
UWORD8 SdramType,
UWORD16 AutoRefreshCounter,
MIF_Sdram_Frequency_t Sdram_Frequency,
MIF_PowerDownToggle_t PowerDownToggle,
MIF_ClockToggle_t ClockToggle);
/*
-----------------------------------------------------------------------------
NAME : MIF_InitFastInterfaceSdramMrsReg
DESCRIPTION : Initialize the register with the input arguments
PARAMETERS : CasLatency: latency between 1 and 3
=> True when Not Retimed otherwise False
RETURN VALUE: None.
LIMITATIONS : None.
-----------------------------------------------------------------------------
*/
typedef enum { MIF_CAS_LATENCY_1 = 1,
MIF_CAS_LATENCY_2 = 2,
MIF_CAS_LATENCY_3 = 3 } MIF_CasLatency_t;
void MIF_InitFastInterfaceSdramMrsReg(MIF_CasLatency_t CasLatency);
/*
==ASSEMBLER EXTERNAL FUNCTIONS
==The result is a 16 bits integer value returned inside R0 register
==under Thumb mode i.e. 16 bits mode state
*/
/*
-----------------------------------------------------------------------------
NAME : MIF_EnableDSPEndianismTranslation
DESCRIPTION : Switch on or off DSP endianism translation
PARAMETERS : State SWITCH_ON or SWITCH_OFF
RETURN VALUE: None.
LIMITATIONS : None.
-----------------------------------------------------------------------------
*/
void MIF_EnableDSPEndianismTranslation(BOOL State);
/*
-----------------------------------------------------------------------------
NAME : MIF_EnableDSPByteSwap
DESCRIPTION : Switch on or off DSP endianism translation Byte swap or Word swap
PARAMETERS : State SWITCH_ON or SWITCH_OFF
RETURN VALUE: None.
LIMITATIONS : None.
-----------------------------------------------------------------------------
*/
void MIF_EnableDSPByteSwap(BOOL State);
/*
---------------------------------------------------------------------------
NAME : w_8_16_32 -
DESCRIPTION : Write a word by word, half word and byte -
In each case, re-read it by word, half word and byte -
and check that the value is correct -
The 3 words are written to start, middle and end of memory -
space given in argument. -
PARAMETERS : -
INPUT => -
Addr : Start Address of the memory space to test -
Length: Length of the memory space -
RETURN VALUE: Result (0 for not-tried, 1 for OK, 2 for bad) -
LIMITATIONS : None. -
---------------------------------------------------------------------------
*/
extern int w_8_16_32 (int Addr, int Length);
/*
-----------------------------------------------------------------------------
NAME : multiple -
DESCRIPTION : Multiple store and load test -
PARAMETERS : Addr: Start Address of the memory space -
RETURN VALUE: Result (0 for not-tried, 1 for OK, 2 for bad) -
LIMITATIONS : None. -
-----------------------------------------------------------------------------
*/
extern int multiple (int Addr);
/*
-----------------------------------------------------------------------------
NAME : PrepareMultiple -
DESCRIPTION : Multiple store -
PARAMETERS : Addr: Start Address of the memory space -
RETURN VALUE: no return value
LIMITATIONS : None. -
-----------------------------------------------------------------------------
*/
extern void PrepareMultiple (int Addr);
/*
-----------------------------------------------------------------------------
NAME : ReadMultiple -
DESCRIPTION : Read the values stored by PrepareMultiple and test it -
PARAMETERS : Addr: Start Address of the memory space -
RETURN VALUE: Result (0 for not-tried, 1 for OK, 2 for bad) -
LIMITATIONS : None. -
-----------------------------------------------------------------------------
*/
extern int ReadMultiple (int Addr);
/*
-----------------------------------------------------------------------------
NAME : swap -
DESCRIPTION : Swap two memory addresses test -
PARAMETERS : Addr: Start Address of the memory space -
RETURN VALUE: Result (0 for not-tried, 1 for OK, 2 for bad) -
LIMITATIONS : None. -
-----------------------------------------------------------------------------
*/
extern int swap (int Addr);
/*
-----------------------------------------------------------------------------
NAME : str_ldr -
DESCRIPTION : Fast store/load back test -
PARAMETERS : Addr: Start Address of the memory space -
RETURN VALUE: Result (0 for not-tried, 1 for OK, 2 for bad) -
LIMITATIONS : None. -
-----------------------------------------------------------------------------
*/
extern int str_ldr (int Addr);
/*End MIF -------------------------------------------------------------*/
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -