📄 csl_nfc.h
字号:
#ifndef _CSL_NFC_H_#define _CSL_NFC_H_/** * @mainpage NAND Flash Controller * * @section Introduction * * @subsection xxx Purpose and Scope * The purpose of this document is to identify a set of common CSL APIs for the * NAND Flash Controller Module across various devices. The CSL developer * is expected to refer to this document while designing APIs for these modules. * Some of the listed APIs may not be applicable to a given NAND Flash Controller * Module. While in other cases this list of APIs may not be sufficient to cover * all the features of a particular NAND Flash Controller Module. The CSL developer * should use his discretion in designing new APIs or extending the existing ones * to cover these. * * * @subsection aaa Terms and Abbreviations * -# CSL: Chip Support Library * -# API: Application Programmer Interface * -# NFC: NAND Flash Controller * * @subsection References * -# CSL 3.x Technical Requirements Specifications Version 0.5, dated * May 14th, 2003 * * @subsection Assumptions * The abbreviations NFC, Nfc and nfc have been used throughout this * document to refer to the NAND Flash Controller Module*//** @file csl_nfc.h * * @brief Header file for functional layer of CSL * * Description * - type definitions and API prototypes for the NFC CSL module * * Modification 1 * - modified on: 2004/06/01 * * @date 2004/06/01 * @author RG Kiran */#include <csl.h>#include <cslr_nfc.h>#ifdef __cplusplusextern "C" {#endif/** * Current Revision number of the NAND Flash Controller */typedef enum { CSL_NFC_REVISION_0_1 = 0x01, /**< Revision 0.1 */ CSL_NFC_REVISION_0_2 = 0x02, /**< Revision 0.2 */ CSL_NFC_REVISION_2_1 = 0x21 /**< Revision 2.1 */} CSL_NfcRevision;/** * FIFO (Post-Write/Prefetch/Host) Mode configuration */typedef enum { CSL_NFC_FIFOMODE_HOST = 0, /**< Host Mode */ CSL_NFC_FIFOMODE_POSTWRITE = 1, /**< Post-Write Enabled */ CSL_NFC_FIFOMODE_PREFETCH = 2 /**< Prefetch Enabled */} CSL_NfcFifoMode;/** * 8-bit NAND Flash Command Identifier */typedef Uint8 CSL_NfcCommand;/** * NAND Flash Controller Event Sources */typedef Uint8 CSL_NfcEvents;#define CSL_NFC_EVT_FIFOEMPTY (8) /**< FIFO Empty */#define CSL_NFC_EVT_FIFOFULL (4) /**< FIFO Full */#define CSL_NFC_EVT_COUNTZERO (2) /**< Counter reached zero */#define CSL_NFC_EVT_READY (1) /**< Read/Busy (R/B_) *//** * ECC computation-logic configuration */typedef enum { CSL_NFC_ECC_DISABLE = 0, /**< Disable ECC logic */ CSL_NFC_ECC_ENABLE512 = 1, /**< Enable ECC calculation on 512 bytes */ CSL_NFC_ECC_ENABLE256 = 3 /**< Enable ECC calculation on 256 bytes */ } CSL_NfcEccComputation;/** * Endianness to use */typedef enum { CSL_NFC_ENDIAN_LITTLE = 0, /**< Little Endian */ CSL_NFC_ENDIAN_BIG = 1 /**< Big Endian */} CSL_NfcEndianness;/** * ECC Bank Selection -- how many ECC registers to enable */typedef enum { CSL_NFC_ECCREGS_3 = 0, /**< ECC registers 1 to 3 */ CSL_NFC_ECCREGS_4 = 1, /**< ECC registers 1 to 4 */ CSL_NFC_ECCREGS_5 = 2, /**< ECC registers 1 to 5 */ CSL_NFC_ECCREGS_6 = 3, /**< ECC registers 1 to 6 */ CSL_NFC_ECCREGS_7 = 4, /**< ECC registers 1 to 7 */ CSL_NFC_ECCREGS_8 = 5, /**< ECC registers 1 to 8 */ CSL_NFC_ECCREGS_9 = 6 /**< ECC registers 1 to 9 */} CSL_NfcEccRegSelect;/** * NAND Flash Controller FIFO size */typedef enum { CSL_NFC_FIFOSIZE_1 = 1, /**< FIFO-size 1 byte */ CSL_NFC_FIFOSIZE_2 = 2, /**< FIFO-size 2 bytes */ CSL_NFC_FIFOSIZE_4 = 4, /**< FIFO-size 4 bytes */ CSL_NFC_FIFOSIZE_8 = 8, /**< FIFO-size 8 bytes */ CSL_NFC_FIFOSIZE_16 = 16 /**< FIFO-size 16 bytes */} CSL_NfcFifoSize;/** * Prescale sampling clock divider value */typedef enum { CSL_NFC_PRESCALE_DIVBY1 = 0, /**< Divide by 1 */ CSL_NFC_PRESCALE_DIVBY2 = 1, /**< Divide by 2 */ CSL_NFC_PRESCALE_DIVBY3 = 2, /**< Divide by 3 */ CSL_NFC_PRESCALE_DIVBY4 = 3, /**< Divide by 4 */ CSL_NFC_PRESCALE_DIVBY5 = 4, /**< Divide by 5 */ CSL_NFC_PRESCALE_DIVBY6 = 5, /**< Divide by 6 */ CSL_NFC_PRESCALE_DIVBY7 = 6, /**< Divide by 7 */ CSL_NFC_PRESCALE_DIVBY8 = 7, /**< Divide by 8 */ CSL_NFC_PRESCALE_DIVBY9 = 8, /**< Divide by 9 */ CSL_NFC_PRESCALE_DIVBY10 = 9, /**< Divide by 10 */ CSL_NFC_PRESCALE_DIVBY11 = 10, /**< Divide by 11 */ CSL_NFC_PRESCALE_DIVBY12 = 11, /**< Divide by 12 */ CSL_NFC_PRESCALE_DIVBY13 = 12, /**< Divide by 13 */ CSL_NFC_PRESCALE_DIVBY14 = 13, /**< Divide by 14 */ CSL_NFC_PRESCALE_DIVBY15 = 14, /**< Divide by 15 */ CSL_NFC_PRESCALE_DIVBY16 = 15 /**< Divide by 16 */} CSL_NfcPrescale;/** * Auto-Idling Clock Activity configuration */typedef enum { CSL_NFC_AUTOIDLE_FREERUNNING = 0, /**< Clock free-running */ CSL_NFC_AUTOIDLE_POWERSAVING = 1 /**< Clock runs only on access or ongoing operation */} CSL_NfcAutoIdle;/** * For use with the query command CSL_NFC_QUERY_READECC */typedef struct { Uint8 numEccRegs; /**< number of ECC regs to read: 1 to 9 */ Uint32 * eccTable; /**< pointer to array that will receive the ECC */} CSL_NfcQueryReadEcc;/** * For use with the control command CSL_NFC_CMD_SENDCMDADDR */typedef struct { CSL_NfcCommand command; Uint32 data;} CSL_NfcCmdSendCmdAddr;/** @brief Enumeration of the control-commands supported by this module * * This is the set of commands that could be passed to the @a CSL_nfcHwControl() * API. Some commands take an argument as documented along-side the command. These * arguments need to be type-casted to 'void *' when passing to CSL_nfcHwControl() */typedef enum { /** * Send NAND command (without an address) * args: CSL_NfcCommand * -- NFC Command */ CSL_NFC_CMD_SENDCMD, /** * Send NAND command after the start-address (on the NAND flash card) * args: CSL_NfcCmdSendCmdAddr * -- command and address to send */ CSL_NFC_CMD_SENDCMDADDR, /** * Send data to the NAND Flash Card * args: Uint32 * -- data to send */ CSL_NFC_CMD_SENDDATA, /** * Configure the FIFO mode * args: CSL_NfcFifoMode * -- Prefetch/Postwrite/Host mode */ CSL_NFC_CMD_SETFIFOMODE, /** * Enable specified events; disables the others * args: CSL_BitMask16 * -- mask of events */ CSL_NFC_CMD_EVTENABLE, /** * Clear specified pending events * args: CSL_BitMask16 * -- mask of events */ CSL_NFC_CMD_EVTCLEAR, /** * Reset the ECC registers * args: None */ CSL_NFC_CMD_RESETECC, /** * Assert (high) the DMA request (when in Host Mode) * args: None */ CSL_NFC_CMD_ASSERTDMARQ, /** * Initiate software reset sequence * args: None */ CSL_NFC_CMD_SOFTRESET, /** * Write data to FIFO * args: Uint8 * -- data to write */ CSL_NFC_CMD_WRITEFIFODATA} CSL_NfcHwControlCmd;/** @brief Enumeration of the query-commands supported by this module * * This is used to get the status of different operations or to get the * existing setup of NFC. The arguments to be passed with each enumeration * if any are specified next to the enumeration */typedef enum { /* * Retrieves the Revision * args: CSL_NfcRevision * -- revision */ CSL_NFC_QUERY_REVISION, /* * Read data from the NAND Flash Card * args: Uint32 * -- read-in data */ CSL_NFC_QUERY_READDATA, /* * Checks if card is ready for next operation * args: Bool * -- ready status */ CSL_NFC_QUERY_ISREADY, /** * Poll specified events * args: CSL_BitMask16 * -- mask of events */ CSL_NFC_QUERY_EVTSTATUS, /** * Retrieves the ECC computed during a read/write * args: CSL_NfcQueryReadEcc * -- ECC registers to read */ CSL_NFC_QUERY_READECC, /** * Checks for status of reset operation * args: Bool * -- reset status */ CSL_NFC_QUERY_RESETDONE, /** * Read data from FIFO * args: Uint8 * -- data read-in */ CSL_NFC_CMD_READFIFODATA} CSL_NfcHwStatusQuery;/** @brief This object contains the reference to the instance of NFC opened * using the @a CSL_nfcOpen(). * * The pointer to this, is passed to all NFC CSL APIs. */typedef struct CSL_NfcObj { /** This is a pointer to the registers of the instance of NFC * referred to by this object */ CSL_NfcRegsOvly regs; /** This is the instance of NFC being referred to by this object */ CSL_InstNum perNum;} CSL_NfcObj;/** * @brief NFC Handle */typedef struct CSL_NfcObj * CSL_NfcHandle;/** @brief This will have the base-address information for the peripheral * instance */typedef struct { /** Base-address of the Configuration registers of the peripheral */ CSL_NfcRegsOvly regs;} CSL_NfcBaseAddress;/** @brief Module specific parameters. Present implementation doesn't have
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -