![]() |
nandpsu
Vitis Drivers API Documentation
|
This file contains a design example using the NAND driver (XNandPsu).
This example tests the erase, read and write features of the controller. The flash is erased and written. The data is read back and compared with the data written for correctness.
None.
MODIFICATION HISTORY:
Ver Who Date Changes
1.0 nm 05/06/2014 First release. ms 04/10/17 Modified Comment lines to follow doxygen rules. 1.4 nsk 10/04/2018 Added support for ICCARM Compiler. 1.6 sd 31/03/2020 Fixed a gcc warning. 1.9 akm 07/15/2021 Switch to best supported Data interface and Timing mode. 1.12 akm 06/27/2023 Add support for system device-tree flow for example. 1.16 vlt 12/18/25 Update Doxygen comments to include SDT flow details.
#include <stdio.h>#include <stdlib.h>#include <xil_types.h>#include <xil_printf.h>#include <xparameters.h>#include "xnandpsu.h"Functions | |
| s32 | NandReadWriteExample (UINTPTR BaseAddress) |
| This function runs a test on the NAND flash device using the basic driver functions in polled mode. More... | |
| int | main (void) |
| Main function to execute the Nand Flash read write example. More... | |
Variables | |
| u8 | ReadBuffer [TEST_BUF_SIZE] |
| Block sized Read buffer. More... | |
| u8 | WriteBuffer [TEST_BUF_SIZE] |
| Block sized write buffer. More... | |
| int main | ( | void | ) |
Main function to execute the Nand Flash read write example.
References NandReadWriteExample().
| s32 NandReadWriteExample | ( | UINTPTR | BaseAddress | ) |
This function runs a test on the NAND flash device using the basic driver functions in polled mode.
The function does the following tasks:
| BaseAddress | contains the base address of the device |
References XNandPsu_Config::BaseAddress, XNandPsu_Geometry::BytesPerPage, XNandPsu::Geometry, ReadBuffer, WriteBuffer, XNandPsu_CfgInitialize(), XNandPsu_ChangeTimingMode(), XNandPsu_EnableDmaMode(), XNandPsu_Erase(), XNandPsu_LookupConfig(), XNandPsu_Read(), and XNandPsu_Write().
Referenced by main().
| u8 ReadBuffer[TEST_BUF_SIZE] |
Block sized Read buffer.
Referenced by NandReadWriteExample().
| u8 WriteBuffer[TEST_BUF_SIZE] |
Block sized write buffer.
Referenced by NandReadWriteExample().