LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ssp_18xx_43xx.h File Reference
#include "chip.h"

Go to the source code of this file.

Data Structures

struct  SSP_ConfigFormat
 
struct  SPI_Address_t
 
struct  Chip_SSP_DATA_SETUP_Type
 

Macros

#define SSP_CPHA_FIRST   SSP_CR0_CPHA_FIRST
 
#define SSP_CPHA_SECOND   SSP_CR0_CPHA_SECOND
 
#define SSP_CPOL_HI   SSP_CR0_CPOL_LO
 
#define SSP_CPOL_LO   SSP_CR0_CPOL_HI
 
#define SSP_SLAVE_MODE   SSP_CR1_SLAVE_EN
 
#define SSP_MASTER_MODE   SSP_CR1_MASTER_EN
 

Enumerations

enum  SSP_ClockFormat {
  SSP_CLOCK_CPHA0_CPOL0 = (0 << 6), SSP_CLOCK_CPHA0_CPOL1 = (1u << 6), SSP_CLOCK_CPHA1_CPOL0 = (2u << 6), SSP_CLOCK_CPHA1_CPOL1 = (3u << 6),
  SSP_CLOCK_MODE0 = SSP_CLOCK_CPHA0_CPOL0, SSP_CLOCK_MODE1 = SSP_CLOCK_CPHA1_CPOL0, SSP_CLOCK_MODE2 = SSP_CLOCK_CPHA0_CPOL1, SSP_CLOCK_MODE3 = SSP_CLOCK_CPHA1_CPOL1
}
 
enum  SSP_FrameFormat { SSP_FRAMEFORMAT_SPI = (0 << 4), SSP_FRAMEFORMAT_TI = (1u << 4), SSP_FRAMEFORMAT_MICROWIRE = (2u << 4) }
 
enum  SSP_Bits {
  SSP_BITS_4 = (3u << 0), SSP_BITS_5 = (4u << 0), SSP_BITS_6 = (5u << 0), SSP_BITS_7 = (6u << 0),
  SSP_BITS_8 = (7u << 0), SSP_BITS_9 = (8u << 0), SSP_BITS_10 = (9u << 0), SSP_BITS_11 = (10u << 0),
  SSP_BITS_12 = (11u << 0), SSP_BITS_13 = (12u << 0), SSP_BITS_14 = (13u << 0), SSP_BITS_15 = (14u << 0),
  SSP_BITS_16 = (15u << 0)
}
 
enum  SSP_Mode { SSP_MODE_MASTER = (0 << 2), SSP_MODE_SLAVE = (1u << 2) }
 

Functions

STATIC INLINE FlagStatus Chip_SSP_GetStatus (LPC_SSP_Type *pSSP, SSP_Status_Type Stat)
 Get the current status of SSP controller.
 
STATIC INLINE void Chip_SSP_Cmd (LPC_SSP_Type *pSSP, FunctionalState NewState)
 Enable/Disable SSP operation.
 
STATIC INLINE void Chip_SSP_DeInit (LPC_SSP_Type *pSSP)
 Disable SSP operation.
 
STATIC INLINE void Chip_SSP_LoopBackCmd (LPC_SSP_Type *pSSP, FunctionalState NewState)
 Enable/Disable loopback mode.
 
void Chip_SSP_Int_FlushData (LPC_SSP_Type *pSSP)
 Clean all data in RX FIFO of SSP.
 
Status Chip_SSP_Int_RWFrames8Bits (LPC_SSP_Type *pSSP, Chip_SSP_DATA_SETUP_Type *xf_setup)
 SSP Interrupt Read/Write with 8-bit frame width.
 
Status Chip_SSP_Int_RWFrames16Bits (LPC_SSP_Type *pSSP, Chip_SSP_DATA_SETUP_Type *xf_setup)
 SSP Interrupt Read/Write with 16-bit frame width.
 
uint32_t Chip_SSP_RWFrames_Blocking (LPC_SSP_Type *pSSP, Chip_SSP_DATA_SETUP_Type *xf_setup)
 SSP Polling Read/Write in blocking mode.
 
uint32_t Chip_SSP_WriteFrames_Blocking (LPC_SSP_Type *pSSP, uint8_t *buffer, uint32_t buffer_len)
 SSP Polling Write in blocking mode.
 
uint32_t Chip_SSP_ReadFrames_Blocking (LPC_SSP_Type *pSSP, uint8_t *buffer, uint32_t buffer_len)
 Note here.
 
void Chip_SSP_Init (LPC_SSP_Type *pSSP)
 Initialize the SSP.
 
void Chip_SSP_Set_Master (LPC_SSP_Type *pSSP, bool master)
 Set the SSP operating modes, master or slave.
 
void Chip_SSP_Set_BitRate (LPC_SSP_Type *pSSP, uint32_t bit_rate)
 Set the clock frequency for SSP interface.
 
void Chip_SSP_Set_Format (LPC_SSP_Type *pSSP, SSP_ConfigFormat *format)
 Set up the SSP frame format.
 
void Chip_SSP_Int_Cmd (LPC_SSP_Type *pSSP, FunctionalState NewState)
 Enable/Disable SSP interrupt.
 
void Chip_SSP_DMA_Cmd (LPC_SSP_Type *pSSP, FunctionalState NewState)
 Enable/Disable DMA.