Board Support Package
Generic Controller
If you use the generic controller layer implementation, you will have to provide a board support package to interface with your board layout and hardware. The board support package must be provided in the form of an API pointer of the type FS_NAND_CTRLR_GEN_BSP_API, like shown in Listing - BSP API type for the generic controller layer implementation.
Listing - BSP API type for the generic controller layer implementation
typedef struct fs_nand_ctrlr_gen_bsp_api {
void (*Open) (FS_ERR *p_err);
void (*Close) (void);
void (*ChipSelEn) (void);
void (*ChipSelDis) (void);
void (*CmdWr) (CPU_INT08U *p_cmd,
CPU_SIZE_T cnt,
FS_ERR *p_err);
void (*AddrWr) (CPU_INT08U *p_addr,
CPU_SIZE_T cnt,
FS_ERR *p_err);
void (*DataWr) (void *p_src,
CPU_SIZE_T cnt,
CPU_INT08U width,
FS_ERR *p_err);
void (*DataRd) (void *p_dest,
CPU_SIZE_T cnt,
CPU_INT08U width,
FS_ERR *p_err);
void (*WaitWhileBusy) (void *poll_fcnt_arg,
CPU_BOOLEAN (*poll_fcnt)(void *arg),
CPU_INT32U to_us,
FS_ERR *p_err);
} FS_NAND_CTRLR_GEN_BSP_API;
Typically, you will provide the board support package implementation. See BSP Development Guide - Generic Controller for details on how to implement the BSP layer.
Other Controllers
If you use a different controller layer implementation than the generic, you will typically need a BSP layer implementation identical or mostly similar. Please refer to Generic Controller unless there is a section of this page dedicated to your BSP.