⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csl_ms.h

📁 TI达芬奇dm644x各硬件模块测试代码
💻 H
📖 第 1 页 / 共 3 页
字号:
 * *  This structure is used to setup or obtain existing setup of *  MS using @a CSL_msHwSetup() & @a CSL_msGetHwSetup() functions *  respectively. */typedef struct {    /** Reset mode : 0==> No sync reset is performed,     *  1==> Reset performed     */    Uint16 reset;    /** Access Mode : 0==> Parallel Interface Mode,     *  1==> Serial Interface Mode     */    Uint16 mode;    /** Interrupt request output to HOST : 0 ==> Disable,     *  1 ==> Enable     */    Uint16 intHost;    /** CRC Mode: 0==> CRC output on,  1 ==> CRC output off     */    Uint16 crc;    /** Interrupt Clear: 0==> No interrupt clear, 1==> Clear interrupt     */    Uint16 intClear;    /** Interrupt from MS device : 0 ==> Disable, 1 ==> Enable     */    Uint16 intDevice;    /** FIFO clear : 0 ==> Disable, 1 ==> Enable     */    Uint16 fifoClear;    /** FIFO direction: 0 ==> Disable, 1 ==> Enable     */    Uint16 fifoDir;    /** DMA Access Mode: 0 ==> Disable, 1 ==> Enable     */    Uint16 dmaMode;    /** DMA Data Request Mode: 0 ==> Level Mode, 1==> Edge Mode     */    Uint16 drm;    /** Data Request:  0==>No interrupt with Data request,     *  1==>Interrupt with Data request     */    Uint16 drqInt;    /** Rise Edge Input: 0==>Falling Edge Input, 1==>Rising Edge Input     */    Uint16 rei;    /** Rise Edge Output: 0==>Falling Edge Output,     *  1==>Rising Edge Output     */    Uint16 reo;    /** Busy Count     */    Uint16 bsyCount;    /** Byte Swap : 0==> No swap, 1, 2==>refer TRM, 3==>swap     */    CSL_MsByteSwapSel byteSwap;    /** Clock Divider: 0==>MSCKI=CLK, 1==>MSCKI=CLK/2, 2==>MSCKI=CLK/4,     *                 3==>MSCKI=CLK/6, 4==>MSCKI=CLK/8, 5==>MSCKI=CLK/10,     *                 6==>MSCKI=CLK/12, 7==>MSCKI=CLK/14     */    CSL_MsClkDivRatio clockDivider;}CSL_MsHwSetup;/** @brief Default Values for HwSetup structure */#define CSL_MS_HWSETUP_DEFAULTS {                 \    CSL_MS_MSSYST_RST_RESETVAL,                   \    CSL_MS_MSSYST_SRAC_RESETVAL,                  \    CSL_MS_MSSYST_INTEN_RESETVAL,                 \    CSL_MS_MSSYST_NOCRC_RESETVAL,                 \    CSL_MS_MSSYST_INTCLR_RESETVAL,                \    CSL_MS_MSSYST_MSIEN_RESETVAL,                 \    CSL_MS_MSSYST_FCLR_RESETVAL,                  \    CSL_MS_MSSYST_FDIR_RESETVAL,                  \    CSL_MS_MSSYST_DAM_RESETVAL,                   \    CSL_MS_MSSYST_DRM_RESETVAL,                   \    CSL_MS_MSSYST_DRQSL_RESETVAL,                 \    CSL_MS_MSSYST_REI_RESETVAL,                   \    CSL_MS_MSSYST_REO_RESETVAL,                   \    CSL_MS_MSSYST_BSY_RESETVAL,                   \    (CSL_MsByteSwapSel)CSL_MS_MSMCR_BS_RESETVAL,  \    (CSL_MsClkDivRatio)CSL_MS_MSMCR_CD_RESETVAL   \}/** @brief Enumeration for queries passed to @a CSL_msGetHwStatus() * *  This is used to get the status of different operations or to get the *  existing setup of MS. */typedef enum {    /**     * @brief  Get the Data Request Interrupt Status Flag     *         (response type: @a Uint16 *)     */    CSL_MS_QUERY_DRQ_STATUS       =    1,    /**     * @brief  Get the Memory Stick interface interrupt status information     *         (response type: @a Uint16 *)     */    CSL_MS_QUERY_MSINT_STATUS     =    2,    /**     * @brief  Get the Command receive status information     *         (response type: @a Uint16 *)     */    CSL_MS_QUERY_RDY              =    3,    /**     * @brief  Get CRC status information(response type: @a Uint16 *)     */    CSL_MS_QUERY_CRC_STATUS       =    4,    /**     * @brief  Get Time-out error status information     *         (response type: @a Uint16 *)     */    CSL_MS_QUERY_TOE_STATUS       =    5,    /**     * @brief  Check whether the FIFO is empty or has data     *         (response type: @a Uint16 *)     */    CSL_MS_QUERY_FIFO_EMPTY       =    6,    /**     * @brief  Check whether the FIFO is full or has empty spaces     *         (response type: @a Uint16 *)     */    CSL_MS_QUERY_FIFO_FULL        =    7,    /**     * @brief  Check whether the MS command has ended  or not     *         (response type: @a Uint16 *)     */    CSL_MS_QUERY_CED_STATUS       =    8,    /**     * @brief  Check whether any MS errors have been set     *         (response type: @a Uint16 *)     */    CSL_MS_QUERY_ERR_STATUS       =    9,    /**     * @brief  Check whether any MS data buffer request is indicated     *         (response type: @a Uint16 *)     */    CSL_MS_QUERY_BRQ_STATUS       =    10,    /**     * @brief  Check whether any command acknowledge from MS is indicated     *         (response type: @a Uint16 *)     */    CSL_MS_QUERY_ACK_STATUS       =    11,    /**     * @brief  Check whether the MS transfers data from FIFO or external     *         memory (response type: @a Uint16 *)     */    CSL_MS_QUERY_DSL              =    12,    /**     * @brief  Get the data transfer size (response type: @a Uint16 *)     */    CSL_MS_QUERY_DSIZE            =    13,    /**     * @brief  Get the Byte Swap Selection     *         (response type: @a CSL_MsByteSwapSel *)     */    CSL_MS_QUERY_BS               =    14,    /**     * @brief Get the Clock Divider Ratio     *        (response type: @a CSL_MsClkDivRatio *)     */    CSL_MS_QUERY_CD               =    15} CSL_MsHwStatusQuery;/** @brief Enumeration for queries passed to @a CSL_msHwControl() * *  This is used to select the commands to control the operations *  existing setup of MS. The arguments to be passed with each *  enumeration if any are specified next to the enumeration. */ typedef enum {    /**     * @brief  Set the Transfer Protocol Command     * @param  (Uint16 *)     */    CSL_MS_CMD_TPC_SET            =    1,    /**     * @brief   Set the other endpoint of  data transfer from/to MS as FIFO     * @param   (None)     */    CSL_MS_CMD_DSL_FIFO           =    2,    /**     * @brief  Set the other endpoint of  data transfer from/to MS as FIFO     * @param  (None)     */    CSL_MS_CMD_DSL_EXTMEM         =    3,    /**     * @brief  Reset the MS     * @param  (None)     */    CSL_MS_CMD_RESET              =    4,    /**     * @brief  Set the data transfer size     * @param  (Uint16 *)     */    CSL_MS_CMD_SET_DATA_SIZE      =    5,    /**     * @brief  Write a word to FIFO     * @param  (Uint32 *)     */    CSL_MS_CMD_WRITE_FIFO         =    6,    /**     * @brief  Read a word from FIFO     * @param  (Uint32 *)     */    CSL_MS_CMD_READ_FIFO          =    7,    /**     * @brief  Enable MS interrupts     * @param  (None)     */    CSL_MS_CMD_INT_ENABLE         =    8,    /**     * @brief  Disable MS interrupts     * @param  (None)     */    CSL_MS_CMD_INT_DISABLE        =    9,    /**     * @brief  Enable the DMA mode     * @param  (None)     */    CSL_MS_CMD_DMA_ENABLE         =    10,    /**     *  @brief  Disable the DMA mode     *  @param  (None)     */    CSL_MS_CMD_DMA_DISABLE        =    11,    /**     *  @brief Configure the byte swap value:     *  @param (CSL_MsByteSwapSel *)     */    CSL_MS_CMD_SET_BYTESWAP       =    12,    /**     *  @brief Configure the clock divider value:     *  @param (CSL_MsClkDivRatio *)     */    CSL_MS_CMD_SET_CLKDIV         =    13} CSL_MsHwControlCmd;/******************************************************************************\* MS global function declarations\******************************************************************************//** ============================================================================ *   @n@b CSL_msInit * *   @b Description *   @n This is the initialization function for the MS. This function is *      idempotent in that calling it many times is same as calling it once. *      This function initializes the CSL data structures, and doesn't affect *      the H/W. * *   @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  None * *   <b> Post Condition </b> *   @n  None * *   @b Modifies *   @n  None * *   @b Example *   @verbatim      ...      if (CSL_sysInit() == CSL_SOK) {         CSL_msInit();      }     @endverbatim *  ============================================================================ */CSL_Status CSL_msInit (    CSL_MsContext       *pContext);/** ============================================================================ *   @n@b CSL_msOpen * *   @b Description *   @n This function populates the peripheral data object for the MS instance *      and returns a handle to the instance. *      The open call sets up the data structures for the particular instance *      of MS 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         pMsObj      Pointer to the MS instance object         msNum       Instance of the MS to be opened         pMsParam    Pointer to module specific parameters         pStatus     Pointer for returning status of the function call     @endverbatim * *   <b> Return Value </b>  CSL_MsHandle *   @li                    hMs  - Valid MS instance handle *   @li                    NULL - Returned in case of invalid operation * *   @b Example *   @verbatim          CSL_status         status;          CSL_MsObj          msObj;          CSL_MsHandle       hMs;          ...          hMs = CSL_msOpen (&msObj, CSL_MS_PER_CNT, NULL, &status);     @endverbatim * ============================================================================= */CSL_MsHandle CSL_msOpen (    CSL_MsObj             *hMsObj,    CSL_InstNum            msNum,    CSL_MsParam           *pMsParam,    CSL_Status            *status);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -