Chapter 2 - Installation and use of LevelX
Installation and use of LevelX is straightforward and described in the following sections of this chapter.
Distribution
LevelX is distributed in ANSI C where each function is contained in its own separate C file. The files in the LevelX distribution are as follows.
- lx_api.h
- lx_nand_flash_256byte_ecc_check.c
- lx_nand_flash_256byte_ecc_compute.c
- lx_nand_flash_block_allocate.c
- lx_nand_flash_block_data_move.c
- lx_nand_flash_block_find.c
- lx_nand_flash_block_mapping_set.c
- lx_nand_flash_block_status_set.c
- lx_nand_flash_close.c
- lx_nand_flash_data_page_copy.c
- lx_nand_flash_defragment.c
- lx_nand_flash_erase_count_set.c
- lx_nand_flash_extended_cache_enable.c
- lx_nand_flash_format.c
- lx_nand_flash_free_block_list_add.c
- lx_nand_flash_initialize.c
- lx_nand_flash_mapped_block_list_add.c
- lx_nand_flash_mapped_block_list_get.c
- lx_nand_flash_mapped_block_list_remove.c
- lx_nand_flash_memory_initialize.c
- lx_nand_flash_metadata_allocate.c
- lx_nand_flash_metadata_build.c
- lx_nand_flash_metadata_write.c
- lx_nand_flash_open.c
- lx_nand_flash_page_ecc_check.c
- lx_nand_flash_page_ecc_compute.c
- lx_nand_flash_partial_defragment.c
- lx_nand_flash_sectors_read.c
- lx_nand_flash_sectors_release.c
- lx_nand_flash_sectors_write.c
- lx_nand_flash_sector_read.c
- lx_nand_flash_sector_release.c
- lx_nand_flash_sector_write.c
- lx_nand_flash_system_error.c
- lx_nor_flash_block_reclaim.c
- lx_nor_flash_close.c
- lx_nor_flash_defragment.c
- lx_nor_flash_extended_cache_enable.c
- lx_nor_flash_initialize.c
- lx_nor_flash_logical_sector_find.c
- lx_nor_flash_next_block_to_erase_find.c
- lx_nor_flash_open.c
- lx_nor_flash_partial_defragment.c
- lx_nor_flash_physical_sector_allocate.c
- lx_nor_flash_sector_mapping_cache_invalidate.c
- lx_nor_flash_sector_read.c
- lx_nor_flash_sector_release.c
- lx_nor_flash_sector_write.c
- lx_nor_flash_system_error.c
There are also simulator and FileX driver samples for both LevelX NAND and NOR instances, as follows.
- demo_filex_nand_flash.c
- fx_nand_flash_simulated_driver.c
- lx_nand_flash_simulator.c
- demo_filex_nor_flash.c
- fx_nor_flash_simulated_driver.c
- lx_nor_flash_simulator.c
Of course, if only NAND flash is required, only the LevelX NAND flash files (lx_nand_*.c) are needed. Similarly, if only NOR flash is required, only the NOR flash files (lx_nor_*.c) are needed.
Configuration Options
LevelX can be configured at compile time via the conditional defines described below. Simply add the desired define to the compilation of each LevelX source to use the option.
Using LevelX
To use LevelX, either by itself or with FileX, include the file lx_api.h in the code that references the LevelX API. Also ensure that the LevelX object code is available at link time. Please examine the files demo_filex_nand_flash.c and demo_filex_nor_flash.c for examples of how to use LevelX.