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

📄 csl_nand.h

📁 TI达芬奇dm644x各硬件模块测试代码
💻 H
📖 第 1 页 / 共 3 页
字号:
              nandNum       Instance of the NAND to be opened

              pNandParam    Pointer to module specific parameters

              pStatus      pointer for returning status of the function call
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_NandHandle
 *   @n                     Valid NAND instance handle will be returned if status
                            value is equal to CSL_SOK.
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n   1.    NAND object structure is populated
 *   @n   2.    The status is returned in the status variable. If status
 *              returned is
 *   @li            CSL_SOK             Valid nand handle is returned
 *   @li            CSL_ESYS_FAIL       The nand instance is invalid
 *   @li            CSL_ESYS_INVPARAMS  Invalid parameter
 *
 *   @b Modifies
 *   @n    1. The status variable
 *   @n    2. NAND object structure
 *
 *   @b Example
 *   @verbatim
            CSL_status          status;
            CSL_NandObj         nandObj;
            CSL_NandHandle      hNand;
            ...

            hNand = CSL_nandOpen (&nandObj, CSL_NAND_PER_CNT, NULL, &status);
            ...
    @endverbatim
 * =============================================================================
 */
CSL_NandHandle CSL_nandOpen (
    /** Pointer to the object that holds reference to the
     *  instance of NAND requested after the call
     */
    CSL_NandObj              *hNandObj,
    /** Instance of NAND to which a handle is requested
     */
    CSL_InstNum              nandNum,
    /** Specifies if NAND should be opened with exclusive or
     *  shared access to the associate pins
     */
    CSL_NandParam            *pNandParam,
    /** This returns the status (success/errors) of the call
     */
    CSL_Status              *status
);


/** ============================================================================
 *   @n@b CSL_nandClose
 *
 *   @b Description
 *   @n This function closes the specified instance of NAND.
 *
 *   @b Arguments
 *   @verbatim
            hNand            Handle to the NAND instance
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Close successful
 *   @li                    CSL_ESYS_BADHANDLE  - Invalid handle
 *
 *   @b Example
 *   @verbatim
            CSL_NandHandle       hNand;
            CSL_status          status;

            ...

            status = CSL_nandClose(hNand);
     @endverbatim
 * =============================================================================
 */
CSL_Status  CSL_nandClose(
    /** Pointer to the object that holds reference to the
     *  instance of NAND requested after the call
     */
    CSL_NandHandle                         hNand
);


/** ============================================================================
 *   @n@b CSL_nandHwSetup
 *
 *   @b Description
 *   @n It configures the nand registers as per the values passed
 *      in the hardware setup structure.
 *
 *   @b Arguments
 * @verbatim
            hNand           Handle to the NAND instance
            hwSetup         Pointer to harware setup structure
  @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Hardware setup successful.
 *   @li                    CSL_ESYS_BADHANDLE  - Invalid handle
 *   @li                    CSL_ESYS_INVPARAMS  - Hardware structure is not
                                                  properly initialized
 *
 *   @b Modifies
 *   @n The hardware registers of NAND.
 *
 *   @b Example
 *   @verbatim
        CSL_NandHandle    hNand;
        CSL_NandObj       nandObj;
        CSL_NandHwSetup   hwSetup;
        CSL_status       status;

        ...

        hNand = CSL_nandOpen (&nandObj, CSL_NAND_PRIMARY, NULL, &status);

        status = CSL_nandHwSetup(hNand, &hwSetup);
 *   @endverbatim
 * =============================================================================
 */
CSL_Status  CSL_nandHwSetup(
    /** Pointer to the object that holds reference to the
     *  instance of NAND requested after the call
     */
    CSL_NandHandle                         hNand,
    /** Pointer to setup structure which contains the
     *  information to program NAND to a useful state
     */
    CSL_NandHwSetup                        *setup
);

/** ============================================================================
 *   @n@b CSL_NandGetHwSetup
 *
 *   @b Description
 *   @n Gets the current setup of NAND.
 *
 *   @b Arguments
 * @verbatim
            hNand           Handle to the NAND instance

            setup           Pointer to setup structure which contains the
                            setup information of NAND.
   @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Setup info load successful.
 *   @li                    CSL_ESYS_BADHANDLE  - Invalid handle
 *   @li                    CSL_ESYS_INVPARAMS  - Invalid parameter
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The registers of the specified NAND instance will be setup.
 *
 *   @b Modifies
 *   @n Hardware registers of the specified NAND instance.
 *
 *   @b Example
 *   @verbatim
        CSL_NandHandle       hNand;
        CSL_NandHwSetup      setup;
        CSL_Status           status;

        status = CSL_NandGetHwSetup (hNand, &setup);
     @endverbatim
 * =============================================================================
 */
CSL_Status  CSL_nandGetHwSetup(
    /** Pointer to the object that holds reference to the
     *  instance of NAND requested after the call
     */
    CSL_NandHandle                         hNand,
    /** Pointer to setup structure which contains the
     *  information to program NAND to a useful state
     */
    CSL_NandHwSetup                        *setup
);

/** ============================================================================
 *   @n@b CSL_nandHwSetupRaw
 *
 *   @b Description
 *   @n This function initializes the device registers with the register-values
 *      provided through the Config Data structure.
 *
 *   @b Arguments
 *   @verbatim
            hNand        Handle to the Nand instance

            config          Pointer to config structure
     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Configuration successful
 *   @li                    CSL_ESYS_BADHANDLE  - Invalid handle
 *   @li                    CSL_ESYS_INVPARAMS  - Configuration is not
 *                                                properly initialized
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  The registers of the specified NAND instance will be setup
 *       according to value passed.
 *
 *   @b Modifies
 *   @n Hardware registers of the specified NAND instance.
 *
 *   @b Example
 *   @verbatim
        CSL_NandHandle       hNand;
        CSL_NandConfig       config = CSL_NAND_CONFIG_DEFAULTS;
        CSL_Status          status;

        status = CSL_nandHwSetupRaw (hNand, &config);

     @endverbatim
 * ===========================================================================
 */
CSL_Status  CSL_nandHwSetupRaw (
    CSL_NandHandle           hNand,
    CSL_NandConfig *         config
);


/** ============================================================================
 *   @n@b CSL_nandHwControl
 *
 *   @b Description
 *   @n Takes a command of NAND with an optional argument & implements it.
 *
 *   @b Arguments
 * @verbatim
            hNand           Handle to the NAND instance

            cmd             The command to this API indicates the action to be
                            taken on NAND.

            arg             An optional argument.
   @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Status info return successful.
 *   @li                    CSL_ESYS_BADHANDLE  - Invalid handle
 *   @li                    CSL_ESYS_INVCMD     - Invalid command
 *   @li                    CSL_ESYS_FAIL       - Invalid instance number
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n The hardware registers of NAND.
 *
 *   @b Example
 *   @verbatim
        CSL_NandHandle         hNand;
        CSL_NandHwControlCmd   cmd;
        void                   arg;

        status = CSL_nandHwControl (hNand, cmd, &arg);

     @endverbatim
 * =============================================================================
 */
CSL_Status  CSL_nandHwControl(
    /** Pointer to the object that holds reference to the
     *  instance of NAND requested after the call
     */
    CSL_NandHandle                         hNand,
    /** The command to this API indicates the action to be taken
     */
    CSL_NandHwControlCmd                   cmd,
    /** An optional argument @a void* casted
     */
    void                                   *arg
);


/** ============================================================================
 *   @n@b CSL_NandGetHwStatus
 *
 *   @b Description
 *   @n Gets the status of the different operations of NAND.
 *
 *   @b Arguments
 * @verbatim
            hNand           Handle to the NAND instance

            query           The query to this API of NAND which indicates the
                            status to be returned.

            response        Placeholder to return the status.
   @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_SOK             - Status info return successful.
 *   @li                    CSL_ESYS_BADHANDLE  - Invalid handle
 *   @li                    CSL_ESYS_INVPARAMS  - Invalid parameter
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  None
 *
 *   @b Modifies
 *   @n None
 *
 *   @b Example
 *   @verbatim
        CSL_NandHandle          hNand;
        CSL_NandHwStatusQuery   query;
        void                    reponse;

        status = CSL_NandGetHwStatus (hNand, query, &response);

     @endverbatim
 * =============================================================================
 */
CSL_Status  CSL_nandGetHwStatus(
    /** Pointer to the object that holds reference to the
     *  instance of NAND requested after the call
     */
    CSL_NandHandle                         hNand,
    /** The query to this API which indicates the status
     *  to be returned
     */
    CSL_NandHwStatusQuery                  query,
    /** Placeholder to return the status. @a void* casted */
    void                                    *response
);


/** ===========================================================================
 *   @n@b CSL_nandGetBaseAddress
 *
 *   @b Description
 *   @n  Function to get the base address of the peripheral instance.
 *       This function is used for getting the base address of the peripheral
 *       instance. This function will be called inside the CSL_nandOpen()
 *       function call. This function is open for re-implementing if the user
 *       wants to modify the base address of the peripheral object to point to
 *       a different location and there by allow CSL initiated write/reads into
 *       peripheral MMR's go to an alternate location.
 *
 *   @b Arguments
 *   @verbatim
            nandNum          Specifies the instance of NAND to be opened.

            pNandParam       Module specific parameters.

            pBaseAddress    Pointer to baseaddress structure containing base
                            address details.

     @endverbatim
 *
 *   <b> Return Value </b>  CSL_Status
 *   @li                    CSL_OK            Open call is successful
 *   @li                    CSL_ESYS_FAIL     The instance number is invalid.
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Base Address structure is populated
 *
 *   @b Modifies
 *   @n    1. The status variable
 *
 *         2. Base address structure is modified.
 *
 *   @b Example
 *   @verbatim
        CSL_Status              status;
        CSL_NandBaseAddress  baseAddress;

       ...
      status = CSL_nandGetBaseAddress(CSL_NAND_PER_CNT, NULL, &baseAddress);

    @endverbatim
 * ===========================================================================
 */
CSL_Status   CSL_nandGetBaseAddress (
    CSL_InstNum             nandNum,
    CSL_NandParam *         pNandParam,
    CSL_NandBaseAddress *   pBaseAddress
);


#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

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