
UM10800
All information provided in this document is subject to legal disclaimers.
© NXP Semiconductors N.V. 2016. All rights reserved.
User manual
Rev. 1.2 — 5 October 2016
407 of 487
NXP Semiconductors
UM10800
Chapter 28: LPC82x SPI API ROM driver routines
28.4.7 Error codes
typedef enum
{
ERR_SPI_BASE = 0x000E0000,
/*0x000E0001*/ ERR_SPI_RXOVERRUN=ERR_S1,
/*0x000E0002*/ ERR_SPI_TXUNDERRUN,
/*0x000E0003*/ ERR_SPI_SELNASSERT,
/*0x000E0004*/ ERR_SPI_SELNDEASSERT,
/*0x000E0005*/ ERR_SPI_CLKSTALL,
/*0x000E0006*/ ERR_SPI_PARAM,
/*0x000E0007*/ ERR_SPI_INVALID_LENGTH
} ErrorCode_t;
28.4.8 SPI ROM driver variables
28.4.8.1 SPI_HANDLE_T
The handle to the instance of the SPI driver. Each SPI has one handle, so there can be
several handles for each SPI block. This handle is created by Init API and used by the
transfer functions for the corresponding SPI block.
typedef void SPI_HANDLE_T ; // define TYPE for SPI handle pointer
28.4.8.2 SPI_CONFIG_T
Typdef struct {
uint32_t delay;
uint32_t divider;
uint32_t config; // config register
uint32_t error_en; //Bit0: OverrunEn, bit1: UnderrunEn,
} SPI_CONFIG_T;
The following variables are used in this structure:
delay
: Configures the delay between SSEL and data transfers and between frames. The
value is the content of the SPI DLY register. See
.
divider
: Clock divider value DIVVAL in the SPI DIV register. See
.
config
: Enable SPI, configure master/slave, configure signal phase and polarity. The
value is the content of the SPI CFG register. See
Table 363. Error codes
Return code
Error Code
Description
0x000E 0001
ERR_SPI_RXOVERRUN
0x000E 0002
ERR_SPI_TXUNDERRUN
0x000E 0003
ERR_SPI_SELNASSERT
0x000E 0004
ERR_SPI_SELNDEASSERT
0x000E 0005
ERR_SPI_CLKSTALL
0x000E 0006
ERR_SPI_PARAM
0x000E 0007
ERR_SPI_INVALID_LENGTH