📄 csl_emifa.h
字号:
/** Interrupt Mask Set Register */
volatile Uint32 INTMSKSET;
/** Interrupt Mask Clear Register */
volatile Uint32 INTMSKCLR;
/** Burst Priority Register */
volatile Uint32 BPRIO;
} CSL_EmifaConfig;
/** @brief Enumeration for queries passed to @a CSL_emifaGetHwStatus()
* This is used to get the status of different operations
*/
typedef enum {
/**
* @brief Get the EMIFA module ID and revision numbers
*
* @param (CSL_EmifaModIdRev *)
*/
CSL_EMIFA_QUERY_REV_ID = 0,
/**
* @brief Get Asynchronous Timeout status ie enabled or not
*
* @param (Uint8 *)
*/
CSL_EMIFA_QUERY_ASYNC_TIMEOUT_EN,
/**
* @brief Get Asynchronous Timeout status in Interrupt Raw register
*
* @param (Uint8 *)
*/
CSL_EMIFA_QUERY_ASYNC_TIMEOUT_STATUS,
/**
* @brief Gets the EMIFA EMIF Endianness
*
* @param (Uint8 *)
*/
CSL_EMIFA_QUERY_ENDIAN
} CSL_EmifaHwStatusQuery;
/**
* @brief Enumeration for commands passed to @a CSL_emifaHwControl()
*
* This is used to select the commands to control the operations
* existing setup of EMIFA. The arguments to be passed with each
* enumeration if any are specified next to the enumeration.
*/
typedef enum {
/**
* @brief Clears Asyn Timeout interrupt
*
* @param (None)
*/
CSL_EMIFA_CMD_ASYNC_TIMEOUT_CLEAR = 0,
/**
* @brief Disables Asyn Timeout interrupt
*
* @param (None)
*/
CSL_EMIFA_CMD_ASYNC_TIMEOUT_DISABLE,
/**
* @brief Enables Asyn Timeout interrupt
*
* @param (None)
*/
CSL_EMIFA_CMD_ASYNC_TIMEOUT_ENABLE,
/**
* @brief Number of memory transfers after which the EMIFA
* momentarily raises the priority of old commands in the VBUSM
* Command FIFO
* @param (Uint8 *)
*/
CSL_EMIFA_CMD_PRIO_RAISE
} CSL_EmifaHwControlCmd;
/** @brief The defaults of EMIFA Async Wait structure */
#define CSL_EMIFA_ASYNCWAIT_DEFAULTS {\
(CSL_EmifaArdyPol)CSL_EMIFA_ARDYPOL_HIGH, \
(Uint8)CSL_EMIFA_ASYNCWAIT_MAXEXTWAIT_DEFAULT, \
(Uint8)CSL_EMIFA_ASYNCWAIT_TURNARND_DEFAULT \
}
/** @brief The defaults of EMIFA CEConfig for Async structure */
#define CSL_EMIFA_ASYNCCFG_DEFAULTS {\
(Uint8)CSL_EMIFA_ASYNCCFG_SELECTSTROBE_DEFAULT, \
(Uint8)CSL_EMIFA_ASYNCCFG_WEMODE_DEFAULT, \
(Uint8)CSL_EMIFA_ASYNCCFG_ASYNCRDYEN_DEFAULT, \
(Uint8)CSL_EMIFA_ASYNCCFG_WSETUP_DEFAULT, \
(Uint8)CSL_EMIFA_ASYNCCFG_SSTROBE_DEFAULT, \
(Uint8)CSL_EMIFA_ASYNCCFG_WHOLD_DEFAULT,\
(Uint8)CSL_EMIFA_ASYNCCFG_RSETUP_DEFAULT, \
(Uint8)CSL_EMIFA_ASYNCCFG_RSTROBE_DEFAULT, \
(Uint8)CSL_EMIFA_ASYNCCFG_RHOLD_DEFAULT, \
(Uint8)CSL_EMIFA_ASYNCCFG_ASIZE_DEFAULT \
}
/** @brief The defaults of EMIFA CEConfig for Sync structure */
#define CSL_EMIFA_SYNCCFG_DEFAULTS {\
(Uint8)CSL_EMIFA_SYNCCFG_READBYTEEN_DEFAULT, \
(Uint8)CSL_EMIFA_SYNCCFG_CHIPENEXT_DEFAULT, \
(Uint8)CSL_EMIFA_SYNCCFG_READEN_DEFAULT, \
(Uint8)CSL_EMIFA_SYNCCFG_WLTNCY_DEFAULT, \
(Uint8)CSL_EMIFA_SYNCCFG_RLTNCY_DEFAULT, \
(Uint8)CSL_EMIFA_SYNCCFG_SBSIZE_DEFAULT \
}
/** @brief The default Config structure */
#define CSL_EMIFA_CONFIG_DEFAULTS { \
(Uint32)CSL_EMIFA_CE2CFG_SSEL0_RESETVAL, \
(Uint32)CSL_EMIFA_CE3CFG_SSEL0_RESETVAL, \
(Uint32)CSL_EMIFA_CE4CFG_SSEL0_RESETVAL, \
(Uint32)CSL_EMIFA_CE5CFG_SSEL0_RESETVAL, \
(Uint32)CSL_EMIFA_AWCC_RESETVAL, \
(Uint32)CSL_EMIFA_INTRAW_RESETVAL, \
(Uint32)CSL_EMIFA_INTMSK_RESETVAL, \
(Uint32)CSL_EMIFA_INTMSKSET_RESETVAL, \
(Uint32)CSL_EMIFA_INTMSKCLR_RESETVAL, \
(Uint32)CSL_EMIFA_BPRIO_RESETVAL \
}
/******************************************************************************
EMIFA global function declarations
******************************************************************************
*/
/** ============================================================================
* @n@b CSL_emifaInit
*
* @b Description
* @n This function is idempotent i.e. calling it many times is same as calling
* it once. This function presently does nothing.
*
* @b Arguments
@verbatim
pContext Context information for the instance. Should be NULL
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Always returns
*
* <b> Pre Condition </b>
* @n This function should be called before using any of the CSL APIs
*
* <b> Post Condition </b>
* @n None
*
* @b Modifies
* @n None
*
* @b Example
* @verbatim
...
CSL_emifaInit( NULL );
...
}
@endverbatim
*
* =============================================================================
*/
CSL_Status CSL_emifaInit (
CSL_EmifaContext *pContext
);
/** ============================================================================
* @n@b CSL_emifaOpen
*
* @b Description
* @n This function populates the peripheral data object for the EMIFA
* instance and returns a handle to the instance.
* The open call sets up the data structures for the particular instance
* of EMIFA device. The device can be re-opened anytime after it has been
* normally closed if so required. The handle returned by this call is
* input as an essential argument for rest of the APIs described
* for this module.
*
* @b Arguments
* @verbatim
pEmifaObj Pointer to the EMIFA instance object
emifaNum Instance of the EMIFA to be opened.
pEmifaParam Pointer to module specific parameters
pStatus Pointer for returning status of the function call
@endverbatim
*
* <b> Return Value </b>
* @li CSL_EmifaHandle - Valid EMIFA instance handle will be
* returned if status value is equal to
* CSL_SOK.
*
* <b> Pre Condition </b>
* @n @a CSL_emifaInit() must be called successfully.
*
* <b> Post Condition </b>
* @n EMIFA object structure is populated
*
* @b Modifies
* @n 1. The status variable
* @n 2. EMIFA object structure
*
* @b Example:
* @verbatim
CSL_Status status;
CSL_EmifaObj emifaObj;
CSL_EmifaHandle hEmifa;
hI2c = CSL_emifaOpen (&emifaObj,
CSL_EMIFA,
NULL,
&status
);
@endverbatim
*
* =============================================================================
*/
CSL_EmifaHandle CSL_emifaOpen (
CSL_EmifaObj *hEmifaObj,
CSL_InstNum emifaNum,
CSL_EmifaParam *pEmifaParam,
CSL_Status *status
);
/** ============================================================================
* @n@b csl_emifaClose.c
*
* @b Description
* @n This function marks that CSL for the external memory interface instance
* needsto be reopened before using any external memory interface CSL APIs.
*
* @b Arguments
* @verbatim
hEmifa Handle to the external memory interface instance
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - external memory interface is
* closed successfully
*
* @li CSL_ESYS_BADHANDLE - The handle passed is invalid
*
* <b> Pre Condition </b>
* @n Both @a CSL_emifaInit() and @a CSL_emifaOpen() must be called
* successfully in order before calling @a CSL_emifaClose().
*
* <b> Post Condition </b>
* @n 1. The external memory interface CSL APIs cannot be called until the
* external memory interface CSL is reopened again using
* CSL_emifaOpen().
*
* @b Modifies
* @n hEmifa structure
*
* @b Example
* @verbatim
CSL_EmifaHandle hEmifa;
...
CSL_emifaClose(hEmifa);
...
@endverbatim
* =============================================================================
*/
CSL_Status CSL_emifaClose (
CSL_EmifaHandle hEmifa
);
/** ============================================================================
* @n@b CSL_emifaGetBaseAddress
*
* @b Description
* @n The getbaseaddress call will give the External memory interface current
* instance base address
*
* @b Arguments
* @verbatim
emifaNum Specifies the instance of the EMIFA external memory
interface for which the base address is requested
pEmifaParam Module specific parameters.
pBaseAddress Pointer to the base address structure to return the
base address details.
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_OK Open call is successful
* @li CSL_ESYS_FAIL The external memory interface
* instance is not available.
*
* <b> Pre Condition </b>
* @n @a CSL_emifaInit() and CSL_emifaOpen () must be called successfully.
*
* <b> Post Condition </b>
* @n Base address structure is populated
*
* @b Modifies
* @n 1. The status variable
*
* 2. Base address structure.
*
* @b Example
* @verbatim
CSL_Status status;
CSL_EmifaBaseAddress baseAddress;
...
status = CSL_emifaGetBaseAddress(CSL_EMIFA, NULL, &baseAddress);
@endverbatim
*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -