NXP's driver library for LPC17xx, ported to mbed's online compiler. Not tested! I had to fix a lot of warings and found a couple of pretty obvious bugs, so the chances are there are more. Original: http://ics.nxp.com/support/documents/microcontrollers/zip/lpc17xx.cmsis.driver.library.zip

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

lpc17xx_spi.h File Reference

lpc17xx_spi.h File Reference

: Contains all macro definitions and function prototypes support for SPI firmware library on LPC17xx More...

Go to the source code of this file.

Data Structures

struct  SPI_CFG_Type
 SPI configuration structure. More...
struct  SPI_DATA_SETUP_Type
 SPI Data configuration structure definitions. More...

Enumerations

enum  SPI_TRANSFER_Type { SPI_TRANSFER_POLLING = 0, SPI_TRANSFER_INTERRUPT }
 

SPI Transfer Type definitions.

More...

Functions

void SPI_SetClock (LPC_SPI_TypeDef *SPIx, uint32_t target_clock)
 Setup clock rate for SPI device.
void SPI_DeInit (LPC_SPI_TypeDef *SPIx)
 De-initializes the SPIx peripheral registers to their default reset values.
void SPI_Init (LPC_SPI_TypeDef *SPIx, SPI_CFG_Type *SPI_ConfigStruct)
 Initializes the SPIx peripheral according to the specified parameters in the UART_ConfigStruct.
void SPI_ConfigStructInit (SPI_CFG_Type *SPI_InitStruct)
 Fills each SPI_InitStruct member with its default value:

  • CPHA = SPI_CPHA_FIRST
  • CPOL = SPI_CPOL_HI
  • ClockRate = 1000000
  • DataOrder = SPI_DATA_MSB_FIRST
  • Databit = SPI_DATABIT_8
  • Mode = SPI_MASTER_MODE.

void SPI_SendData (LPC_SPI_TypeDef *SPIx, uint16_t Data)
 Transmit a single data through SPIx peripheral.
uint16_t SPI_ReceiveData (LPC_SPI_TypeDef *SPIx)
 Receive a single data from SPIx peripheral.
void SPI_IntCmd (LPC_SPI_TypeDef *SPIx, FunctionalState NewState)
 Enable or disable SPIx interrupt.
IntStatus SPI_GetIntStatus (LPC_SPI_TypeDef *SPIx)
 Checks whether the SPI interrupt flag is set or not.
void SPI_ClearIntPending (LPC_SPI_TypeDef *SPIx)
 Clear SPI interrupt flag.
uint32_t SPI_GetStatus (LPC_SPI_TypeDef *SPIx)
 Get current value of SPI Status register in SPIx peripheral.
FlagStatus SPI_CheckStatus (uint32_t inputSPIStatus, uint8_t SPIStatus)
 Checks whether the specified SPI Status flag is set or not via inputSPIStatus parameter.
void SPI_StdIntHandler (void)
 Standard SPI Interrupt handler.

Detailed Description

: Contains all macro definitions and function prototypes support for SPI firmware library on LPC17xx

Version:
: 1.0
Date:
: 3. April. 2009
Author:
: HieuNguyen

Software that is described herein is for illustrative purposes only which provides customers with programming information regarding the products. This software is supplied "AS IS" without any warranties. NXP Semiconductors assumes no responsibility or liability for the use of the software, conveys no license or title under any patent, copyright, or mask work right to the product. NXP Semiconductors reserves the right to make changes in the software without notification. NXP Semiconductors also make no representation or warranty that such application will be suitable for the specified use without further testing or modification.

Definition in file lpc17xx_spi.h.