MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Nand Flash Component

Overview

Modules

 Flexspi Nand Flash
 
 Semc Nand Flash
 

Data Structures

struct  nand_config_t
 NAND Flash Config block structure. More...
 
struct  nand_handle_t
 NAND Flash handle info. More...
 

NAND FLASH Driver

status_t Nand_Flash_Init (nand_config_t *config, nand_handle_t *handle)
 Initialize NAND FLASH devices. More...
 
status_t Nand_Flash_Read_Page (nand_handle_t *handle, uint32_t pageIndex, uint8_t *buffer, uint32_t length)
 Read page data from NAND Flash. More...
 
status_t Nand_Flash_Read_Page_Partial (nand_handle_t *handle, uint32_t pageIndex, uint32_t offset_bytes, uint8_t *buffer, uint32_t length)
 Read page partial data from NAND Flash. More...
 
status_t Nand_Flash_Page_Program (nand_handle_t *handle, uint32_t pageIndex, uint8_t *src, uint32_t length)
 Program page data to NAND Flash. More...
 
status_t Nand_Flash_Erase_Block (nand_handle_t *handle, uint32_t blockIndex)
 Erase block NAND Flash. More...
 

Data Structure Documentation

struct nand_config_t

Data Fields

void * memControlConfig
 memory controller configuration, should be assigned to specific controller configuration structure pointer. More...
 

Field Documentation

void* nand_config_t::memControlConfig
struct nand_handle_t

Data Fields

uint8_t vendorType
 Driver Base address. More...
 
uint32_t bytesInPageDataArea
 Bytes in page data area . More...
 
uint32_t bytesInPageSpareArea
 Bytes in page spare area . More...
 
uint32_t pagesInBlock
 Pages in each block. More...
 
uint32_t blocksInPlane
 blocks in each plane. More...
 
uint32_t planesInDevice
 planes in each device . More...
 
void * deviceSpecific
 Device specific control parameter.
 

Field Documentation

uint8_t nand_handle_t::vendorType

vendor type

uint32_t nand_handle_t::bytesInPageDataArea
uint32_t nand_handle_t::bytesInPageSpareArea
uint32_t nand_handle_t::pagesInBlock
uint32_t nand_handle_t::blocksInPlane
uint32_t nand_handle_t::planesInDevice

Function Documentation

status_t Nand_Flash_Init ( nand_config_t config,
nand_handle_t handle 
)

This function initialize NAND Flash controller and NAND Flash.

Parameters
configNand flash configuration. The "memControlConfig" and "driverBaseAddr" are controller specific structure. please set those two parameter with your Nand controller configuration structure type pointer. such as for SEMC:

semc_mem_nand_config_t semcNandconfig = { ..... } nand_config_t config = { .memControlConfig = (void *) .driverBaseAddr = (void *)SEMC; }

Parameters
handleThe NAND Flash handler.
Return values
executionstatus
status_t Nand_Flash_Read_Page ( nand_handle_t handle,
uint32_t  pageIndex,
uint8_t *  buffer,
uint32_t  length 
)
Parameters
handleThe NAND Flash handler.
pageIndexNand flash page index, range from 0 ~ xxx.
bufferNand flash buffer to read data to.
lengthNand flash read length.
Return values
executionstatus
status_t Nand_Flash_Read_Page_Partial ( nand_handle_t handle,
uint32_t  pageIndex,
uint32_t  offset_bytes,
uint8_t *  buffer,
uint32_t  length 
)
Parameters
handleThe NAND Flash handler.
pageIndexNand flash page index, range from 0 ~ xxx.
offset_bytesOffset to start read the page data.
bufferNand flash buffer to read data to.
lengthNand flash read length.
Return values
executionstatus
status_t Nand_Flash_Page_Program ( nand_handle_t handle,
uint32_t  pageIndex,
uint8_t *  src,
uint32_t  length 
)
Parameters
handleThe NAND Flash handler.
pageIndexNand flash page index, range from 0 ~ xxx.
srcThe data to be programed to the page.
lengthNand flash read length.
Return values
executionstatus
status_t Nand_Flash_Erase_Block ( nand_handle_t handle,
uint32_t  blockIndex 
)
Parameters
handleThe NAND Flash handler.
blockIndexNand flash block index to be erased, range from 0 ~ xxx.
Return values
executionstatus