Technical Support
On-Line Manuals
RL-ARM User's Guide (MDK v4)
#include <file_config.h> U32 Init ( NAND_DRV_CFG* cfg); /* Device configuration */
The function Init initializes the Flash programming algorithm for a NAND Flash memory device.
The parameter cfg is a pointer specifying the device configuration, which also contains default data positions as described in Page Layout Structure.
The function is part of the NAND Driver. The prototype is defined in the file File_Config.h. Developers must customize the function.
Init is invoked by the function finit at system startup.
nand.BlockErase, nand.PageRead, nand.PageWrite, nand.UnInit
/* NAND Device Driver Control Block */ NAND_DRV nand0_drv = { Init, UnInit, PageRead, PageWrite, BlockErase }; static U32 Init (NAND_DRV_CFG *cfg) { U32 pgSz, cyc; pgSz = cfg->PageSize; switch (pgSz) { case 528: case 2112: break; default: return ERR_NAND_UNSUPPORTED; } FLASHCLK_CTRL = 0x00000022; /* Setup NAND Flash Clock Control */ MLC_CEH = 0; /* Force nCE assert */ MLC_CMD = NAND_CMD_RESET; /* Reset NAND Flash */ if (!StatusFlag (NAND_CHIP_BUSY)) { /* Wait while NAND busy */ return ERR_NAND_HW_TOUT; } cyc = cfg->AddrCycles; /* Get address cycles */ MLC_LOCK_PR = 0xA25E; /* Unlock MLC_ICR register */ MLC_ICR = ((cyc == 4) << 1) | ((pgSz == 2112) << 2); MLC_LOCK_PR = 0xA25E; /* Unlock MLC_TIME register */ MLC_TIME_REG = (3 << 24) | (11 << 19) | (4 << 16) | (2 << 12) | (4 << 8) | ( 3 << 4) | (4 << 0); P3_OUTP_SET |= (1 << 19); /* Disable write protect */ return RTV_NOERR; }
Cookie Settings | Terms of Use | Privacy | Accessibility | Trademarks | Contact Us | Feedback
Copyright © 2005-2019 Arm Limited (or its affiliates). All rights reserved.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
Change Settings
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.