LPCOpen SPIFI FLASH Library (LPCSPIFILIB)
Documentation for the LPCSPIFILIB library
Modules
LPCOpen SPIFI FLASH Library (LPCSPIFILIB)

Detailed Description

The LPCOpen SPIFI FLASH Library (LPCSPIFILIB) provides a standard API for managing SPIFI FLASH devices using the SPIFI FLASH controller available in some LPC devices. The library can be configured to include only the drivers for the devices on a specific platform (a minimum of 1 device family) or can be configured to support multiple devices.

The LPCSPIFILIB library supports the device interface between the LPC device and the SPIFI FLASH device and the protocol to control the device. The LPCSPIFILIB library requires some functions related to the SPIFI FLASH controller and interface to be setup prior to using this library.
Support required outside the LPCSPIFILIB Library

The LPCSPIFILIB software API is broken up into the following sections. The common API functions are the only ones that should be used by an application. All other API's are used exclusevly by the driver and should not be called directly.
LPCSPIFILIB common API functions LPCSPIFILIB device driver API functions LPCSPIFILIB hardware definitions and API functions

The LPCSPIFILIB library consists of a number of device family drivers that cover different SPIFI FLASH device families. The library can be built with just one of these drivers or can be configured to included all of the supported drivers. Using all of the supported drivers will add significant size to the library.
LPCSPIFILIB library drivers

The LPCSPIFILIB library can be built using IAR Embedded Workbench, LPCXpresso, or the Keil ARM MDK. You can link your code directly to a preconfigured library or add the sources files to your project directly and build them with your product.
LPCSPIFILIB library build information

The LPCSPIFILIB library can be used in blocking and non-blocking modes. In the blocking mode, function calls will not return until the full operation is complete and the status of the operation is known. In a non-blocking mode, functions will return immeddiately and status needs to be polled from the driver before starting the next operation.

Use of non-blocking mode affects the erase and program operations. If in blocking mode, the returned status from the erase and program operations indicates the real status of the operation (no errors, erase error, etc.). In non-blocking mode, calling an erase or program operation will only start the operation and return a no error status if the operation started without problems. The device state can be polled using the device status function to determine if the device is still bust. When the operation on the device completes, the device will go unbusy.

Program and erase error status is handled differerntly in blocking and non-blocking modes. In the blocking mode, the status is returned as an error code from the erase or program function call. In the non-blocking mode, the status is returned as a device status returnd with the getInfo() call. Device program and error statuses are not persistent, so they are cleared in the driver when they are read using the getInfo() function.

Examples demonstrating how to use the blocking and non-blocking functions are at the pages below.
LPCSPIFILIB library use model

If you are using a SPIFI FLASH device as a execute-in-place memory for your LPC device, you can't use the SPIFI library if it's located in SPIFI FLASH. To use the library in this case, the library needs to be relocated to another memory (like IRAM) and the functions executed from there. The page below describes how to setup and use the library in this type of system.

Copyright (C) 2014 NXP Semiconductors. All rights reserved.

Modules

 LPCSPIFILIB hardware definitions and API functions
 
 LPCSPIFILIB common API functions
 
 LPCSPIFILIB device driver API functions
 
 LPCSPIFILIB family registration functions
 
 LPCSPIFILIB library build information
 
 Adding a new LPCSPIFILIB Library device
 
 Support required outside the LPCSPIFILIB Library
 
 LPCSPIFILIB library use model